Prepare for gpsd-3.x

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Prepare for gpsd-3.x

Kirill Bychkov
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):

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?



Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
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?
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
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?
>>
>>
>>
>>
>
>
>

viking-1.7.diff (5K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
In reply to this post by Kirill Bychkov
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.

Hi!
foxtrotgps and viking are both updatetd to latest upstream releases
which brings compatibility with gpsd-3.x.
geoclue and qlandkartegt should be the last ports incompatible with
new gpsd API.
Pathces for fixing them are attached.
OKs, objections?

P.S. gpsd patch is also attached for review.

geoclue.diff (3K) Download Attachment
gpsd-3.19.diff (12K) Download Attachment
qlandkartegt.diff (870 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Landry Breuil-5
On Wed, Jul 24, 2019 at 11:48:13PM +0300, 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.
>
> Hi!
> foxtrotgps and viking are both updatetd to latest upstream releases
> which brings compatibility with gpsd-3.x.
> geoclue and qlandkartegt should be the last ports incompatible with
> new gpsd API.
> Pathces for fixing them are attached.
> OKs, objections?
>
> P.S. gpsd patch is also attached for review.

Ugh the scons madness. As for gpsd, i dont really understand the qt=no +
qt_versioned=4, nor the use of the qt4 module. Is qt needed or not ? It
appears in LIB_DEPENDS/WANTLIB because of the module ... but that seems
extra:
gpsd-x11-3.19(misc/gpsd,-x11):
Extra:  QtCore.10

As far as i understand it, if needed it should be possible to build
against qt5 (that's what debian did in
https://github.com/bzed/pkg-gpsd/commit/cbbe97a4181af81761efe6649f20d65454d4a8e4
for 3.17.4) so that should be preferred to qt4..

you removed the COMPILER line, was it on purpose ?
same thing for the no_x11 pseudo flavor, if you remove it maybe some
ports need to be amended.

port-lib-depends-check also complains about
LIB_DEPENDS devel/py-serial not needed for misc/gpsd,-main ?

other than that, it seems gpsd is still able to read/access data from my
usb gps, so that part looks good :)

Thanks for working on it!

Landry

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
On Thu, July 25, 2019 08:50, Landry Breuil wrote:

> On Wed, Jul 24, 2019 at 11:48:13PM +0300, 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.
>>
>> Hi!
>> foxtrotgps and viking are both updatetd to latest upstream releases
>> which brings compatibility with gpsd-3.x.
>> geoclue and qlandkartegt should be the last ports incompatible with
>> new gpsd API.
>> Pathces for fixing them are attached.
>> OKs, objections?
>>
>> P.S. gpsd patch is also attached for review.
>
> Ugh the scons madness. As for gpsd, i dont really understand the qt=no +
> qt_versioned=4, nor the use of the qt4 module. Is qt needed or not ? It
Missed mixing both flags, thanks.

> appears in LIB_DEPENDS/WANTLIB because of the module ... but that seems
> extra:
> gpsd-x11-3.19(misc/gpsd,-x11):
> Extra:  QtCore.10

It is needed for Qt-bindings. We can skip it now and add in future if we
need it.

>
> As far as i understand it, if needed it should be possible to build
> against qt5 (that's what debian did in
> https://github.com/bzed/pkg-gpsd/commit/cbbe97a4181af81761efe6649f20d65454d4a8e4
> for 3.17.4) so that should be preferred to qt4..
>
> you removed the COMPILER line, was it on purpose ?
> same thing for the no_x11 pseudo flavor, if you remove it maybe some
> ports need to be amended.

Ooops. COMPILER line restored. no_x11 flavor not connected to the
build so no influence on other ports. And I see no reason to keep it.

>
> port-lib-depends-check also complains about
> LIB_DEPENDS devel/py-serial not needed for misc/gpsd,-main ?
>
Should go to RUN_DEPENDS.


> other than that, it seems gpsd is still able to read/access data from my
> usb gps, so that part looks good :)
>
> Thanks for working on it!
>
> Landry
>
>
Updated diff attached.

gpsd-3.19.diff (12K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Landry Breuil-5
On Thu, Jul 25, 2019 at 10:59:09AM +0300, Kirill Bychkov wrote:
> On Thu, July 25, 2019 08:50, Landry Breuil wrote:
> > On Wed, Jul 24, 2019 at 11:48:13PM +0300, Kirill Bychkov wrote:
> >> On Thu, June 20, 2019 10:08, Kirill Bychkov wrote:

<snip>

> > other than that, it seems gpsd is still able to read/access data from my
> > usb gps, so that part looks good :)
> >
> > Thanks for working on it!
> >
> > Landry
> >
> >
> Updated diff attached.

