ports/156489: [PATCH] fix build of astro/qlandkartegt with astro/gpsd
Christoph Moench-Tegeder
cmt at burggraben.net
Tue Apr 19 07:00:21 UTC 2011
>Number: 156489
>Category: ports
>Synopsis: [PATCH] fix build of astro/qlandkartegt with astro/gpsd
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Apr 19 07:00:19 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Christoph Moench-Tegeder
>Release: FreeBSD 8.2-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD reindeer.exwg.net 8.2-RELEASE FreeBSD 8.2-RELEASE #7: Thu Feb 17 09:12:56 CET 2011 cmt at reindeer.exwg.net:/usr/obj/usr/src/sys/CMT amd64
astro/qlandkartegt qlandkartegt-1.1.1
astro/gpsd gpsd-2.96
>Description:
The libgps API changed (i.e. deprecated functions where finally removed)
in gpsd 2.90 (as of their documentation), which causes the build of
astro/qlandkartegt to fail with:
[ 59%] Building CXX object src/CMakeFiles/qlandkartegt.dir/CDBus.cpp.o
/usr/local/include/gps.h: In member function 'virtual void CGPSDThread::run()':
/usr/local/include/gps.h:1431: error: too few arguments to function 'int gps_open(const char*, const char*, gps_data_t*)'
/usr/ports/astro/qlandkartegt/work/qlandkartegt-1.1.1/src/CDeviceGPSD.cpp:152: error: at this point in file
/usr/ports/astro/qlandkartegt/work/qlandkartegt-1.1.1/src/CDeviceGPSD.cpp:190: error: 'gps_poll' was not declared in this scope
>How-To-Repeat:
Install astro/gpsd, then try to build astro/qlandkartegt.
>Fix:
The following patch fixes the API as described in
http://gpsd.berlios.de/protocol-transition.html . I submitted that patch
to the qlandkartegt-users mailing list last week, but got no response yet
http://sourceforge.net/mailarchive/forum.php?thread_name=20110411185343.GB1916%40elch.exwg.net&forum_name=qlandkartegt-users
diff -Nru astro/qlandkartegt.orig/files/patch-src-CDeviceGPSD.cpp astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp
--- astro/qlandkartegt.orig/files/patch-src-CDeviceGPSD.cpp 1970-01-01 01:00:00.000000000 +0100
+++ astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp 2011-04-19 08:24:35.000000000 +0200
@@ -0,0 +1,47 @@
+Index: src/CDeviceGPSD.cpp
+===================================================================
+--- src/CDeviceGPSD.cpp (revision 2719)
++++ src/CDeviceGPSD.cpp (working copy)
+@@ -138,6 +138,7 @@
+ log_mutex( new QMutex() ),
+ pipe_fd( _pipe_fd )
+ {
++ gpsdata = NULL;
+ }
+
+
+@@ -149,7 +150,14 @@
+
+ void CGPSDThread::run()
+ {
++#if GPSD_API_MAJOR_VERSION >= 5
++ int socket;
++
++ if( gpsdata = new gps_data_t )
++ socket = gps_open( "localhost", DEFAULT_GPSD_PORT, gpsdata );
++#else
+ gpsdata = gps_open( "localhost", DEFAULT_GPSD_PORT );
++#endif
+ if( !gpsdata )
+ {
+ // TODO: message box (from other thread)
+@@ -187,13 +195,20 @@
+ } // if
+ else if( FD_ISSET( gpsdata->gps_fd, &fds ) )
+ {
++#if GPSD_API_MAJOR_VERSION >= 5
++ gps_read( gpsdata );
++#else
+ gps_poll( gpsdata );
++#endif
+ if( !decodeData() ) break;
+ } // else if
+ } // else if
+ } // while
+
+ gps_close( gpsdata );
++#if GPSD_API_MAJOR_VERSION >= 5
++ delete gpsdata;
++#endif
+ qDebug() << "thread done";
+ }
Regards,
Christoph
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list