Bug 156489 - [PATCH] fix build of astro/qlandkartegt with astro/gpsd
Summary: [PATCH] fix build of astro/qlandkartegt with astro/gpsd
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-19 08:00 UTC by Christoph Moench-Tegeder
Modified: 2011-05-14 16:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Moench-Tegeder freebsd_committer 2011-04-19 08:00:19 UTC
  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

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



Regards,
Christoph--NHytDM6ULKcgbk58XmZE9AgGbBDZIPwS6e4jTHOkNG1V2Dn9
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

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";
+ }
How-To-Repeat:   Install astro/gpsd, then try to build astro/qlandkartegt.
Comment 1 Edwin Groothuis freebsd_committer 2011-04-19 08:00:29 UTC
Maintainer of astro/qlandkartegt,

Please note that PR ports/156489 has just been submitted.

If it contains a patch for an upgrade, an enhancement or a bug fix
you agree on, reply to this email stating that you approve the patch
and a committer will take care of it.

The full text of the PR can be found at:
    http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/156489

-- 
Edwin Groothuis via the GNATS Auto Assign Tool
edwin@FreeBSD.org
Comment 2 Edwin Groothuis freebsd_committer 2011-04-19 08:00:32 UTC
State Changed
From-To: open->feedback

Awaiting maintainers feedback (via the GNATS Auto Assign Tool)
Comment 3 Tilman Keskinoz freebsd_committer 2011-05-14 16:09:51 UTC
State Changed
From-To: feedback->closed

Committed, thanks!
Comment 4 dfilter service freebsd_committer 2011-05-14 16:09:53 UTC
arved       2011-05-14 15:09:40 UTC

  FreeBSD ports repository

  Added files:
    astro/qlandkartegt/files patch-src-CDeviceGPSD.cpp 
  Log:
  Fix build after libgps API change
  
  PR:             156489
  Submitted by:   Christoph Moench-Tegeder <cmt@burggraben.net>
  Approved by:    maintainer timeout
  
  Revision  Changes    Path
  1.1       +47 -0     ports/astro/qlandkartegt/files/patch-src-CDeviceGPSD.cpp (new)
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"