This version looks good to me, and i just realized there's the nice
addition of ubxtool (https://www.mankier.com/1/ubxtool) that allows me
to talk low-level to my device via py-serial:

$doas ubxtool -f /dev/ttyp8  -p CFG-GNSS
ubxtool: poll CFG-GNSS
sent:
UBX-CFG-GNSS:
Poll request

UBX-CFG-GNSS:
 msgVer 0  numTrkChHw 32 numTrkChUse 32 numConfigBlocks 5
  gnssId 0 TrkCh  8 maxTrCh 16 reserved 0 Flags x01010001
   GPS L1C/A enabled
  gnssId 1 TrkCh  1 maxTrCh  3 reserved 0 Flags x01010001
   SBAS L1C/A enabled
  gnssId 3 TrkCh  8 maxTrCh 16 reserved 0 Flags x01010000
   BeiDou B1I
  gnssId 5 TrkCh  0 maxTrCh  3 reserved 0 Flags x01010001
   QZSS L1C/A enabled
  gnssId 6 TrkCh  8 maxTrCh 14 reserved 0 Flags x01010001
   GLONASS L1 enabled

UBX-ACK-ACK:
 ACK to Class x6 (CFG) ID x3e (GNSS)

$doas ubxtool -f /dev/ttyp8  -p MON-VER  
ubxtool: poll MON-VER
sent:
UBX-MON-VER:
 Poll request

UBX-MON-VER:
 swVersion 2.01 (75331)
 hwVersion 00080000
 extension PROTVER 15.00
 extension GPS;SBAS;GLO;BDS;QZSS

Landry

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
In reply to this post by Kirill Bychkov
Ping

On Wed, July 24, 2019 23:48, 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.
>
> Hi!
> foxtrotgps and viking are both updatetd to latest upstream releases
> which brings compatibility with gpsd-3.x.
> geoclue and qlandkartegt should be the last ports incompatible with
> new gpsd API.
> Pathces for fixing them are attached.
> OKs, objections?
>
> P.S. gpsd patch is also attached for review.
>

geoclue.diff (3K) Download Attachment
gpsd-3.19.diff (12K) Download Attachment
qlandkartegt.diff (870 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Landry Breuil-5
On Wed, Jul 31, 2019 at 01:03:49PM +0300, Kirill Bychkov wrote:
> Ping

Ok to commit the fixes & the gpsd update, qlandkartegt is dead upstream
anyway and should be superseded by qmapshack.

Landry

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Stuart Henderson
In reply to this post by Kirill Bychkov
On 2019/07/31 13:03, Kirill Bychkov wrote:

> Ping
>
> On Wed, July 24, 2019 23:48, 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.
> >
> > Hi!
> > foxtrotgps and viking are both updatetd to latest upstream releases
> > which brings compatibility with gpsd-3.x.
> > geoclue and qlandkartegt should be the last ports incompatible with
> > new gpsd API.
> > Pathces for fixing them are attached.
> > OKs, objections?
> >
> > P.S. gpsd patch is also attached for review.
> >

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/geo/geoclue/Makefile,v
> retrieving revision 1.29
> diff -u -p -u -p -r1.29 Makefile
> --- Makefile 6 Jul 2018 06:04:42 -0000 1.29
> +++ Makefile 14 Jun 2019 07:11:23 -0000
> @@ -3,7 +3,7 @@
>  COMMENT= modular geoinformation service on top of D-Bus
>  
>  DISTNAME= geoclue-0.12.99
> -REVISION= 7
> +REVISION= 8
>  SHARED_LIBS +=  geoclue              1.1      # .0.0
>  CATEGORIES= geo devel

No objection to your diff, but TBH I would just use --disable-gpsd for
this, this is the ancient version of geoclue that is only used by a few
outdated Qt things and probably not anything that actually wants real
location. The patch to the configure script can also be dropped then.

$ grep -w geo/geoclue INDEX | cut -d'|' -f1
geoclue-0.12.99p8
qtbase-5.9.7p6
qtbase-examples-5.9.7
qt5-global-5.9.7p0
qt5-mysql-5.9.7p0
qt5-postgresql-5.9.7p0
qt5-sqlite2-5.9.7p0
qt5-tds-5.9.7p0
qtwebkit-5.9.0p8

(And geoclue2 doesn't enable gpsd support).

> +TEST_DEPENDS= misc/gpsd,-main \

This would be better with a version spec e.g.

TEST_DEPENDS= ${FULLPKGNAME-main}:${FULLPKGPATH-main}

> Index: pkg/PLIST-php
> ===================================================================
> RCS file: /cvs/ports/misc/gpsd/pkg/PLIST-php,v
> retrieving revision 1.1
> diff -u -p -u -p -r1.1 PLIST-php
> --- pkg/PLIST-php 8 Feb 2007 23:03:38 -0000 1.1
> +++ pkg/PLIST-php 25 Jul 2019 07:56:08 -0000
> @@ -1,3 +1,4 @@
>  @comment $OpenBSD: PLIST-php,v 1.1 2007/02/08 23:03:38 ckuethe Exp $
> +@cwd /var/www
>  gpsd/
>  gpsd/gpsd.php

This shouldn't be needed with PREFIX-php?

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Stuart Henderson
On 2019/07/31 12:52, Stuart Henderson wrote:

> >  
> >  DISTNAME= geoclue-0.12.99
> > -REVISION= 7
> > +REVISION= 8
> >  SHARED_LIBS +=  geoclue              1.1      # .0.0
> >  CATEGORIES= geo devel
>
> No objection to your diff, but TBH I would just use --disable-gpsd for
> this, this is the ancient version of geoclue that is only used by a few
> outdated Qt things and probably not anything that actually wants real
> location. The patch to the configure script can also be dropped then.

Oh BTW, if you do use your diff, please include a link to the origin of
the patch, or https://bugs.freedesktop.org/show_bug.cgi?id=40996 where it's
mentioned (alongside a "Parsing NMEA strings is definitely the wrong
way. IMHO the whole gpsd provider needs to be rewritten from scratch"
comment :)


> $ grep -w geo/geoclue INDEX | cut -d'|' -f1
> geoclue-0.12.99p8
> qtbase-5.9.7p6
> qtbase-examples-5.9.7
> qt5-global-5.9.7p0
> qt5-mysql-5.9.7p0
> qt5-postgresql-5.9.7p0
> qt5-sqlite2-5.9.7p0
> qt5-tds-5.9.7p0
> qtwebkit-5.9.0p8
>
> (And geoclue2 doesn't enable gpsd support).
>
> > +TEST_DEPENDS= misc/gpsd,-main \
>
> This would be better with a version spec e.g.
>
> TEST_DEPENDS= ${FULLPKGNAME-main}:${FULLPKGPATH-main}
>
> > Index: pkg/PLIST-php
> > ===================================================================
> > RCS file: /cvs/ports/misc/gpsd/pkg/PLIST-php,v
> > retrieving revision 1.1
> > diff -u -p -u -p -r1.1 PLIST-php
> > --- pkg/PLIST-php 8 Feb 2007 23:03:38 -0000 1.1
> > +++ pkg/PLIST-php 25 Jul 2019 07:56:08 -0000
> > @@ -1,3 +1,4 @@
> >  @comment $OpenBSD: PLIST-php,v 1.1 2007/02/08 23:03:38 ckuethe Exp $
> > +@cwd /var/www
> >  gpsd/
> >  gpsd/gpsd.php
>
> This shouldn't be needed with PREFIX-php?
>

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
In reply to this post by Stuart Henderson
On Wed, July 31, 2019 14:52, Stuart Henderson wrote:

> On 2019/07/31 13:03, Kirill Bychkov wrote:
>> Ping
>>
>> On Wed, July 24, 2019 23:48, 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.
>> >
>> > Hi!
>> > foxtrotgps and viking are both updatetd to latest upstream releases
>> > which brings compatibility with gpsd-3.x.
>> > geoclue and qlandkartegt should be the last ports incompatible with
>> > new gpsd API.
>> > Pathces for fixing them are attached.
>> > OKs, objections?
>> >
>> > P.S. gpsd patch is also attached for review.
>> >
>
>> Index: Makefile
>> ===================================================================
>> RCS file: /cvs/ports/geo/geoclue/Makefile,v
>> retrieving revision 1.29
>> diff -u -p -u -p -r1.29 Makefile
>> --- Makefile 6 Jul 2018 06:04:42 -0000 1.29
>> +++ Makefile 14 Jun 2019 07:11:23 -0000
>> @@ -3,7 +3,7 @@
>>  COMMENT= modular geoinformation service on top of D-Bus
>>
>>  DISTNAME= geoclue-0.12.99
>> -REVISION= 7
>> +REVISION= 8
>>  SHARED_LIBS +=  geoclue              1.1      # .0.0
>>  CATEGORIES= geo devel
>
> No objection to your diff, but TBH I would just use --disable-gpsd for
> this, this is the ancient version of geoclue that is only used by a few
> outdated Qt things and probably not anything that actually wants real
> location. The patch to the configure script can also be dropped then.

Makes sense to me.

Index: Makefile
===================================================================
RCS file: /cvs/ports/geo/geoclue/Makefile,v
retrieving revision 1.32
diff -u -p -r1.32 Makefile
--- Makefile 12 Jul 2019 20:46:28 -0000 1.32
+++ Makefile 31 Jul 2019 13:54:35 -0000
@@ -13,7 +13,7 @@ HOMEPAGE= http://geoclue.freedesktop.or
 PERMIT_PACKAGE= Yes

 WANTLIB =  c dbus-1 dbus-glib-1 ffi gio-2.0 glib-2.0 gmodule-2.0
-WANTLIB += gobject-2.0 gps iconv intl lzma m pcre pthread soup-2.4
+WANTLIB += gobject-2.0 iconv intl lzma m pcre pthread soup-2.4
 WANTLIB += soup-gnome-2.4 sqlite3 xml2 z
 WANTLIB += idn2 psl unistring

@@ -23,14 +23,14 @@ MODULES= devel/dconf

 BUILD_DEPENDS = textproc/libxslt
 LIB_DEPENDS = devel/libsoup \
- misc/gpsd \
  x11/dbus-glib

 USE_GMAKE= Yes

 CONFIGURE_STYLE= gnu
 CONFIGURE_ARGS= --disable-gtk \
- --disable-connman
+ --disable-connman \
+ --disable-gpsd
 CONFIGURE_ENV=          CPPFLAGS="-I${LOCALBASE}/include" \
                         LDFLAGS="-L${LOCALBASE}/lib"

Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure 21 Sep 2012 13:19:01 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-configure,v 1.3 2012/09/21 13:19:01 jasper Exp $
-
-Link against -pthread
-
---- configure.orig Tue Jul 31 18:59:39 2012
-+++ configure Thu Sep 20 20:06:51 2012
-@@ -13144,7 +13144,7 @@ fi
-
-    if test "x$have_skyhook" = "xyes"; then
-       PROVIDER_SUBDIRS="$PROVIDER_SUBDIRS skyhook"
--      GPSD_LIBS="-lgps"
-+      GPSD_LIBS="-lgps -pthread"
-    else
-       NO_BUILD_PROVIDERS="$NO_BUILD_PROVIDERS skyhook"
-    fi


>
> $ grep -w geo/geoclue INDEX | cut -d'|' -f1
> geoclue-0.12.99p8
> qtbase-5.9.7p6
> qtbase-examples-5.9.7
> qt5-global-5.9.7p0
> qt5-mysql-5.9.7p0
> qt5-postgresql-5.9.7p0
> qt5-sqlite2-5.9.7p0
> qt5-tds-5.9.7p0
> qtwebkit-5.9.0p8
>
> (And geoclue2 doesn't enable gpsd support).
>
>> +TEST_DEPENDS= misc/gpsd,-main \
>
> This would be better with a version spec e.g.
>
> TEST_DEPENDS= ${FULLPKGNAME-main}:${FULLPKGPATH-main}

Changed, thanks!

>
>> Index: pkg/PLIST-php
>> ===================================================================
>> RCS file: /cvs/ports/misc/gpsd/pkg/PLIST-php,v
>> retrieving revision 1.1
>> diff -u -p -u -p -r1.1 PLIST-php
>> --- pkg/PLIST-php 8 Feb 2007 23:03:38 -0000 1.1
>> +++ pkg/PLIST-php 25 Jul 2019 07:56:08 -0000
>> @@ -1,3 +1,4 @@
>>  @comment $OpenBSD: PLIST-php,v 1.1 2007/02/08 23:03:38 ckuethe Exp $
>> +@cwd /var/www
>>  gpsd/
>>  gpsd/gpsd.php
>
> This shouldn't be needed with PREFIX-php?
>

It was added by update-plist. Should I remove in manually?



Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Stuart Henderson
On 2019/07/31 16:55, Kirill Bychkov wrote:

> On Wed, July 31, 2019 14:52, Stuart Henderson wrote:
> > On 2019/07/31 13:03, Kirill Bychkov wrote:
> >> Ping
> >>
> >> On Wed, July 24, 2019 23:48, 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.
> >> >
> >> > Hi!
> >> > foxtrotgps and viking are both updatetd to latest upstream releases
> >> > which brings compatibility with gpsd-3.x.
> >> > geoclue and qlandkartegt should be the last ports incompatible with
> >> > new gpsd API.
> >> > Pathces for fixing them are attached.
> >> > OKs, objections?
> >> >
> >> > P.S. gpsd patch is also attached for review.
> >> >
> >
> >> Index: Makefile
> >> ===================================================================
> >> RCS file: /cvs/ports/geo/geoclue/Makefile,v
> >> retrieving revision 1.29
> >> diff -u -p -u -p -r1.29 Makefile
> >> --- Makefile 6 Jul 2018 06:04:42 -0000 1.29
> >> +++ Makefile 14 Jun 2019 07:11:23 -0000
> >> @@ -3,7 +3,7 @@
> >>  COMMENT= modular geoinformation service on top of D-Bus
> >>
> >>  DISTNAME= geoclue-0.12.99
> >> -REVISION= 7
> >> +REVISION= 8
> >>  SHARED_LIBS +=  geoclue              1.1      # .0.0
> >>  CATEGORIES= geo devel
> >
> > No objection to your diff, but TBH I would just use --disable-gpsd for
> > this, this is the ancient version of geoclue that is only used by a few
> > outdated Qt things and probably not anything that actually wants real
> > location. The patch to the configure script can also be dropped then.
>
> Makes sense to me.
>
> Index: Makefile
> ===================================================================

Thanks, I prefer that. OK.

> > $ grep -w geo/geoclue INDEX | cut -d'|' -f1
> > geoclue-0.12.99p8
> > qtbase-5.9.7p6
> > qtbase-examples-5.9.7
> > qt5-global-5.9.7p0
> > qt5-mysql-5.9.7p0
> > qt5-postgresql-5.9.7p0
> > qt5-sqlite2-5.9.7p0
> > qt5-tds-5.9.7p0
> > qtwebkit-5.9.0p8
> >
> > (And geoclue2 doesn't enable gpsd support).
> >
> >> +TEST_DEPENDS= misc/gpsd,-main \
> >
> > This would be better with a version spec e.g.
> >
> > TEST_DEPENDS= ${FULLPKGNAME-main}:${FULLPKGPATH-main}
>
> Changed, thanks!
>
> >
> >> Index: pkg/PLIST-php
> >> ===================================================================
> >> RCS file: /cvs/ports/misc/gpsd/pkg/PLIST-php,v
> >> retrieving revision 1.1
> >> diff -u -p -u -p -r1.1 PLIST-php
> >> --- pkg/PLIST-php 8 Feb 2007 23:03:38 -0000 1.1
> >> +++ pkg/PLIST-php 25 Jul 2019 07:56:08 -0000
> >> @@ -1,3 +1,4 @@
> >>  @comment $OpenBSD: PLIST-php,v 1.1 2007/02/08 23:03:38 ckuethe Exp $
> >> +@cwd /var/www
> >>  gpsd/
> >>  gpsd/gpsd.php
> >
> > This shouldn't be needed with PREFIX-php?
> >
>
> It was added by update-plist. Should I remove in manually?

Oh, this is because of the trailing / in PREFIX-php, please remove the / and the @cwd line.
Then it's ok with me.

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Stuart Henderson
In reply to this post by Kirill Bychkov
x11/kde4/workspace was broken by the gpsd update,

^                               /pobj/kde-workspace-4.11.21/kde-workspace-4.11.21/plasma/generic/dataengines/geolocation/location_gps.cpp:55:6: error: no matching function for call to 'gps_read'                                                                          if (gps_read(m_gpsdata) != -1) {                                                ^~~~~~~~                                                        /usr/local/include/gps.h:2223:12: note: candidate function not viable: requires 3 arguments, but 1 was provided                                         extern int gps_read(struct gps_data_t *, char *message, int message_len);              ^                                                                1 warning and 1 error generated.
ninja: build stopped: subcommand failed.                                    *

Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Kirill Bychkov
On Fri, August 2, 2019 21:48, Stuart Henderson wrote:

> x11/kde4/workspace was broken by the gpsd update,
>
> ^
> /pobj/kde-workspace-4.11.21/kde-workspace-4.11.21/plasma/generic/dataengines/geolocation/location_gps.cpp:55:6:
> error: no matching function for call to 'gps_read'
>                                              if (gps_read(m_gpsdata) != -1) {
>                                               ^~~~~~~~
>                                /usr/local/include/gps.h:2223:12: note:
> candidate function not viable: requires 3 arguments, but 1 was provided
>                                  extern int gps_read(struct gps_data_t *, char
> *message, int message_len);              ^
>                            1 warning and 1 error generated.
> ninja: build stopped: subcommand failed.                                    *
>
Missed that consumer, sorry.
Trivial fix below. OK?

Index: patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp
===================================================================
RCS file: patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp
diff -N patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp 2
Aug 2019 20:30:26 -0000
@@ -0,0 +1,19 @@
+$OpenBSD$
+
+fix build with newer gpsd API
+upstream commit 81a0fe6db9ac9044c2ec8a246878ec65651cb6dd
+
+Index: plasma/generic/dataengines/geolocation/location_gps.cpp
+--- plasma/generic/dataengines/geolocation/location_gps.cpp.orig
++++ plasma/generic/dataengines/geolocation/location_gps.cpp
+@@ -51,7 +51,9 @@ void Gpsd::run()
+     while (!m_abort) {
+         Plasma::DataEngine::Data d;
+
+-#if GPSD_API_MAJOR_VERSION >= 5
++#if GPSD_API_MAJOR_VERSION >= 7
++ if (gps_read(m_gpsdata, NULL, 0) != -1) {
++#elif GPSD_API_MAJOR_VERSION >= 5
+ if (gps_read(m_gpsdata) != -1) {
+ #else
+         if (gps_poll(m_gpsdata) != -1) {


Reply | Threaded
Open this post in threaded view
|

Re: Prepare for gpsd-3.x

Stuart Henderson-6
On 2019/08/02 23:31, Kirill Bychkov wrote:

> On Fri, August 2, 2019 21:48, Stuart Henderson wrote:
> > x11/kde4/workspace was broken by the gpsd update,
> >
> > ^
> > /pobj/kde-workspace-4.11.21/kde-workspace-4.11.21/plasma/generic/dataengines/geolocation/location_gps.cpp:55:6:
> > error: no matching function for call to 'gps_read'
> >                                              if (gps_read(m_gpsdata) != -1) {
> >                                               ^~~~~~~~
> >                                /usr/local/include/gps.h:2223:12: note:
> > candidate function not viable: requires 3 arguments, but 1 was provided
> >                                  extern int gps_read(struct gps_data_t *, char
> > *message, int message_len);              ^
> >                            1 warning and 1 error generated.
> > ninja: build stopped: subcommand failed.                                    *
> >
> Missed that consumer, sorry.
> Trivial fix below. OK?

Reads OK :)


> Index: patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp
> ===================================================================
> RCS file: patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp
> diff -N patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-plasma_generic_dataengines_geolocation_location_gps_cpp 2
> Aug 2019 20:30:26 -0000
> @@ -0,0 +1,19 @@
> +$OpenBSD$
> +
> +fix build with newer gpsd API
> +upstream commit 81a0fe6db9ac9044c2ec8a246878ec65651cb6dd
> +
> +Index: plasma/generic/dataengines/geolocation/location_gps.cpp
> +--- plasma/generic/dataengines/geolocation/location_gps.cpp.orig
> ++++ plasma/generic/dataengines/geolocation/location_gps.cpp
> +@@ -51,7 +51,9 @@ void Gpsd::run()
> +     while (!m_abort) {
> +         Plasma::DataEngine::Data d;
> +
> +-#if GPSD_API_MAJOR_VERSION >= 5
> ++#if GPSD_API_MAJOR_VERSION >= 7
> ++ if (gps_read(m_gpsdata, NULL, 0) != -1) {
> ++#elif GPSD_API_MAJOR_VERSION >= 5
> + if (gps_read(m_gpsdata) != -1) {
> + #else
> +         if (gps_poll(m_gpsdata) != -1) {
>
>