On Tue, July 23, 2019 09:26, Kirill Bychkov wrote:
> On Thu, June 20, 2019 10:08, Kirill Bychkov wrote:
>> Hi!
>> Long time ago I've started update of gpsd from 2.x to 3.x.
>> Upstream moved from auto crap to scons so it gave me some
>> headache.
>> Before switching to new gpsd we need to prepare some ports
>> which are linking against libgps because API has changed.
>> Here are the diffs for foxtrotgps, geoclue and qlandkaretegt.
>> (diff for geo/viking is still WIP):
>
> Hi!
> Diff for viking is attached. This update adds support for
> newer gpsd API.
> Successfuly buuilds on amd64, i386 and macppc. Works fine
> on amd64.
> OK?
>
>
>>
>> Index: patches/patch-src_gps_functions_c
>> ===================================================================
>> RCS file: patches/patch-src_gps_functions_c
>> diff -N patches/patch-src_gps_functions_c
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-src_gps_functions_c 14 Jun 2019 07:04:02 -0000
>> @@ -0,0 +1,20 @@
>> +$OpenBSD$
>> +
>> +Fix build with newer gpsd API.
>> +https://bazaar.launchpad.net/~foxtrotgps-team/foxtrotgps/trunk/revision/316
>> +
>> +Index: src/gps_functions.c
>> +--- src/gps_functions.c.orig
>> ++++ src/gps_functions.c
>> +@@ -738,7 +738,11 @@ cb_gpsd_data(GIOChannel *src, GIOCondition condition,
>> + if (!libgps_initialized)
>> + return FALSE;
>> +
>> ++#if GPSD_API_MAJOR_VERSION >= 7 /* API change. gpsd version 3.18 and
>> subsequent. */
>> ++ ret = gps_read(&libgps_gpsdata, NULL, 0);
>> ++#else
>> + ret = gps_read(&libgps_gpsdata);
>> ++#endif
>> + /* Note that gps_read() will never actually return 0
>> + (zero-length reads are converted internally to a -1 return,
>> + since they mean that the connection to the daemon has closed),
>>
>>
>> ____________________________________________
>>
>> Index: patches/patch-providers_gpsd_geoclue-gpsd_c
>> ===================================================================
>> RCS file: patches/patch-providers_gpsd_geoclue-gpsd_c
>> diff -N patches/patch-providers_gpsd_geoclue-gpsd_c
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-providers_gpsd_geoclue-gpsd_c 14 Jun 2019 07:11:23
>> -0000
>> @@ -0,0 +1,72 @@
>> +$OpenBSD$
>> +
>> +Fix build with newer gpsd API.
>> +
>> +--- providers/gpsd/geoclue-gpsd.c.orig Tue Jul 31 20:47:05 2012
>> ++++ providers/gpsd/geoclue-gpsd.c Sun Mar 27 12:35:47 2016
>> +@@ -40,7 +40,12 @@
>> + #include <geoclue/gc-iface-position.h>
>> + #include <geoclue/gc-iface-velocity.h>
>> +
>> ++#if GPSD_API_MAJOR_VERSION >= 5
>> ++/* gps_data conflicts with gps_data function */
>> ++typedef struct gps_data_t gps_data_l;
>> ++#else
>> + typedef struct gps_data_t gps_data;
>> ++#endif
>> + typedef struct gps_fix_t gps_fix;
>> +
>> + /* only listing used tags */
>> +@@ -59,7 +64,11 @@ typedef struct {
>> + char *host;
>> + char *port;
>> +
>> ++#if GPSD_API_MAJOR_VERSION >= 5
>> ++ gps_data_l *gpsdata;
>> ++#else
>> + gps_data *gpsdata;
>> ++#endif
>> +
>> + gps_fix *last_fix;
>> +
>> +@@ -397,10 +406,16 @@ geoclue_gpsd_stop_gpsd (GeoclueGpsd *self)
>> + static gboolean
>> + geoclue_gpsd_start_gpsd (GeoclueGpsd *self)
>> + {
>> ++#if GPSD_API_MAJOR_VERSION >= 5
>> ++ int status = gps_open (self->host, self->port, self->gpsdata);
>> ++ if (status == 0) {
>> ++ gps_stream(self->gpsdata, WATCH_ENABLE | WATCH_NMEA, NULL);
>> ++#else
>> + self->gpsdata = gps_open (self->host, self->port);
>> + if (self->gpsdata) {
>> + gps_stream(self->gpsdata, WATCH_ENABLE | WATCH_NMEA |
>> POLL_NONBLOCK,
>> NULL);
>> + gps_set_raw_hook (self->gpsdata, gpsd_raw_hook);
>> ++#endif
>> + return TRUE;
>> + } else {
>> + g_warning ("gps_open() failed, is gpsd running
>> (host=%s,port=%s)?",
>> self->host, self->port);
>> +@@ -413,10 +428,23 @@ gpsd_poll(gpointer data)
>> + {
>> + GeoclueGpsd *self = (GeoclueGpsd*)data;
>> + if (self->gpsdata) {
>> ++#if GPSD_API_MAJOR_VERSION >= 5
>> ++ /* gps_poll and gps_set_raw_hook no longer present in this API
>> version
>> */
>> ++ if (gps_waiting(self->gpsdata, 500)) {
>> ++ if (gps_read(self->gpsdata) == -1) {
>> ++ geoclue_gpsd_set_status (self,
>> GEOCLUE_STATUS_ERROR);
>> ++ geoclue_gpsd_stop_gpsd(self);
>> ++ return FALSE;
>> ++ } else {
>> ++ /* Call existing raw_hook to process the data */
>> ++ gpsd_raw_hook(self->gpsdata, NULL, 0);
>> ++ }
>> ++#else
>> + if (gps_poll(self->gpsdata) < 0) {
>> + geoclue_gpsd_set_status (self, GEOCLUE_STATUS_ERROR);
>> + geoclue_gpsd_stop_gpsd(self);
>> + return FALSE;
>> ++#endif
>> + }
>> + }
>> + return TRUE;
>>
>>
>> ______________________________________________________
>>
>> Index: patches/patch-src_CDeviceGPSD_cpp
>> ===================================================================
>> RCS file: patches/patch-src_CDeviceGPSD_cpp
>> diff -N patches/patch-src_CDeviceGPSD_cpp
>> --- /dev/null 1 Jan 1970 00:00:00 -0000
>> +++ patches/patch-src_CDeviceGPSD_cpp 16 Jun 2019 07:14:21 -0000
>> @@ -0,0 +1,18 @@
>> +$OpenBSD$
>> +
>> +Fix build with newer gpsd API
>> +
>> +Index: src/CDeviceGPSD.cpp
>> +--- src/CDeviceGPSD.cpp.orig
>> ++++ src/CDeviceGPSD.cpp
>> +@@ -212,7 +212,9 @@ void CGPSDThread::run()
>> + } // if
>> + else if( FD_ISSET( gpsdata->gps_fd, &fds ) )
>> + {
>> +-#if GPSD_API_MAJOR_VERSION >= 5
>> ++#if GPSD_API_MAJOR_VERSION >= 7
>> ++ gps_read( gpsdata, NULL, 0 );
>> ++#elif GPSD_API_MAJOR_VERSION >= 5
>> + gps_read( gpsdata );
>> + #else
>> + gps_poll( gpsdata );
>>
>> Build was tested on amd64 with gpsd-3.18. No tests with gps yet.
>> Comments?
>>
>>
>>
>>
>
>
>
Index: Makefile
===================================================================
RCS file: /cvs/ports/geo/viking/Makefile,v
retrieving revision 1.40
diff -u -p -r1.40 Makefile
--- Makefile 12 Jul 2019 20:46:56 -0000 1.40
+++ Makefile 19 Jul 2019 06:07:20 -0000
@@ -2,8 +2,7 @@
COMMENT = GPS track manager
-DISTNAME = viking-1.6.2
-REVISION = 5
+DISTNAME = viking-1.7
CATEGORIES = geo x11
@@ -15,10 +14,10 @@ PERMIT_PACKAGE = Yes
WANTLIB += X11 Xcomposite Xcursor Xdamage Xext Xfixes Xi Xinerama Xrandr
WANTLIB += Xrender atk-1.0 bz2 c cairo crypto curl expat fontconfig
-WANTLIB += freetype gdk-x11-2.0 gdk_pixbuf-2.0 gexiv2 gio-2.0 glib-2.0
-WANTLIB += gobject-2.0 gps gthread-2.0 gtk-x11-2.0 iconv intl m magic nghttp2
-WANTLIB += pango-1.0 pangocairo-1.0 pangoft2-1.0 pthread sqlite3 ssl z
-WANTLIB += ${COMPILER_LIBCXX}
+WANTLIB += freetype gdk-x11-2.0 gdk_pixbuf-2.0 geoclue-2 gexiv2 gio-2.0
+WANTLIB += glib-2.0 gobject-2.0 gps gthread-2.0 gtk-x11-2.0 iconv intl m
+WANTLIB += magic nettle nghttp2 pango-1.0 pangocairo-1.0 pangoft2-1.0
+WANTLIB += pthread sqlite3 ssl z ${COMPILER_LIBCXX}
MASTER_SITES = ${MASTER_SITE_SOURCEFORGE:=viking/}
EXTRACT_SUFX = .tar.bz2
@@ -26,7 +25,6 @@ EXTRACT_SUFX = .tar.bz2
MODULES = textproc/intltool x11/gnome
COMPILER = base-clang ports-gcc
-MODGCC4_ARCHS = amd64 i386 powerpc sparc64
CONFIGURE_STYLE = gnu
# to ensure X11 libs are found when checking for -lmapnik
@@ -36,11 +34,14 @@ MODGNOME_TOOLS += desktop-file-utils gtk
USE_GMAKE = Yes
# until mapnik is fixed..
-CONFIGURE_ARGS += --disable-mapnik
+CONFIGURE_ARGS += --disable-mapnik \
+ --disable-oauth \
+ --disable-zip
LIB_DEPENDS = archivers/bzip2 \
databases/sqlite3 \
devel/libidn \
devel/libmagic \
+ geo/geoclue2 \
graphics/libgexiv2 \
misc/gpsd \
net/curl \
Index: distinfo
===================================================================
RCS file: /cvs/ports/geo/viking/distinfo,v
retrieving revision 1.9
diff -u -p -r1.9 distinfo
--- distinfo 30 Dec 2015 14:45:42 -0000 1.9
+++ distinfo 19 Jul 2019 06:07:20 -0000
@@ -1,2 +1,2 @@
-SHA256 (viking-1.6.2.tar.bz2) = 3+Ijsc06H+02FqcOcyMh25ATyJ3z/W4a0PczobsGeCY=
-SIZE (viking-1.6.2.tar.bz2) = 3324897
+SHA256 (viking-1.7.tar.bz2) = fHkejNti2/R3bjf5X9soJaxIVQ4/aCmgFeGzDHYTWCQ=
+SIZE (viking-1.7.tar.bz2) = 3438343
Index: patches/patch-src_gpspoint_c
===================================================================
RCS file: /cvs/ports/geo/viking/patches/patch-src_gpspoint_c,v
retrieving revision 1.2
diff -u -p -r1.2 patch-src_gpspoint_c
--- patches/patch-src_gpspoint_c 2 Apr 2015 13:59:32 -0000 1.2
+++ patches/patch-src_gpspoint_c 19 Jul 2019 06:07:20 -0000
@@ -1,9 +1,10 @@
$OpenBSD: patch-src_gpspoint_c,v 1.2 2015/04/02 13:59:32 landry Exp $
taken from pkgsrc/geography/viking/patch-aa
http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=40695
---- src/gpspoint.c.orig Tue Oct 21 22:25:06 2014
-+++ src/gpspoint.c Thu Apr 2 15:01:24 2015
-@@ -88,8 +88,8 @@ static gdouble line_altitude = VIK_DEFAULT_ALTITUDE;
+Index: src/gpspoint.c
+--- src/gpspoint.c.orig
++++ src/gpspoint.c
+@@ -94,8 +94,8 @@ static gdouble line_altitude = VIK_DEFAULT_ALTITUDE;
static gboolean line_visible = TRUE;
static gboolean line_extended = FALSE;
@@ -13,4 +14,4 @@ http://gnats.netbsd.org/cgi-bin/query-pr
+static gdouble line_course = __builtin_nanf("");
static gint line_sat = 0;
static gint line_fix = 0;
- /* other possible properties go here */
+ static gdouble line_hdop = VIK_DEFAULT_DOP;
Index: patches/patch-src_vikmapniklayer_c
===================================================================
RCS file: /cvs/ports/geo/viking/patches/patch-src_vikmapniklayer_c,v
retrieving revision 1.1
diff -u -p -r1.1 patch-src_vikmapniklayer_c
--- patches/patch-src_vikmapniklayer_c 18 Sep 2015 20:09:26 -0000 1.1
+++ patches/patch-src_vikmapniklayer_c 19 Jul 2019 06:07:20 -0000
@@ -1,8 +1,9 @@
$OpenBSD: patch-src_vikmapniklayer_c,v 1.1 2015/09/18 20:09:26 landry Exp $
---- src/vikmapniklayer.c.orig Sun Mar 29 12:59:47 2015
-+++ src/vikmapniklayer.c Fri Sep 18 20:17:07 2015
-@@ -235,7 +235,7 @@ static VikLayerParamData plugins_default ( void )
- // Current Debian location
+Index: src/vikmapniklayer.c
+--- src/vikmapniklayer.c.orig
++++ src/vikmapniklayer.c
+@@ -234,7 +234,7 @@ static VikLayerParamData plugins_default ( void )
+ else if ( g_file_test ( "/usr/lib/mapnik/2.2/input", G_FILE_TEST_EXISTS ) )
data.s = g_strdup ( "/usr/lib/mapnik/2.2/input" );
else
- data.s = g_strdup ( "" );
@@ -10,7 +11,7 @@ $OpenBSD: patch-src_vikmapniklayer_c,v 1
#endif
return data;
}
-@@ -249,7 +249,7 @@ static VikLayerParamData fonts_default ( void )
+@@ -248,7 +248,7 @@ static VikLayerParamData fonts_default ( void )
#elif defined __APPLE__
data.s = g_strdup ( "/Library/Fonts" );
#else
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/geo/viking/pkg/PLIST,v
retrieving revision 1.12
diff -u -p -r1.12 PLIST
--- pkg/PLIST 29 Jun 2018 22:16:15 -0000 1.12
+++ pkg/PLIST 19 Jul 2019 06:07:20 -0000
@@ -22,6 +22,7 @@ share/locale/jv/
share/locale/jv/LC_MESSAGES/
share/locale/jv/LC_MESSAGES/viking.mo
share/locale/ko/LC_MESSAGES/viking.mo
+share/locale/ku/LC_MESSAGES/viking.mo
share/locale/lt/LC_MESSAGES/viking.mo
share/locale/lv/LC_MESSAGES/viking.mo
share/locale/nb/LC_MESSAGES/viking.mo
@@ -42,5 +43,6 @@ share/viking/external_tools.xml
share/viking/goto_tools.xml
share/viking/latlontz.txt
share/viking/maps.xml
+share/viking/routing.xml
@tag gtk-update-icon-cache %D/share/icons/hicolor
@tag update-desktop-database