[73748] trunk/dports/net/gpsd

michaelld at macports.org michaelld at macports.org
Tue Nov 23 09:06:19 PST 2010


Revision: 73748
          http://trac.macports.org/changeset/73748
Author:   michaelld at macports.org
Date:     2010-11-23 09:06:13 -0800 (Tue, 23 Nov 2010)
Log Message:
-----------
gpsd changes:

* should fixe ticket #27409; will verify.
* No longer uses X11, so remove those dependencies.
* Requires ncurses and Python -- variants for the latter.
* Add variants for qt, dbus, and libusb -- none default.
* add patches to allow for variants and universal build.
* move include and library search paths to CPATH and LIBRARY_PATH, to
  avoid linking with already-installed files.

Modified Paths:
--------------
    trunk/dports/net/gpsd/Portfile

Added Paths:
-----------
    trunk/dports/net/gpsd/files/
    trunk/dports/net/gpsd/files/patch-Makefile.in.diff

Modified: trunk/dports/net/gpsd/Portfile
===================================================================
--- trunk/dports/net/gpsd/Portfile	2010-11-23 17:03:39 UTC (rev 73747)
+++ trunk/dports/net/gpsd/Portfile	2010-11-23 17:06:13 UTC (rev 73748)
@@ -1,3 +1,4 @@
+# -*- coding: utf-8; mode: tcl; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; truncate-lines: t -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
 # $Id$
 
 PortSystem              1.0
@@ -19,25 +20,96 @@
 checksums               sha1    af1f575c8ec3a2db7a71c35f2296fd339a4a1ff3 \
                         rmd160  c9e8d3b7ff73c655d65f0f6e329ca7ff241b10f6
 
-depends_lib             port:xorg-libXaw \
-                        port:Xft2 \
-                        port:xorg-libXp \
-                        port:libpng \
-                        port:qt4-mac \
-                        lib:libXm:openmotif
+depends_lib-append      port:ncurses
 
-universal_variant       no
+patchfiles              patch-Makefile.in.diff
 
