diff --git a/astro/foxtrotgps/Makefile b/astro/foxtrotgps/Makefile index 1de6e505a57b..478a8604ee22 100644 --- a/astro/foxtrotgps/Makefile +++ b/astro/foxtrotgps/Makefile @@ -1,39 +1,40 @@ # Created by: crwhipp@gmail.com PORTNAME= foxtrotgps PORTVERSION= 1.2.2 +PORTREVISION= 1 CATEGORIES= astro geography MASTER_SITES= http://www.foxtrotgps.org/releases/ MAINTAINER= crwhipp@gmail.com COMMENT= Lightweight opensource gps moving map application LICENSE= GPLv2 LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libcurl.so:ftp/curl \ libexif.so:graphics/libexif \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libgps.so:astro/gpsd \ libsoup-2.4.so:devel/libsoup USES= compiler:c++11-lang gettext gmake gnome pkgconfig python \ shebangfix sqlite:3 USE_GNOME= cairo gconf2 gtk20 intltool libglade2 libxml2 GLIB_SCHEMAS= org.foxtrotgps.gschema.xml SHEBANG_FILES= contrib/convert2gpx \ contrib/convert2osm \ contrib/georss2foxtrotgps-poi\ contrib/gpx2osm \ contrib/osb2foxtrot \ contrib/poi2osm GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-schemas-install CONFIGURE_ENV= DATADIRNAME=share INFO= foxtrotgps .include diff --git a/astro/foxtrotgps/files/patch-src_gps__functions.c b/astro/foxtrotgps/files/patch-src_gps__functions.c index 9b41464e09cc..c292f3f582b6 100644 --- a/astro/foxtrotgps/files/patch-src_gps__functions.c +++ b/astro/foxtrotgps/files/patch-src_gps__functions.c @@ -1,23 +1,32 @@ ---- src/gps_functions.c.orig 2020-03-05 17:21:38 UTC +--- src/gps_functions.c.orig 2019-07-10 05:35:12 UTC +++ src/gps_functions.c -@@ -735,6 +735,11 @@ cb_gpsd_io_error(GIOChannel *src, GIOCondition conditi +@@ -729,6 +729,11 @@ cb_gpsd_io_error(GIOChannel *src, GIOCondition conditi } +static double +timespec_to_double(struct timespec ts) +{ + return ((double)(ts.tv_sec) + ((double)(ts.tv_nsec) / 1e9)); +} static gboolean cb_gpsd_data(GIOChannel *src, GIOCondition condition, gpointer data) -@@ -755,7 +760,7 @@ cb_gpsd_data(GIOChannel *src, GIOCondition condition, +@@ -753,12 +758,16 @@ cb_gpsd_data(GIOChannel *src, GIOCondition condition, { gpsdata->satellites_used = libgps_gpsdata.satellites_used; gpsdata->hdop = libgps_gpsdata.dop.hdop; - gpsdata->fix.time = libgps_gpsdata.fix.time; + gpsdata->fix.time = timespec_to_double(libgps_gpsdata.fix.time); if (isnan(gpsdata->fix.time)) { gpsdata->fix.time = (time_t) 0; + } ++#if GPSD_API_MAJOR_VERSION >= 10 ++ gpsdata->valid = (libgps_gpsdata.fix.status != STATUS_UNK); ++#else + gpsdata->valid = (libgps_gpsdata.status != STATUS_NO_FIX); ++#endif + if (gpsdata->valid) + { + gpsdata->seen_valid = TRUE;