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

PortSystem              1.0
PortGroup               github 1.0

# when updating subsurface, it's probably a good idea to update libdivecomputer, too
github.setup            torvalds subsurface 1.2 v
epoch                   1
categories              x11
platforms               darwin
license                 GPL-2
maintainers             cal openmaintainer

description             Subsurface is an open source dive log program written in C.
long_description        ${description}

homepage                http://subsurface.hohndel.org/
checksums               rmd160  f6c3251dc762c6396b18662b680493f94558a503 \
                        sha256  aa0cf4cbbb8ecafd78f17ee224b4dfc52814216fded0c83a9c977e382c21116e

patchfiles              Makefile.patch

depends_build           port:pkgconfig
depends_lib             path:lib/pkgconfig/glib-2.0.pc:glib2 \
                        port:libxml2 \
                        port:gtk2 \
                        port:hicolor-icon-theme \
                        port:gconf \
                        port:libdivecomputer

# 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] -framework CoreFoundation" \
                        mpprefix="${prefix}" \
                        mpappdir="${destroot}${applications_dir}" \
                        prefix="${destroot}${prefix}"

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