package/olsr: backport upstream patch to fix compat with gpsd 3.21
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 31 Jul 2021 21:50:00 +0000 (23:50 +0200)
committerThomas Petazzoni <thomas.petazzoni@bootlin.com>
Sat, 31 Jul 2021 21:50:00 +0000 (23:50 +0200)
Since the update of gpsd to 3.21, olsr was failing to build with:

src/gpsdclient.c: In function 'nmeaInfoFromGpsd':
src/gpsdclient.c:373:14: error: 'struct gps_data_t' has no member named 'status'
  373 |   if (gpsdata->status == STATUS_NO_FIX) {
      |              ^~

This is due to an API change in gpsd. This commit fixes that by
backporting an upstream commit from olsr.

Fixes:

  http://autobuild.buildroot.net/results/d8c5564b24ff5b646cdd786d07b3a45ce5fa01ea/

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
package/olsr/0004-pud-adapt-gpsdclient.c-to-new-gpsd-3.21.patch [new file with mode: 0644]

diff --git a/package/olsr/0004-pud-adapt-gpsdclient.c-to-new-gpsd-3.21.patch b/package/olsr/0004-pud-adapt-gpsdclient.c-to-new-gpsd-3.21.patch
new file mode 100644 (file)
index 0000000..8001343
--- /dev/null
@@ -0,0 +1,35 @@
+From 2f9ee6079b20fb5d3884472825a40c5c65550fa2 Mon Sep 17 00:00:00 2001
+From: Nick Hainke <vincent@systemli.org>
+Date: Sun, 30 May 2021 19:13:48 +0200
+Subject: [PATCH] pud: adapt gpsdclient.c to new gpsd 3.21
+
+As mentioned:
+"Move gps_data_t->status to gps_fix_t.status for better fix merging"
+https://gitlab.com/gpsd/gpsd/-/commit/29991d6ffeb41ecfc8297db68bb68be0128c8514
+
+Signed-off-by: Nick Hainke <vincent@systemli.org>
+Upstream: 79a28cdb4083b66c5d3a5f9c0d70dbdc86c0420c
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
+---
+ lib/pud/src/gpsdclient.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/lib/pud/src/gpsdclient.c b/lib/pud/src/gpsdclient.c
+index 2a7a26ee..a2a9cee0 100644
+--- a/lib/pud/src/gpsdclient.c
++++ b/lib/pud/src/gpsdclient.c
+@@ -370,7 +370,11 @@ void nmeaInfoFromGpsd(struct gps_data_t *gpsdata, NmeaInfo *info, struct GpsdCon
+           );
+   gpsdata->set &= ~STATUS_SET; /* always valid */
++  #if GPSD_API_MAJOR_VERSION >= 10
++  if (gpsdata->fix.status == STATUS_NO_FIX) {
++  #else
+   if (gpsdata->status == STATUS_NO_FIX) {
++  #endif
+     nmeaInfoClear(info);
+     nmeaTimeSet(&info->utc, &info->present, NULL);
+     return;
+-- 
+2.31.1
+