[viking] 1.2.1 + gpsd 2.96+ fixes. Please note that I also committed viking-1.2.1-gpsd-2.96.patch.upstream, t

Tom Callaway spot at fedoraproject.org
Tue Aug 23 16:57:49 UTC 2011


commit 67902c5ca6d3e4565096cefb376a5196d2bd09e8
Author: Tom "spot" Callaway <tcallawa at redhat.com>
Date:   Tue Aug 23 12:57:37 2011 -0400

    1.2.1 + gpsd 2.96+ fixes. Please note that I also committed viking-1.2.1-gpsd-2.96.patch.upstream, this is the patch you should send upstream since it fixes configure.ac.

 .gitignore                            |    1 +
 sources                               |    2 +-
 viking-1.2.1-gpsd-2.96.patch          |  101 +++++++++++++++++++++++++++++++++
 viking-1.2.1-gpsd-2.96.patch.upstream |   62 ++++++++++++++++++++
 viking.spec                           |   15 ++---
 5 files changed, 172 insertions(+), 9 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 92110b6..10a1fdc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@ viking-0.9.94.tar.gz
 /viking-1.0.1.tar.gz
 /viking-1.1.tar.gz
 /viking-1.2.tar.gz
+/viking-1.2.1.tar.gz
diff --git a/sources b/sources
index 3592633..1fdff7f 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-6fd1d9abecb7ebbb28810241d326b534  viking-1.2.tar.gz
+bb6c14608a55e9d9dadf31e0ed4c7d1b  viking-1.2.1.tar.gz
diff --git a/viking-1.2.1-gpsd-2.96.patch b/viking-1.2.1-gpsd-2.96.patch
new file mode 100644
index 0000000..34b3cc8
--- /dev/null
+++ b/viking-1.2.1-gpsd-2.96.patch
@@ -0,0 +1,101 @@
+diff -up viking-1.2.1/configure.BAD viking-1.2.1/configure
+--- viking-1.2.1/configure.BAD	2011-08-23 12:32:31.413471035 -0400
++++ viking-1.2.1/configure	2011-08-23 12:48:35.928944879 -0400
+@@ -8452,9 +8452,9 @@ fi
+ $as_echo "$ac_cv_enable_realtimegpstracking" >&6; }
+ case $ac_cv_enable_realtimegpstracking in
+   yes)
+-    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gps_poll in -lgps" >&5
+-$as_echo_n "checking for gps_poll in -lgps... " >&6; }
+-if ${ac_cv_lib_gps_gps_poll+:} false; then :
++    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gps_open in -lgps" >&5
++$as_echo_n "checking for gps_open in -lgps... " >&6; }
++if ${ac_cv_lib_gps_gps_open+:} false; then :
+   $as_echo_n "(cached) " >&6
+ else
+   ac_check_lib_save_LIBS=$LIBS
+@@ -8468,27 +8468,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char gps_poll ();
++char gps_open ();
+ int
+ main ()
+ {
+-return gps_poll ();
++return gps_open ();
+   ;
+   return 0;
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+-  ac_cv_lib_gps_gps_poll=yes
++  ac_cv_lib_gps_gps_open=yes
+ else
+-  ac_cv_lib_gps_gps_poll=no
++  ac_cv_lib_gps_gps_open=no
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gps_gps_poll" >&5
+-$as_echo "$ac_cv_lib_gps_gps_poll" >&6; }
+-if test "x$ac_cv_lib_gps_gps_poll" = xyes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gps_gps_open" >&5
++$as_echo "$ac_cv_lib_gps_gps_open" >&6; }
++if test "x$ac_cv_lib_gps_gps_open" = xyes; then :
+   cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBGPS 1
+ _ACEOF
+diff -up viking-1.2.1/src/vikgpslayer.c.BAD viking-1.2.1/src/vikgpslayer.c
+--- viking-1.2.1/src/vikgpslayer.c.BAD	2011-08-23 12:39:01.690912636 -0400
++++ viking-1.2.1/src/vikgpslayer.c	2011-08-23 12:45:42.365628103 -0400
+@@ -1211,6 +1211,29 @@ static void gps_empty_all_cb( gpointer l
+ #ifdef VIK_CONFIG_REALTIME_GPS_TRACKING
+ static void rt_gpsd_disconnect(VikGpsLayer *vgl);
+ static gboolean rt_gpsd_connect(VikGpsLayer *vgl, gboolean ask_if_failed);
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++static struct gps_data_t gpsdata_buf;
++static gpointer gpsdata_hook = NULL;
++
++int gps_poll(/*@out@*/struct gps_data_t *gpsdata)
++/* for backwards compatibility */
++{
++  int status = gps_read(gpsdata);
++  if ( status > 0 )
++       status = 0;
++  if ( ( gpsdata_hook != NULL ) && ( gpsdata->set & PACKET_SET ) )
++       ((void (*)())gpsdata_hook)(gpsdata, NULL, 0);
++  return status;
++}
++
++static void gps_set_raw_hook(struct gps_data_t *g, gpointer cb)
++{
++  // gps_set_raw_hook() was removed from gpsd-2.96 Instead, clients will simply be
++  // able to look at the packet buffer directly. (Of course, this is only
++  // recommended when the PACKET_SET flag is up.) (Done in 2.96~dev.)
++  gpsdata_hook = cb;
++}
++#endif
+ 
+ static void realtime_tracking_draw(VikGpsLayer *vgl, VikViewport *vp)
+ {
+@@ -1434,7 +1457,16 @@ static gboolean rt_gpsd_try_connect(gpoi
+ {
+   VikGpsLayer *vgl = (VikGpsLayer *)data;
+ #ifndef HAVE_GPS_OPEN_R
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++  struct gps_data_t *gpsd;
++  if (!gps_open (vgl->gpsd_host, vgl->gpsd_port, &gpsdata_buf)) {
++    gpsd = &gpsdata_buf;
++  } else {
++    gpsd = NULL;
++  }
++#else
+   struct gps_data_t *gpsd = gps_open(vgl->gpsd_host, vgl->gpsd_port);
++#endif
+ 
+   if (gpsd == NULL) {
+ #else
diff --git a/viking-1.2.1-gpsd-2.96.patch.upstream b/viking-1.2.1-gpsd-2.96.patch.upstream
new file mode 100644
index 0000000..3668898
--- /dev/null
+++ b/viking-1.2.1-gpsd-2.96.patch.upstream
@@ -0,0 +1,62 @@
+diff -up viking-1.2.1/configure.ac.BAD viking-1.2.1/configure.ac
+--- viking-1.2.1/configure.ac.BAD	2011-08-23 12:30:19.522496209 -0400
++++ viking-1.2.1/configure.ac	2011-08-23 12:47:36.502852125 -0400
+@@ -258,7 +258,7 @@ AC_CACHE_CHECK([whether to enable Realti
+                [ac_cv_enable_realtimegpstracking], [ac_cv_enable_realtimegpstracking=yes])
+ case $ac_cv_enable_realtimegpstracking in
+   yes)
+-    AC_CHECK_LIB(gps,gps_poll,,AC_MSG_ERROR([libgps is needed for Realtime GPS Tracking feature[,] but not found. The feature can be disable with --disable-realtime-gps-tracking]))
++    AC_CHECK_LIB(gps,gps_open,,AC_MSG_ERROR([libgps is needed for Realtime GPS Tracking feature[,] but not found. The feature can be disable with --disable-realtime-gps-tracking]))
+     AC_DEFINE(VIK_CONFIG_REALTIME_GPS_TRACKING, [], [REALTIME GPS TRACKING STUFF])
+     ;;
+ esac
+diff -up viking-1.2.1/src/vikgpslayer.c.BAD viking-1.2.1/src/vikgpslayer.c
+--- viking-1.2.1/src/vikgpslayer.c.BAD	2011-08-23 12:39:01.690912636 -0400
++++ viking-1.2.1/src/vikgpslayer.c	2011-08-23 12:45:42.365628103 -0400
+@@ -1211,6 +1211,29 @@ static void gps_empty_all_cb( gpointer l
+ #ifdef VIK_CONFIG_REALTIME_GPS_TRACKING
+ static void rt_gpsd_disconnect(VikGpsLayer *vgl);
+ static gboolean rt_gpsd_connect(VikGpsLayer *vgl, gboolean ask_if_failed);
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++static struct gps_data_t gpsdata_buf;
++static gpointer gpsdata_hook = NULL;
++
++int gps_poll(/*@out@*/struct gps_data_t *gpsdata)
++/* for backwards compatibility */
++{
++  int status = gps_read(gpsdata);
++  if ( status > 0 )
++       status = 0;
++  if ( ( gpsdata_hook != NULL ) && ( gpsdata->set & PACKET_SET ) )
++       ((void (*)())gpsdata_hook)(gpsdata, NULL, 0);
++  return status;
++}
++
++static void gps_set_raw_hook(struct gps_data_t *g, gpointer cb)
++{
++  // gps_set_raw_hook() was removed from gpsd-2.96 Instead, clients will simply be
++  // able to look at the packet buffer directly. (Of course, this is only
++  // recommended when the PACKET_SET flag is up.) (Done in 2.96~dev.)
++  gpsdata_hook = cb;
++}
++#endif
+ 
+ static void realtime_tracking_draw(VikGpsLayer *vgl, VikViewport *vp)
+ {
+@@ -1434,7 +1457,16 @@ static gboolean rt_gpsd_try_connect(gpoi
+ {
+   VikGpsLayer *vgl = (VikGpsLayer *)data;
+ #ifndef HAVE_GPS_OPEN_R
++#if defined( GPSD_API_MAJOR_VERSION ) && ( GPSD_API_MAJOR_VERSION >= 5 )
++  struct gps_data_t *gpsd;
++  if (!gps_open (vgl->gpsd_host, vgl->gpsd_port, &gpsdata_buf)) {
++    gpsd = &gpsdata_buf;
++  } else {
++    gpsd = NULL;
++  }
++#else
+   struct gps_data_t *gpsd = gps_open(vgl->gpsd_host, vgl->gpsd_port);
++#endif
+ 
+   if (gpsd == NULL) {
+ #else
diff --git a/viking.spec b/viking.spec
index 144512f..deef96b 100644
--- a/viking.spec
+++ b/viking.spec
@@ -1,5 +1,5 @@
 Name:           viking
-Version:        1.2
+Version:        1.2.1
 Release:        1%{?dist}
 Summary:        GPS data editor and analyzer
 
@@ -7,7 +7,7 @@ Group:          Applications/Productivity
 License:        GPLv2+
 URL:            http://viking.sourceforge.net/
 Source0:        http://downloads.sourceforge.net/viking/viking-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+Patch0:         viking-1.2.1-gpsd-2.96.patch
 
 BuildRequires:  intltool
 BuildRequires:  expat-devel
@@ -32,6 +32,7 @@ waypoints, see real-time GPS position, etc.
 
 %prep
 %setup -q
+%patch0 -p1 -b .gpsd296
 #%patch1 -p0 -b .linking
 # Convert to utf-8
 for file in ChangeLog NEWS TODO; do
@@ -47,7 +48,6 @@ make %{?_smp_mflags}
 
 
 %install
-rm -rf %{buildroot}
 make install DESTDIR=%{buildroot} INSTALL="install -p"
 find %{buildroot} -name '*.a' -exec rm -f {} ';'
 desktop-file-install                                        \
@@ -61,10 +61,6 @@ desktop-file-install                                        \
 make test
 
 
-%clean
-rm -rf %{buildroot}
-
-
 %post
 touch --no-create %{_datadir}/icons/hicolor
 if [ -x %{_bindir}/gtk-update-icon-cache ] ; then
@@ -80,7 +76,6 @@ fi
 
 
 %files -f %{name}.lang
-%defattr(-,root,root,-)
 %doc AUTHORS ChangeLog* COPYING NEWS README TODO
 %doc doc/G* doc/*.xml doc/dev/C* doc/dev/F* doc/dev/Merge* doc/dev/T*
 %{_bindir}/%{name}*
@@ -91,6 +86,10 @@ fi
 
 
 %changelog
+* Tue Aug 23 2011 Tom Callaway <spot at fedoraproject.org> - 1.2.1-1
+- update to 1.2.1
+- enable gpsd 2.96+ support
+
 * Fri Jun 03 2011 Fabian Affolter <fabian at bernewireless.net> - 1.2-1
 - Updated to new upstream version 1.2
 


More information about the scm-commits mailing list