# -*- 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

PortSystem       1.0
PortGroup        cmake 1.0
PortGroup        github 1.0
PortGroup        qt4 1.0

name             qlandkartegt
categories       gis
maintainers      {fossekall.de:michael.klein @mklein-de}
license          GPL-3
github.setup     mklein-de ${name} 1.8.1-macports-20200922
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision         12

description      Use your Garmin GPS with Linux/Mac OS X
long_description QLandkarte GT is the ultimate outdoor aficionado's tool. It \
                 supports GPS maps in GeoTiff format as well as Garmin's img \
                 vector map format.  Additional it is the PC side front end to \
                 QLandkarte M, a moving map application for mobile devices.

homepage         http://www.qlandkarte.org/

checksums        rmd160  2c03d6540ae657e12c74732dfcf64f5fd8121378 \
                 sha256  6a102e714d1f1d7976296061901ecdce434b3896b757f7b93d1842d04388ea35 \
                 size    6678540

depends_lib      port:gdal \
                 port:gpsd \
                 port:libdmtx \
                 port:libexif \
                 port:qt4-mac \
                 port:qt4-mac-sqlite3-plugin \
                 bin:gpsbabel:gpsbabel

cmake.out_of_source yes

destroot {
    copy "${destroot.dir}/bin/QLandkarte GT.app" ${destroot}${applications_dir}
}

variant proj4 conflicts proj5 proj6 proj7 description {Use proj 4} {
    configure.pkg_config_path-append ${prefix}/lib/proj49/lib/pkgconfig
    depends_lib-append port:proj4
}

variant proj5 conflicts proj4 proj6 proj7 description {Use proj 5} {
    configure.pkg_config_path-append ${prefix}/lib/proj5/lib/pkgconfig
    depends_lib-append port:proj5
}

variant proj6 conflicts proj4 proj5 proj7 description {Use proj 6} {
    configure.pkg_config_path-append ${prefix}/lib/proj6/lib/pkgconfig
    depends_lib-append port:proj6
}

variant proj7 conflicts proj4 proj5 proj6 description {Use proj 7} {
    configure.pkg_config_path-append ${prefix}/lib/proj7/lib/pkgconfig
    depends_lib-append port:proj7
}

if {![variant_isset proj4] && ![variant_isset proj5] &&
    ![variant_isset proj6] && ![variant_isset proj7]} {
        default_variants +proj7
}
