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

# when updating subsurface, it's probably a good idea to update libdivecomputer, too
github.setup            torvalds subsurface 3.1.1 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
epoch                   1
revision                4
categories              x11
license                 GPL-2
maintainers             nomaintainer

description             Subsurface is an open source dive log program written in C.
long_description        {*}${description}
homepage                http://subsurface.hohndel.org/

# stealth update; remove for next version
dist_subdir             ${name}/${version}_1
checksums               rmd160  f91b6c4df9b27741f3d0d0d902e782ed036ef8a8 \
                        sha256  d97c9ec88c2109b2157a5f65930f148a20855552e7379428df31de603388cef8 \
                        size    1143744

patchfiles              Makefile.patch

depends_build           port:pkgconfig
depends_lib             path:lib/pkgconfig/glib-2.0.pc:glib2 \
                        port:libxml2 \
                        path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                        port:hicolor-icon-theme \
                        port:gconf \
                        port:libdivecomputer \
                        port:gtk-osx-application-gtk2 \
                        port:osm-gps-map-gtk2 \
                        port:libsoup-2.4 \
                        port:py27-pygtk \
                        port:libzip \
                        port:libxslt

# declare universal variant, so get_canonical_archflags works
variant universal       {}

use_configure           no

build.args-append       CC=${configure.cc} \
                        EXTRACFLAGS="${configure.cflags} [get_canonical_archflags]" \
                        LDFLAGS="${configure.ldflags} [get_canonical_archflags]" \
                        mpprefix="${prefix}" \
                        mpappdir="${destroot}${applications_dir}" \
                        prefix="${destroot}${prefix}" \
                        VERSION_STRING=${version}

destroot.args-append    CC=${configure.cc} \
                        EXTRACFLAGS="${configure.cflags} [get_canonical_archflags]" \
                        LDFLAGS="${configure.ldflags} [get_canonical_archflags]" \
                        prefix="${destroot}${prefix}" \
                        mpappdir="${destroot}${applications_dir}"

destroot.target         install-macosx
