diff options
author | nork <nork@FreeBSD.org> | 2003-04-12 04:37:09 +0800 |
---|---|---|
committer | nork <nork@FreeBSD.org> | 2003-04-12 04:37:09 +0800 |
commit | eb1c00f6a81f07db9d65f20fa486877588059cd1 (patch) | |
tree | bccdf6ab23571e6af212cfba1728d655a76c5006 | |
parent | 45d0573e8a1415228a8bb499a504d30974e16a1c (diff) | |
download | freebsd-ports-gnome-eb1c00f6a81f07db9d65f20fa486877588059cd1.tar.gz freebsd-ports-gnome-eb1c00f6a81f07db9d65f20fa486877588059cd1.tar.zst freebsd-ports-gnome-eb1c00f6a81f07db9d65f20fa486877588059cd1.zip |
Add wmweather+ 2.4, think wmweather with forecasts, weather
map, and a sky cond. display.
PR: ports/50834
Submitted by: Harald Wille <harald.wille@students.jku.at>
-rw-r--r-- | misc/Makefile | 1 | ||||
-rw-r--r-- | misc/wmweather+/Makefile | 26 | ||||
-rw-r--r-- | misc/wmweather+/distinfo | 1 | ||||
-rw-r--r-- | misc/wmweather+/files/patch-convert.c | 106 | ||||
-rw-r--r-- | misc/wmweather+/files/patch-convert.h | 11 | ||||
-rw-r--r-- | misc/wmweather+/files/patch-moon.c | 11 | ||||
-rw-r--r-- | misc/wmweather+/files/patch-subst.c | 11 | ||||
-rw-r--r-- | misc/wmweather+/files/patch-wmweather+.c | 28 | ||||
-rw-r--r-- | misc/wmweather+/pkg-descr | 8 | ||||
-rw-r--r-- | misc/wmweather+/pkg-plist | 1 |
10 files changed, 204 insertions, 0 deletions
diff --git a/misc/Makefile b/misc/Makefile index 5a03d3b5eede..19f591c83c9c 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -328,6 +328,7 @@ SUBDIR += wmstock SUBDIR += wmtunlo SUBDIR += wmweather + SUBDIR += wmweather+ SUBDIR += wmwork SUBDIR += wmx10 SUBDIR += xd diff --git a/misc/wmweather+/Makefile b/misc/wmweather+/Makefile new file mode 100644 index 000000000000..a54da9b47636 --- /dev/null +++ b/misc/wmweather+/Makefile @@ -0,0 +1,26 @@ +# New ports collection makefile for: wmweather+-2.4 +# Date created: 11 April 2003 +# Whom: Harald Wille <harald.wille@students.jku.at> +# +# $FreeBSD$ + +PORTNAME= wmweather+ +PORTVERSION= 2.4 +CATEGORIES= misc windowmaker +MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} +MASTER_SITE_SUBDIR= wmweatherplus + +MAINTAINER= harald.wille@students.jku.at +COMMENT= Think wmweather with forecasts, weather map, and a sky cond. display + +GNU_CONFIGURE= yes +USE_X_PREFIX= yes +USE_XPM= yes + +MAN1= wmweather+.1 + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/wmweather+ ${PREFIX}/bin + ${INSTALL_MAN} ${WRKSRC}/wmweather+.1 ${PREFIX}/man/man1 + +.include <bsd.port.mk> diff --git a/misc/wmweather+/distinfo b/misc/wmweather+/distinfo new file mode 100644 index 000000000000..451d634695dc --- /dev/null +++ b/misc/wmweather+/distinfo @@ -0,0 +1 @@ +MD5 (wmweather+-2.4.tar.gz) = f09d1b31da5fd171b27715121e2d9662 diff --git a/misc/wmweather+/files/patch-convert.c b/misc/wmweather+/files/patch-convert.c new file mode 100644 index 000000000000..0bb59872ff77 --- /dev/null +++ b/misc/wmweather+/files/patch-convert.c @@ -0,0 +1,106 @@ +--- convert.c.orig Sun Sep 22 22:00:53 2002 ++++ convert.c Fri Apr 11 02:07:44 2003 +@@ -52,7 +52,7 @@ + if(temp_C==999 || dewpt_C==999) return 999; + + f=1782.75*(dewpt_C-temp_C)/((237.7+dewpt_C)*(237.7+temp_C)); +- return round(pow(10, f+2)); ++ return rint(pow(10, f+2)); + } + + int rh_F(int temp_F, int dewpt_F){ +@@ -61,7 +61,7 @@ + if(temp_F==999 || dewpt_F==999) return 999; + + f=3208.95*(dewpt_F-temp_F)/((395.86+dewpt_F)*(395.86+temp_F)); +- return round(pow(10, f+2)); ++ return rint(pow(10, f+2)); + } + + int heatindex_C(int temp_C, int rh){ +@@ -75,7 +75,7 @@ + + temp2=temp_C*temp_C; + rh2=rh*rh; +- return round(16.18754948 + 2.900509394*temp_C - 0.0221545692*temp2 + 4.20938791*rh - 0.26300889*temp_C*rh + 0.0039811176*temp2*rh - 0.02956469*rh2 + 0.001305828*temp_C*rh2 - 6.4476e-06*temp2*rh2); ++ return rint(16.18754948 + 2.900509394*temp_C - 0.0221545692*temp2 + 4.20938791*rh - 0.26300889*temp_C*rh + 0.0039811176*temp2*rh - 0.02956469*rh2 + 0.001305828*temp_C*rh2 - 6.4476e-06*temp2*rh2); + #endif + } + +@@ -88,9 +88,9 @@ + temp3=temp2*temp_F; + rh2=rh*rh; + rh3=rh2*rh; +- return round(16.923 + .185212*temp_F + 5.37941*rh - .100254*temp_F*rh + (9.41695e-3)*temp2 + (7.28898e-3)*rh2 + (3.45372e-4)*temp2*rh - (8.14971e-4)*temp_F*rh2 + (1.02102e-5)*temp2*rh2 - (3.8646e-5)*temp3 + (2.91583e-5)*rh3 + (1.42721e-6)*temp3*rh + (1.97483e-7)*temp_F*rh3 - (2.18429e-8)*temp3*rh2 + (8.43296e-10)*temp2*rh3 - (4.81975e-11)*temp3*rh3); ++ return rint(16.923 + .185212*temp_F + 5.37941*rh - .100254*temp_F*rh + (9.41695e-3)*temp2 + (7.28898e-3)*rh2 + (3.45372e-4)*temp2*rh - (8.14971e-4)*temp_F*rh2 + (1.02102e-5)*temp2*rh2 - (3.8646e-5)*temp3 + (2.91583e-5)*rh3 + (1.42721e-6)*temp3*rh + (1.97483e-7)*temp_F*rh3 - (2.18429e-8)*temp3*rh2 + (8.43296e-10)*temp2*rh3 - (4.81975e-11)*temp3*rh3); + #if 0 +- return round(-42.379 + 2.04901523*temp_F + 10.14333127*rh - 0.22475541*temp_F*rh - .00683783*temp2 - .05481717*rh2 + .00122874*temp2*rh + .00085282*temp_F*rh2 - .00000199*temp2*rh2); ++ return rint(-42.379 + 2.04901523*temp_F + 10.14333127*rh - 0.22475541*temp_F*rh - .00683783*temp2 - .05481717*rh2 + .00122874*temp2*rh + .00085282*temp_F*rh2 - .00000199*temp2*rh2); + #endif + } + +@@ -106,14 +106,14 @@ + + ret=35.74 + 0.6215*temp_F + (-35.75 + 0.4275*temp_F)*pow(windspeed*50292/57875.0, 0.16); + if(ret>temp_F) return temp_F; +- return round(ret); ++ return rint(ret); + } + + /* Length Conversions */ + + int in2cm(int in){ + if(in<0) return in; +- return round(in*2.54); ++ return rint(in*2.54); + } + + float m2mi(int meters){ +@@ -125,27 +125,27 @@ + + int knots2mph(int knots){ + if(knots<0) return knots; +- return round(knots*57875/50292.0); ++ return rint(knots*57875/50292.0); + } + + int knots2kph(int knots){ + if(knots<0) return knots; +- return round(knots*463/250.0); ++ return rint(knots*463/250.0); + } + + int kph2knots(int kph){ + if(kph<0) return kph; +- return round(kph*250/463.0); ++ return rint(kph*250/463.0); + } + + int knots2mps(int knots){ + if(knots<0) return knots; +- return round(knots*463/900.0); ++ return rint(knots*463/900.0); + } + + int mps2knots(int mps){ + if(mps<0) return mps; +- return round(mps*900/463.0); ++ return rint(mps*900/463.0); + } + + int knots2beaufort(int knots){ +@@ -170,12 +170,12 @@ + + int temp_C2F(int temp_C){ + if(temp_C==999) return 999; +- return round(temp_C*9/5.0+32); ++ return rint(temp_C*9/5.0+32); + } + + int temp_F2C(int temp_F){ + if(temp_F==999) return 999; +- return round((temp_F-32)*5/9.0); ++ return rint((temp_F-32)*5/9.0); + } + + diff --git a/misc/wmweather+/files/patch-convert.h b/misc/wmweather+/files/patch-convert.h new file mode 100644 index 000000000000..31339f20c4a3 --- /dev/null +++ b/misc/wmweather+/files/patch-convert.h @@ -0,0 +1,11 @@ +--- convert.h.orig Fri Sep 6 04:04:06 2002 ++++ convert.h Fri Apr 11 02:07:44 2003 +@@ -12,6 +12,8 @@ + * x<0 is used for rh, pressure, and windspeed + */ + ++#define NAN 0/0 ++ + /* Calculations */ + int rh_C(int temp_C, int dewpt_C); + int rh_F(int temp_F, int dewpt_F); diff --git a/misc/wmweather+/files/patch-moon.c b/misc/wmweather+/files/patch-moon.c new file mode 100644 index 000000000000..5402458672c7 --- /dev/null +++ b/misc/wmweather+/files/patch-moon.c @@ -0,0 +1,11 @@ +--- moon.c.orig Sun Sep 22 22:00:53 2002 ++++ moon.c Fri Apr 11 02:07:44 2003 +@@ -44,7 +44,7 @@ + #include "wmgeneral/wmgeneral-x11.h" + + static double fpart(double t){ +- return t-trunc(t); ++ return rint(t); + } + + double calc_moon(int month, int day, int year, int hm){ diff --git a/misc/wmweather+/files/patch-subst.c b/misc/wmweather+/files/patch-subst.c new file mode 100644 index 000000000000..47970b1ce01d --- /dev/null +++ b/misc/wmweather+/files/patch-subst.c @@ -0,0 +1,11 @@ +--- subst.c.orig Sun Sep 22 22:00:53 2002 ++++ subst.c Fri Apr 11 02:07:44 2003 +@@ -48,7 +48,7 @@ + char *format=NULL; + size_t formatlen=0; + int flags; +- ssize_t str_start; ++ size_t str_start; + + for(i=j=0; s[i]!='\0'; i++){ + if(s[i]!='%'){ diff --git a/misc/wmweather+/files/patch-wmweather+.c b/misc/wmweather+/files/patch-wmweather+.c new file mode 100644 index 000000000000..dfc56f2d8529 --- /dev/null +++ b/misc/wmweather+/files/patch-wmweather+.c @@ -0,0 +1,28 @@ +--- wmweather+.c.orig Sun Mar 23 01:04:41 2003 ++++ wmweather+.c Fri Apr 11 02:07:45 2003 +@@ -103,7 +103,7 @@ + /********************************** + * Prototypes + **********************************/ +-void usage(int i) __THROW __attribute__ ((__noreturn__)); ++void usage(int i); + void printversion(void); + int readconf(char *file); + int parse_option(char *option, char *value); +@@ -671,12 +671,12 @@ + F("Please specify a METAR station.\n See http://www.nws.noaa.gov/tg/siteloc.shtml\n"); + } + if(latitude==999){{ +- time_t t=0; + int flag=0; +- +- localtime(&t); ++ time_t t=time(NULL); ++ struct tm *tm; ++ tm=gmtime(&t); + latitude=0; +- longitude=timezone/240; ++ longitude=tm->tm_gmtoff/240; + if(longitude<0){ + flag=1; + longitude=-longitude; diff --git a/misc/wmweather+/pkg-descr b/misc/wmweather+/pkg-descr new file mode 100644 index 000000000000..f330281d7ae4 --- /dev/null +++ b/misc/wmweather+/pkg-descr @@ -0,0 +1,8 @@ +wmweather+ will download the National Weather Serivce METAR bulletins, +ANV and MRF forecasts, and any weather map for display in a WindowMaker +dockapp. Think wmweather with a smaller font, forecasts, a weather map, +and a sky condition display. +You will need to look up the METAR code for your city (a standard code +used in aviation) + +WWW: http://www.nws.noaa.gov/tg/siteloc.shtml diff --git a/misc/wmweather+/pkg-plist b/misc/wmweather+/pkg-plist new file mode 100644 index 000000000000..e2f90e874d55 --- /dev/null +++ b/misc/wmweather+/pkg-plist @@ -0,0 +1 @@ +bin/wmweather+ |