aboutsummaryrefslogtreecommitdiff
path: root/net/libmateweather
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2016-09-29 12:08:49 +0000
committerKoop Mast <kwm@FreeBSD.org>2016-09-29 12:08:49 +0000
commita27a30cecd075e6c279a88f401ce991e85f0bd62 (patch)
tree8cc0112d70aa82b5145472369bc361d13fe824b8 /net/libmateweather
parentb41e2a1f24341488840aacfab15754f1a5d692ef (diff)
Notes
Diffstat (limited to 'net/libmateweather')
-rw-r--r--net/libmateweather/Makefile14
-rw-r--r--net/libmateweather/files/patch-libmateweather_weather-iwin.c11
-rw-r--r--net/libmateweather/files/patch-libmateweather_weather-metar.c39
3 files changed, 59 insertions, 5 deletions
diff --git a/net/libmateweather/Makefile b/net/libmateweather/Makefile
index 5ada226a0145..1f95f651c5ba 100644
--- a/net/libmateweather/Makefile
+++ b/net/libmateweather/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libmateweather
PORTVERSION= 1.12.1
+PORTREVISION= 1
CATEGORIES= net mate
MASTER_SITES= MATE
DIST_SUBDIR= mate
@@ -10,21 +11,24 @@ DIST_SUBDIR= mate
MAINTAINER= gnome@FreeBSD.org
COMMENT= Library to accessing online weather informations
+LICENSE= LGPL21
+LICENSE_FILE= ${WRKSRC}/COPYING
+
BUILD_DEPENDS= itstool:textproc/itstool
-LIB_DEPENDS= libsoup-2.4.so:devel/libsoup
+LIB_DEPENDS= libsoup-2.4.so:devel/libsoup \
+ libfontconfig.so:x11-fonts/fontconfig \
+ libfreetype.so:print/freetype2
PORTSCOUT= limitw:1,even
-USES= gettext gmake libtool pathfix pkgconfig tar:xz
-USE_GNOME= gtk20 libxml2 intlhack
+USES= gettext gmake libtool localbase pathfix pkgconfig tar:xz
+USE_GNOME= cairo gtk20 libxml2 intlhack
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
CONFIGURE_ARGS= --disable-gtk-doc \
--with-gtk=2.0 \
--with-html-dir=${PREFIX}/share/doc
INSTALLS_ICONS= yes
-CPPFLAGS+= -I${LOCALBASE}/include
-LDFLAGS+= -L${LOCALBASE}/lib
INSTALL_TARGET= install-strip
GLIB_SCHEMAS= org.mate.weather.gschema.xml
diff --git a/net/libmateweather/files/patch-libmateweather_weather-iwin.c b/net/libmateweather/files/patch-libmateweather_weather-iwin.c
new file mode 100644
index 000000000000..ca02969da082
--- /dev/null
+++ b/net/libmateweather/files/patch-libmateweather_weather-iwin.c
@@ -0,0 +1,11 @@
+--- libmateweather/weather-iwin.c.orig 2016-09-29 14:03:12.143111000 +0200
++++ libmateweather/weather-iwin.c 2016-09-29 14:03:35.883636000 +0200
+@@ -462,7 +462,7 @@ iwin_start_open (WeatherInfo *info)
+ zone = g_ascii_strdown (loc->zone, -1);
+ state = g_strndup (zone, 2);
+
+- url = g_strdup_printf ("http://weather.noaa.gov/pub/data/forecasts/zone/%s/%s.txt", state, zone);
++ url = g_strdup_printf ("http://tgftp.nws.noaa.gov/data/forecasts/zone/%s/%s.txt", state, zone);
+
+ g_free (zone);
+ g_free (state);
diff --git a/net/libmateweather/files/patch-libmateweather_weather-metar.c b/net/libmateweather/files/patch-libmateweather_weather-metar.c
new file mode 100644
index 000000000000..aa992cae6df4
--- /dev/null
+++ b/net/libmateweather/files/patch-libmateweather_weather-metar.c
@@ -0,0 +1,39 @@
+--- libmateweather/weather-metar.c.orig 2016-09-29 14:03:25.503926000 +0200
++++ libmateweather/weather-metar.c 2016-09-29 14:03:40.232655000 +0200
+@@ -510,7 +510,7 @@ metar_finish (SoupSession *session, Soup
+
+ loc = info->location;
+
+- searchkey = g_strdup_printf ("\n%s", loc->code);
++ searchkey = g_strdup_printf ("<raw_text>%s", loc->code);
+ p = strstr (msg->response_body->data, searchkey);
+ g_free (searchkey);
+ if (p) {
+@@ -522,8 +522,8 @@ metar_finish (SoupSession *session, Soup
+ metar = g_strdup (p);
+ success = metar_parse (metar, info);
+ g_free (metar);
+- } else if (!strstr (msg->response_body->data, "National Weather Service")) {
+- /* The response doesn't even seem to have come from NWS...
++ } else if (!strstr (msg->response_body->data, "aviationweather.gov")) {
++ /* The response doesn't even seem to have come from NOAA...
+ * most likely it is a wifi hotspot login page. Call that a
+ * network error.
+ */
+@@ -550,8 +550,14 @@ metar_start_open (WeatherInfo *info)
+ }
+
+ msg = soup_form_request_new (
+- "GET", "http://weather.noaa.gov/mgetmetar.php",
+- "cccc", loc->code,
++ "GET", "https://www.aviationweather.gov/adds/dataserver_current/httpparam",
++ "dataSource", "metars",
++ "requestType", "retrieve",
++ "format", "xml",
++ "hoursBeforeNow", "3",
++ "mostRecent", "true",
++ "fields", "raw_text",
++ "stationString", loc->code,
+ NULL);
+ soup_session_queue_message (info->session, msg, metar_finish, info);
+