source: trunk/dports/textproc/gpsbabel/Portfile

Last change on this file was 144799, checked in by mcalhoun@…, 20 months ago

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)
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.8 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 144799 2016-01-18 18:24:26Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7github.setup        gpsbabel gpsbabel 1_5_3 gpsbabel_
8# some tricks because version at github is x_y_z
9version             [join [lrange [split ${version} _] 0 2] .]
10revision            1
11
12categories          textproc comms
13license             GPL
14maintainers         nomaintainer
15description         GPSBabel converts/uploads GPS waypoints, tracks, and routes
16long_description    GPSBabel converts GPS waypoints, tracks, and routes \
17                    from one format to another, whether that format is a \
18                    common mapping format like Delorme, Streets and \
19                    Trips, or even a serial upload or download to a GPS \
20                    unit such as those from Garmin and Magellan.
21platforms           darwin
22homepage            http://www.gpsbabel.org/
23
24depends_lib-append  port:expat \
25                    port:libusb-compat
26
27checksums           rmd160  b64e1bbd6906a027d232e097fb182e1ed770aff7 \
28                    sha256  d8606e18a4d27a25739c443f0ced506e992fe0631c8365e3e0109f74224c6e59
29
30patchfiles          patch-delbin.cc.diff
31
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
42    }
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    }
51}
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 TracBrowser for help on using the repository browser.