aboutsummaryrefslogtreecommitdiff
path: root/astro/viking
diff options
context:
space:
mode:
authorDmitry Marakasov <amdmi3@FreeBSD.org>2011-03-25 20:30:55 +0000
committerDmitry Marakasov <amdmi3@FreeBSD.org>2011-03-25 20:30:55 +0000
commitcb25c93663ce2b1ef7cf43ae5024ef1e564a2637 (patch)
tree8f03c26168d2f117f52656dbc1db8cdd4093db0d /astro/viking
parentb63f41276692b62ab052c6673a8fe0c0ca1d9092 (diff)
downloadports-cb25c93663ce2b1ef7cf43ae5024ef1e564a2637.tar.gz
ports-cb25c93663ce2b1ef7cf43ae5024ef1e564a2637.zip
Notes
Diffstat (limited to 'astro/viking')
-rw-r--r--astro/viking/Makefile3
-rw-r--r--astro/viking/files/patch-configure50
-rw-r--r--astro/viking/files/patch-src-vikgpslayer.c81
3 files changed, 133 insertions, 1 deletions
diff --git a/astro/viking/Makefile b/astro/viking/Makefile
index e0ea82f0e928..f945535f0311 100644
--- a/astro/viking/Makefile
+++ b/astro/viking/Makefile
@@ -7,6 +7,7 @@
PORTNAME= viking
PORTVERSION= 1.1
+PORTREVISION= 1
CATEGORIES= astro
MASTER_SITES= SF
@@ -31,7 +32,7 @@ OPTIONS= GPSD "Enable realtime GPS tracking" off
.include <bsd.port.pre.mk>
.if defined(WITH_GPSD)
-LIB_DEPENDS+= gps.19:${PORTSDIR}/astro/gpsd
+LIB_DEPENDS+= gps.20:${PORTSDIR}/astro/gpsd
.else
CONFIGURE_ARGS+= --disable-realtime-gps-tracking
.endif
diff --git a/astro/viking/files/patch-configure b/astro/viking/files/patch-configure
new file mode 100644
index 000000000000..e94e6601666d
--- /dev/null
+++ b/astro/viking/files/patch-configure
@@ -0,0 +1,50 @@
+--- configure.orig 2011-03-22 22:22:02.000000000 +0300
++++ configure 2011-03-22 22:22:13.000000000 +0300
+@@ -8239,9 +8239,9 @@
+ $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 test "${ac_cv_lib_gps_gps_poll+set}" = set; then :
++ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gps_read in -lgps" >&5
++$as_echo_n "checking for gps_read in -lgps... " >&6; }
++if test "${ac_cv_lib_gps_gps_read+set}" = set; then :
+ $as_echo_n "(cached) " >&6
+ else
+ ac_check_lib_save_LIBS=$LIBS
+@@ -8255,27 +8255,27 @@
+ #ifdef __cplusplus
+ extern "C"
+ #endif
+-char gps_poll ();
++char gps_read ();
+ int
+ main ()
+ {
+-return gps_poll ();
++return gps_read ();
+ ;
+ return 0;
+ }
+ _ACEOF
+ if ac_fn_c_try_link "$LINENO"; then :
+- ac_cv_lib_gps_gps_poll=yes
++ ac_cv_lib_gps_gps_read=yes
+ else
+- ac_cv_lib_gps_gps_poll=no
++ ac_cv_lib_gps_gps_read=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" = x""yes; then :
++{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gps_gps_read" >&5
++$as_echo "$ac_cv_lib_gps_gps_read" >&6; }
++if test "x$ac_cv_lib_gps_gps_read" = x""yes; then :
+ cat >>confdefs.h <<_ACEOF
+ #define HAVE_LIBGPS 1
+ _ACEOF
diff --git a/astro/viking/files/patch-src-vikgpslayer.c b/astro/viking/files/patch-src-vikgpslayer.c
new file mode 100644
index 000000000000..8aafc3f98126
--- /dev/null
+++ b/astro/viking/files/patch-src-vikgpslayer.c
@@ -0,0 +1,81 @@
+--- src/vikgpslayer.c.orig 2011-03-22 22:23:24.000000000 +0300
++++ src/vikgpslayer.c 2011-03-22 22:45:18.000000000 +0300
+@@ -1308,7 +1308,7 @@
+
+ }
+
+-static void gpsd_raw_hook(VglGpsd *vgpsd, gchar *data)
++static void gpsd_raw_hook(VglGpsd *vgpsd)
+ {
+ gboolean update_all = FALSE;
+ VikGpsLayer *vgl = vgpsd->vgl;
+@@ -1376,10 +1376,14 @@
+ static gboolean gpsd_data_available(GIOChannel *source, GIOCondition condition, gpointer data)
+ {
+ VikGpsLayer *vgl = data;
++ int nread;
++
+ if (condition == G_IO_IN) {
+- if (!gps_poll(&vgl->vgpsd->gpsd))
++ if ((nread = gps_read(&vgl->vgpsd->gpsd)) >= 0) {
++ if (nread)
++ gpsd_raw_hook(vgl->vgpsd);
+ return TRUE;
+- else {
++ } else {
+ g_warning("Disconnected from gpsd. Trying to reconnect");
+ rt_gpsd_disconnect(vgl);
+ rt_gpsd_connect(vgl, FALSE);
+@@ -1407,23 +1411,15 @@
+ static gboolean rt_gpsd_try_connect(gpointer *data)
+ {
+ VikGpsLayer *vgl = (VikGpsLayer *)data;
+-#ifndef HAVE_GPS_OPEN_R
+- struct gps_data_t *gpsd = gps_open(vgl->gpsd_host, vgl->gpsd_port);
+
+- if (gpsd == NULL) {
+-#else
+ vgl->vgpsd = g_malloc(sizeof(VglGpsd));
+
+- if (gps_open_r(vgl->gpsd_host, vgl->gpsd_port, /*(struct gps_data_t *)*/vgl->vgpsd) != 0) {
+-#endif
++ if (gps_open(vgl->gpsd_host, vgl->gpsd_port, (struct gps_data_t *)vgl->vgpsd) != 0) {
+ g_warning("Failed to connect to gpsd at %s (port %s). Will retry in %d seconds",
+ vgl->gpsd_host, vgl->gpsd_port, vgl->gpsd_retry_interval);
+ return TRUE; /* keep timer running */
+ }
+
+-#ifndef HAVE_GPS_OPEN_R
+- vgl->vgpsd = realloc(gpsd, sizeof(VglGpsd));
+-#endif
+ vgl->vgpsd->vgl = vgl;
+
+ vgl->realtime_fix.dirty = vgl->last_fix.dirty = FALSE;
+@@ -1439,15 +1435,10 @@
+ vik_trw_layer_add_track(vtl, vgl->realtime_track_name, vgl->realtime_track);
+ }
+
+- gps_set_raw_hook(&vgl->vgpsd->gpsd, gpsd_raw_hook);
+ vgl->realtime_io_channel = g_io_channel_unix_new(vgl->vgpsd->gpsd.gps_fd);
+ vgl->realtime_io_watch_id = g_io_add_watch( vgl->realtime_io_channel,
+ G_IO_IN | G_IO_ERR | G_IO_HUP, gpsd_data_available, vgl);
+-#if HAVE_GPS_STREAM
+ gps_stream(&vgl->vgpsd->gpsd, WATCH_ENABLE, NULL);
+-#else
+- gps_query(&vgl->vgpsd->gpsd, "w+x");
+-#endif
+ return FALSE; /* no longer called by timeout */
+ }
+
+@@ -1501,11 +1492,7 @@
+ }
+ if (vgl->vgpsd) {
+ gps_close(&vgl->vgpsd->gpsd);
+-#ifdef HAVE_GPS_OPEN_R
+ g_free(vgl->vgpsd);
+-#else
+- free(vgl->vgpsd);
+-#endif
+ vgl->vgpsd = NULL;
+ }
+