Ticket #50288: Portfile-gpsd.diff

File Portfile-gpsd.diff, 9.2 KB (added by fhgwright (Fred Wright), 9 years ago)

Portfile diff relative to 3.14_4

  • Portfile

    old new  
    33
    44PortSystem              1.0
    55
    6 if {[variant_isset qt]} {
    7     PortGroup           qt4 1.0
    8 }
    9 
    106name                    gpsd
    11 version                 3.14
    12 revision                4
     7version                 3.16
    138license                 BSD
    149categories              net
    1510maintainers             ryandesign openmaintainer
    1611platforms               darwin
    1712
     13# The GPSD build procedure does not curently support universal binaries.
     14universal_variant       no
     15
    1816description             GPS service daemon
    1917
    20 long_description        GPSD is a service daemon that handles GPSes and other navigation-related sensors \
    21                         reporting over USB, serial, TCP/IP, or UDP connections and presents reports in \
    22                         a well-documented JSON application.
     18long_description        GPSD is a service daemon that handles GPSes and other \
     19                        navigation-related sensors reporting over USB, serial, \
     20                        TCP/IP, or UDP connections and presents reports in \
     21                        a well-documented JSON format.  The package also \
     22                        includes a number of clients which can be run against \
     23                        a local GPSD or a GPSD on another machine.
    2324
    2425homepage                http://www.catb.org/${name}/
    2526master_sites            savannah
    2627
    27 checksums               rmd160  fe0059e2b3d64af5857f9c150ef2fdd6bc6e115f \
    28                         sha256  504fc812f3c1525a1a48e04bf4d77f9a8066c201448d98089df89d58ef53a8cb
     28checksums               rmd160  f61444826db6175f27cb41535c3d62d2536a35d4 \
     29                        sha256  03579af13a4d3fe0c5b79fa44b5f75c9f3cac6749357f1d99ce5d38c09bc2029
    2930
    30 depends_lib-append      port:ncurses port:python27
    31 depends_build-append    port:scons
     31depends_lib-append      port:ncurses
     32
     33depends_build           port:scons
     34
     35# The Python executables now specify "python2" in the shebang line; hence
     36# the dependency on python2_select.
     37#
     38# GPSD requires Python 2.6 or 2.7, but since the scons port requires 2.7,
     39# we don't bother with a 2.6 variant.
     40#
     41depends_run             port:python2_select port:python27
    3242
    3343patchfiles              patch-SConstruct.diff \
    3444                        patch-driver_rtcm2.c.diff \
    35                         patch-libgps.pc.in.diff \
    36                         patch-libgpsd.pc.in.diff \
    3745                        leopard-IPV6_TCLASS.patch
    3846
    39 use_configure           no
     47post-patch {
     48    # Fix the bad permissions on gpsprof (in the 3.16 tarball)
     49    system "chmod 755 ${worksrcpath}/gpsprof"
     50}
    4051
    41 variant universal {}
     52use_configure           no
    4253
    4354set cxx_stdlibflags {}
    4455if {[string match *clang* ${configure.cxx}]} {
     
    4758
    4859build.cmd               ${prefix}/bin/scons
    4960build.target
    50 build.args              prefix=${prefix} libQgpsmm=no usb=no strip=no
     61build.args              prefix=${prefix} \
     62                        qt=no \
     63                        usb=no \
     64                        strip=no \
     65                        dbus_export=no \
     66                        xgps=no
    5167build.env-append        CC="${configure.cc} [get_canonical_archflags cc]" \
    5268                        CFLAGS="${configure.cflags}" \
    5369                        CXX="${configure.cxx} [get_canonical_archflags cxx] ${cxx_stdlibflags}" \
    5470                        CXXFLAGS="${configure.cxxflags}" \
    55                         LDFLAGS="${configure.ldflags}" \
    56                         PYTHON=${prefix}/bin/python2.7
     71                        LDFLAGS="${configure.ldflags}"
     72
     73# Allow the regression tests to be run via "port test gpsd".
     74#
     75# The speed of the daemon tests is highly dependent on the WRITE_PAD value.
     76# In particular, the "ais-nmea-sample" test (with >85000 lines of test data)
     77# takes over 44 minutes to run with the standard (for OSX) 30ms WRITE_PAD.
     78# Empirically, 200us seems to be adequate on a MacPro, and 500us seems to be
     79# adequate on a PowerBook G4, so we use 1ms here.  If needed, this value can
     80# be overridden with WRITE_PAD=XXX on the command line, but only if WRITE_PAD
     81# is included in extra_env in macports.conf.  In all cases, the WRITE_PAD
     82# value in use is reported by the test framework and is visible with -v.
     83#
     84# Note also that the MacPorts sandbox doesn't allow ptys, so the daemon tests
     85# report "gpsfake: ptys not available, falling back to UDP.", but still work.
     86# This can be worked around by running "scons testregress" directly in
     87# ${worksrcpath}, rather than running it via "port test".
     88#
     89# The test phase duplicates the arguments and environment (except WRITE_PAD)
     90# from the build phase, mainly to avoid gratuitous rebuilds between the phases.
     91#
     92test.run                yes
     93test.target             testregress
     94set test.args           ${build.args}
     95set test.env            ${build.env}
     96if { [info exists ::env(WRITE_PAD)] } {
     97    test.env-append     WRITE_PAD=$::env(WRITE_PAD)
     98} else {
     99    test.env-append     WRITE_PAD=0.001
     100}
    57101
    58102destroot.args           {*}${build.args}
    59103destroot.env-append     {*}${destroot.destdir} {*}${build.env}
    60104
     105pre-test {
     106    if {[catch {exec which -s python2}]} {
     107        ui_error "Running tests requires the python2 command."
     108        ui_error "This can be set up by, e.g.:"
     109        ui_error ""
     110        ui_error "    sudo port select --set python2 python27"
     111        ui_error ""
     112        return -code error "tests not runnable"
     113    }
     114}
     115
    61116post-destroot {
    62     xinstall -m 644 -W ${worksrcpath} libgps.dylib libgpsd.dylib ${destroot}${prefix}/lib
     117    xinstall -m 644 -W ${worksrcpath} libgps.dylib ${destroot}${prefix}/lib
    63118}
    64119
    65 variant qt description {Build Qt bindings} {
    66     build.args-delete       libQgpsmm=no
    67     destroot.args-delete    libQgpsmm=no
     120if {[catch {exec which -s python2}]} {
     121    notes "
     122        #####################################################################
     123        # Running any of the Python utilities requires the python2 command. #
     124        # This can be set up via python2_select, e.g.:                      #
     125        #                                                                   #
     126        #     sudo port select --set python2 python27                       #
     127        #                                                                   #
     128        #####################################################################"
     129}
     130
     131if {${os.platform} == "darwin"} {
     132    # Qt5 isn't officially supported for OSX < 10.8
     133    if {${os.major} < 12} {
     134        set qt_default 4
     135        variant qt conflicts qt5 description {Build Qt4 bindings} {}
     136        variant qt4 conflicts qt5 description {Build Qt4 bindings} {}
     137        variant qt5 conflicts qt qt4 description {Build Qt5 bindings} {}
     138    } else {
     139        set qt_default 5
     140        variant qt conflicts qt4 description {Build Qt5 bindings} {}
     141        variant qt4 conflicts qt qt5 description {Build Qt4 bindings} {}
     142        variant qt5 conflicts qt4 description {Build Qt5 bindings} {}
     143    }
     144} else {
     145    set qt_default 0
     146    variant qt4 conflicts qt5 description {Build Qt4 bindings} {}
     147    variant qt5 conflicts qt4 description {Build Qt5 bindings} {}
     148}
     149
     150if {[variant_isset qt4] || [variant_isset qt] && $qt_default == 4} {
     151    PortGroup               qt4 1.0
     152    # The following lines are a workaround for #50347
     153    build.env-append        PKG_CONFIG_PATH=${qt_pkg_config_dir}
     154    test.env-append         PKG_CONFIG_PATH=${qt_pkg_config_dir}
     155}
     156
     157if {[variant_isset qt5] || [variant_isset qt] && $qt_default == 5} {
     158    PortGroup               qt5 1.0
     159    build.args-append       qt_versioned=5
     160    test.args-append        qt_versioned=5
     161}
     162
     163if {[variant_isset qt] || [variant_isset qt4] || [variant_isset qt5]} {
     164    build.args-delete       qt=no
     165    build.args-append       qt=yes
     166    test.args-delete        qt=no
     167    test.args-append        qt=yes
     168    destroot.args-delete    qt=no
     169    destroot.args-append    qt=yes
    68170}
    69171
    70172variant libusb \
    71173description {Include support for better USB device discovery} {
    72     depends_build-append port:pkgconfig
    73     depends_lib-append   port:libusb
    74     build.args-delete    usb=no
    75     destroot.args-delete usb=no
     174    depends_build-append    port:pkgconfig
     175    depends_lib-append      port:libusb
     176    build.args-delete       usb=no
     177    build.args-append       usb=yes
     178    test.args-delete        usb=no
     179    test.args-append        usb=yes
     180    destroot.args-delete    usb=no
     181    destroot.args-append    usb=yes
    76182}
    77183
    78184variant dbus description {Include support for DBUS} {
    79185    depends_lib-append      port:dbus-glib
    80     build.args-append       dbus=yes dbus_export=yes
    81     destroot.args-append    dbus=yes dbus_export=yes
     186    build.args-delete       dbus_export=no
     187    build.args-append       dbus_export=yes
     188    test.args-delete        dbus_export=no
     189    test.args-append        dbus_export=yes
     190    destroot.args-delete    dbus_export=no
     191    destroot.args-append    dbus_export=yes
     192}
     193
     194variant xgps \
     195description {Include xgps/xgpsspeed X11 clients (dependency-intensive)} {
     196    depends_run-append      port:py-gobject port:py-pygtk
     197    build.args-delete       xgps=no
     198    build.args-append       xgps=yes
     199    test.args-delete        xgps=no
     200    test.args-append        xgps=yes
     201    destroot.args-delete    xgps=no
     202    destroot.args-append    xgps=yes
    82203}
    83204
    84205livecheck.type          regex