Changeset 144799


Ignore:
Timestamp:
Jan 18, 2016, 6:24:26 PM (4 years ago)
Author:
mcalhoun@…
Message:

gpsbabel:

  • remove dependency on zlib (not used as of r136417); system zlib does not seem to work
  • return to configure instead of qmake (r136415) since it fits better with variants
  • let user choose between Qt4 and Qt5 (see #50331)
  • create variant to install GUI app (see #50321)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/textproc/gpsbabel/Portfile

    r144635 r144799  
    44PortSystem          1.0
    55PortGroup           github 1.0
    6 PortGroup           qmake5 1.0
    76
    87github.setup        gpsbabel gpsbabel 1_5_3 gpsbabel_
    98# some tricks because version at github is x_y_z
    109version             [join [lrange [split ${version} _] 0 2] .]
     10revision            1
    1111
    1212categories          textproc comms
     
    2323
    2424depends_lib-append  port:expat \
    25                     port:libusb-compat \
    26                     port:zlib
     25                    port:libusb-compat
    2726
    2827checksums           rmd160  b64e1bbd6906a027d232e097fb182e1ed770aff7 \
     
    3130patchfiles          patch-delbin.cc.diff
    3231
    33 destroot {
    34     if {[variant_isset universal]} {
    35         system -W ${worksrcpath} "lipo -create ${worksrcpath}-x86_64/GPSbabel ${worksrcpath}-i386/GPSbabel -output ${worksrcpath}/gpsbabel"
     32configure.universal_args-delete \
     33    --disable-dependency-tracking
     34
     35variant qt4 description {build with Qt 4} conflicts qt5 {}
     36
     37variant qt5 description {build with Qt 5} conflicts qt4 {}
     38
     39variant gui description {build GUI App} {
     40    if { [variant_isset qt5] } {
     41        depends_lib-append  port:qt5-qtwebkit
    3642    }
    37     xinstall -m 755 ${worksrcpath}/gpsbabel ${destroot}${prefix}/bin
    38     xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    39     xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING README.contrib README.igc \
    40         README.mapconverter README.xmapwpt ${destroot}${prefix}/share/doc/${name}
     43
     44    build.target-append  mac-gui
     45
     46    post-destroot {
     47        # do not keep two copies of gpsbabel
     48        delete ${destroot}${applications_dir}/GPSBabelFE.app/Contents/MacOS/gpsbabel
     49        ln -s ${prefix}/bin/gpsbabel ${destroot}${applications_dir}/GPSBabelFE.app/Contents/MacOS/gpsbabel
     50    }
    4151}
     52
     53set just_want_qt5_version_info yes
     54PortGroup           qt5 1.0
     55unset just_want_qt5_version_info
     56
     57if {![variant_isset qt4] && ![variant_isset qt5]} {
     58    if { ${os.major} < ${qt5_min_tested_version} } {
     59        default_variants-append +qt4
     60    } else {
     61        default_variants-append +qt5
     62    }
     63}
     64
     65if { [variant_isset qt4] } {
     66    PortGroup           qt4 1.0
     67
     68    # in ${prefix}/libexec/qt4/include/QtCore/qxmlstream.h,
     69    # there seems to be some class renaming using preprocessor commands
     70    #    but only if Q_OS_MAC32 is defined
     71    # this seems to break gpsbabel
     72    supported_archs     ppc64 x86_64
     73
     74} elseif { [variant_isset qt5] } {
     75    PortGroup           qt5 1.0
     76} else {
     77    ui_error "\n\nYou must select either the +qt4 or +qt5 variant.\n"
     78    return -code error "Invalid variant selection"
     79}
     80configure.env-append \
     81    QMAKE=${qt_qmake_cmd} \
     82    LRELEASE=${qt_lrelease_cmd} \
     83    LUPDATE=${qt_lupdate_cmd}
     84
     85if { ![variant_isset universal] || [variant_isset qt4]} {
     86    post-destroot {
     87        if { [variant_isset gui] } {
     88            copy ${worksrcpath}/gui/objects/GPSBabelFE.app ${destroot}${applications_dir}
     89        }
     90        xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
     91        xinstall -m 644 -W ${worksrcpath} \
     92            AUTHORS COPYING README.contrib README.igc \
     93            README.mapconverter README.xmapwpt \
     94            ${destroot}${prefix}/share/doc/${name}
     95    }
     96} else {
     97    merger-post-destroot {
     98        foreach arch ${universal_archs_to_use} {
     99            if { [variant_isset gui] } {
     100                copy ${worksrcpath}-${arch}/gui/objects/GPSBabelFE.app ${destroot}-${arch}${applications_dir}
     101            }
     102            xinstall -m 755 -d ${destroot}-${arch}${prefix}/share/doc/${name}
     103            xinstall -m 644 -W ${worksrcpath}-${arch} \
     104                AUTHORS COPYING README.contrib README.igc \
     105                README.mapconverter README.xmapwpt \
     106                ${destroot}-${arch}${prefix}/share/doc/${name}
     107        }
     108    }
     109}
Note: See TracChangeset for help on using the changeset viewer.