GeoClue: The Geoinformation Service

geoclue: will fail to build against gpsd 3.3

Reported by Bernd Zeimetz on 2011-11-21
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
GeoClue
Won't Fix
High
geoclue (Ubuntu)
Undecided
Unassigned

Bug Description

As the freedesktop.org upstream is kinda dead, but geoclue seems to be ina bit of development in Ubuntu I'm filing the bug here, too.

gpsd 3.3 (currently in Debian experimental) comes with a new API (v5) and geoclue will fail to build against it. IMHO the whole gpsd provider should be rewritten - parsing NMEA is not really the best way to handle gps data. Enough examples should be shipped with gpsd's source code.

don't hesitate to ask if you have questions :)

log:

geoclue-gpsd.c:43:27: error: ‘gps_data’ redeclared as different kind of symbol
/usr/include/gps.h:1713:35: note: previous declaration of ‘gps_data’ was here
geoclue-gpsd.c: In function ‘geoclue_gpsd_start_gpsd’:
geoclue-gpsd.c:400:2: error: too few arguments to function ‘gps_open’
/usr/include/gps.h:1705:12: note: declared here
geoclue-gpsd.c:402:57: error: ‘POLL_NONBLOCK’ undeclared (first use in this function)
geoclue-gpsd.c:402:57: note: each undeclared identifier is reported only once for each function it appears in
geoclue-gpsd.c:403:3: error: implicit declaration of function ‘gps_set_raw_hook’ [-Werror=implicit-function-declaratio
geoclue-gpsd.c: In function ‘gpsd_poll’:
geoclue-gpsd.c:416:3: error: implicit declaration of function ‘gps_poll’ [-Werror=implicit-function-declaration]
cc1: all warnings being treated as errors

packages:

gcc 4.6.1
gpsd 3.1.1
geoclue-git
Linux 3.0-ARCH i686

other:

I spoke to <email address hidden>/gpsd who suggested the implementation http://lindi.iki.fi/lindi/gpsd/gpsd-test3.c might be better than parsing nmea strings (though there might be a reason to insist on nmea)
... (geoclue-gpsd.c)
gps_stream(self->gpsdata, WATCH_ENABLE | WATCH_NMEA | POLL_NONBLOCK, NULL);
gps_set_raw_hook (self->gpsdata, gpsd_raw_hook);
...
Whatever the case, fixing this is probably more complex than drop-in replacements, so filing here.

Parsing NMEA strings is definitely the wrong way. IMHO the whole gpsd provider needs to be rewritten from scratch.

lindi's implementation is not uptodate for API v5 anymore, too. gps_poll is gone for good.

Bernd Zeimetz (bzed) on 2011-11-21
Changed in geoclue (Ubuntu):
status: New → Confirmed

Created attachment 54418
Transition to use of new libgps API

I hit this bug whilst transitioning packages to the new libgps API.

The attached patch refactors the codebase to support the new API whilst maintaining backwards compatibility.

Changed in geoclue:
importance: Unknown → High
status: Unknown → Confirmed

Looking at the patch I'd think it should work, I'll give it a try later.

But on the long run the whole code should be rewritten to avoid parsing NMEA strings as this is prone to errors. Just take the code as suggested in comment #1

(In reply to comment #3)
> Looking at the patch I'd think it should work, I'll give it a try later.
>
> But on the long run the whole code should be rewritten to avoid parsing NMEA
> strings as this is prone to errors. Just take the code as suggested in comment
> #1

actually not in the comment but in the bug report... http://lindi.iki.fi/lindi/gpsd/gpsd-test3.c

Closing all bugs on old geoclue. If your bug still applies to new geoclue, please do re-open, I really don't have time to go through each and every bug and evaluate separately. :( Apologies for any inconvenience caused by this change.

Changed in geoclue:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.