-variant no_x11 {
-    depends_lib-delete  port:xorg-libXaw \
-                        port:Xft2 \
-                        port:xorg-libXp \
-                        lib:libXm:openmotif
-    
-    configure.args-append \
-                        --without-x
+universal_variant       yes
+
+post-patch {
+    # fix up configure for LIBUSB variant
+    if {![variant_isset libusb]} {
+        reinplace "s at pkg_failed=no at pkg_failed=yes at 1" \
+            ${worksrcpath}/configure
+    }
 }
 
+pre-configure {
+    # remove ${prefix}/lib from LDFLAGS, and include it in the
+    # LIBRARY_PATH instead
+    configure.ldflags-delete "-L${prefix}/lib"
+    compiler.library_path ${prefix}/lib
+
+    # remove ${prefix}/include from CPPFLAGS, and include it in the
+    # CPATH instead (the default)
+    configure.cppflags-delete "-I${prefix}/include"
+}
+
+pre-build {
+    # use the corrected LIBRARY_PATH for build
+    compiler.library_path ${prefix}/lib
+}
+
+post-destroot {
+    # fix up Python install egg-info filename
+    set eggdir [exec find ${destroot}${prefix}/lib \
+                    -name "*.egg*" | sed -e "s@/\[^ /\]*\.egg-info@@"]
+    set eggfile [exec find ${eggdir} -name "*.egg*"]
+    move ${eggfile} ${eggdir}/gps.egg-info
+}
+
+variant qt description {Build Qt bindings} {
+    PortGroup qt4 1.0
+}
+
+if {![variant_isset qt]} {
+    configure.args-append --disable-libQgpsmm
+}
+
+variant libusb \
+description {Include support for better USB device discovery} {
+    depends_build-append port:pkgconfig
+    depends_lib-append   port:libusb
+}
+
+variant dbus description {Include support for DBUS} {
+    depends_lib-append    port:dbus-glib
+    configure.args-append --enable-dbus
+}
+
+variant python25 conflicts python26 python27 \
+description "Use Python 2.5" {
+    configure.env      PYTHON=${prefix}/bin/python2.5
+    depends_lib-append port:python25
+}
+
+variant python26 conflicts python25 python27 \
+description "Use Python 2.6" {
+    configure.env      PYTHON=${prefix}/bin/python2.6
+    depends_lib-append port:python26
+}
+
+variant python27 conflicts python25 python26 \
+description "Use Python 2.7" {
+    configure.env      PYTHON=${prefix}/bin/python2.7
+    depends_lib-append port:python27
+}
+
+if { ![variant_isset python25] && \
+     ![variant_isset python26] && \
+     ![variant_isset python27] } {
+    default_variants +python26
+}
+
+# make sure -python26 is not alone
+if { ![variant_isset python25] && \
+     ![variant_isset python26] && \
+     ![variant_isset python27] } {
+    return -code error \
+        "\n\nThe variant -python26 will not work alone.
+Please select one of +python25, +python26, or +python27 as a variant."
+}
+
 livecheck.type          regex
 livecheck.url           [lindex ${master_sites} 0]
 livecheck.regex         ${name}-(\[0-9.\]+)${extract.suffix}

Added: trunk/dports/net/gpsd/files/patch-Makefile.in.diff
===================================================================
--- trunk/dports/net/gpsd/files/patch-Makefile.in.diff	                        (rev 0)
+++ trunk/dports/net/gpsd/files/patch-Makefile.in.diff	2010-11-23 17:06:13 UTC (rev 73748)
@@ -0,0 +1,44 @@
+--- Makefile.in.orig	2010-11-23 11:08:37.000000000 -0500
++++ Makefile.in	2010-11-23 11:09:00.000000000 -0500
+@@ -373,6 +373,11 @@
+ PYTHON_PREFIX = @PYTHON_PREFIX@
+ PYTHON_VERSION = @PYTHON_VERSION@
+ QMAKE = @QMAKE@
++# remove "-arch X" from QMAKE CFLAGS and LFLAGS ...
++QMAKE_CFLAGS = `echo $(CFLAGS) | sed -e "s@[ ]*\-arch[ ]*[^ ]*@@g"`
++QMAKE_LFLAGS = `echo $(LDFLAGS) | sed -e "s@[ ]*\-arch[ ]*[^ ]*@@g"`
++# ... and put it into CONFIG instead
++QMAKE_CONFIG = `echo $(CFLAGS) | sed -e "s@\(\-arch\)[ ]*\([^ ]*\)@\1\2 at g" | tr ' ' '\n' | grep "\-arch" | sed -e "s@\-arch\([^ ]*\)@\1 at g" | sed -e "s at i386@x86 at g" | tr '\n' ' '`
+ QtNetwork_CFLAGS = @QtNetwork_CFLAGS@
+ QtNetwork_LIBS = @QtNetwork_LIBS@
+ RANLIB = @RANLIB@
+@@ -546,7 +551,7 @@
+ libgps_VERSION__REVISION = 0
+ libgps_VERSION_AGE = 0
+ libgps_VERSION_NUMBER = $(libgps_VERSION_AGE):$(libgps_VERSION__REVISION):$(libgps_VERSION_AGE)
+-libgps_la_LDFLAGS = -version-number $(libgps_VERSION_CURRENT):$(libgps_VERSION__REVISION):$(libgps_VERSION_AGE)
++libgps_la_LDFLAGS = $(LDFLAGS) -version-number $(libgps_VERSION_CURRENT):$(libgps_VERSION__REVISION):$(libgps_VERSION_AGE)
+ lib_LTLIBRARIES = libgps.la libgpsd.la
+ libgps_SONAME = $(shell expr $(libgps_VERSION_CURRENT) - $(libgps_VERSION_AGE))
+ libgps_VERSION = $(libgps_SONAME).$(libgps_VERSION_AGE).$(libgps_VERSION__REVISION)
+@@ -658,8 +663,9 @@
+ @LIB_Q_GPSMM_ENABLE_TRUE@	     "MAKE=$(MAKE)" \
+ @LIB_Q_GPSMM_ENABLE_TRUE@	     "QMAKE_CXX=$(CXX)" \
+ @LIB_Q_GPSMM_ENABLE_TRUE@	     "QMAKE_CC=$(CC)" \
+- at LIB_Q_GPSMM_ENABLE_TRUE@	     "QMAKE_CFLAGS+=$(CFLAGS)" \
+- at LIB_Q_GPSMM_ENABLE_TRUE@	     "QMAKE_LFLAGS+=$(LDFLAGS)" \
++ at LIB_Q_GPSMM_ENABLE_TRUE@	     CONFIG+="$(QMAKE_CONFIG)" \
++ at LIB_Q_GPSMM_ENABLE_TRUE@	     QMAKE_CFLAGS+="$(QMAKE_CFLAGS)" \
++ at LIB_Q_GPSMM_ENABLE_TRUE@	     QMAKE_LFLAGS+="$(QMAKE_LFLAGS)" \
+ @LIB_Q_GPSMM_ENABLE_TRUE@	     "VERSION=$(libgps_VERSION)" \
+ @LIB_Q_GPSMM_ENABLE_TRUE@	     "TARGET_LIBDIR=${libdir}" \
+ @LIB_Q_GPSMM_ENABLE_TRUE@	     "TARGET_INCLUDEDIR=${includedir}"
+@@ -2049,6 +2055,8 @@
+ @HAVE_PYTHON_TRUE@	(cd '$(srcdir)' && \
+ @HAVE_PYTHON_TRUE@	env abs_builddir='$(abs_builddir)' \
+ @HAVE_PYTHON_TRUE@	    MAKE='$(MAKE)' \
++ at HAVE_PYTHON_TRUE@	    CFLAGS='$(CFLAGS)' \
++ at HAVE_PYTHON_TRUE@	    LDFLAGS='$(LDFLAGS)' \
+ @HAVE_PYTHON_TRUE@		$(PYTHON) setup.py build \
+ @HAVE_PYTHON_TRUE@			--build-lib '$(srcdir)/$(PYTHON_DISTUTILS_LIBDIR)' \
+ @HAVE_PYTHON_TRUE@			--build-scripts '$(srcdir)/$(PYTHON_DISTUTILS_SCRIPTDIR)' \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101123/292555be/attachment-0001.html>


More information about the macports-changes mailing list