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

github.setup         dfandrich gpscorrelate 2.3
revision             0
github.tarball_from  archive
categories           gis graphics
license              GPL-2
maintainers          {@sikmir gmail.com:sikmir} openmaintainer
description          GPS Photo Correlation
long_description     Writes location data to EXIF tags using GPX files.
homepage             https://dfandrich.github.io/gpscorrelate/

checksums            rmd160  d2bd5c1db9477bac2ccd984d696ae4295b0d1db0 \
                     sha256  5bea121473ee320ac326fcd817c2666bb0d2b68ec9cff18651b51ab506dd513c \
                     size    412993

depends_build-append port:pkgconfig

depends_lib-append   port:exiv2 \
                     port:gettext \
                     path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                     port:libxml2

require_active_variants gtk3 x11

compiler.cxx_standard   2011

use_configure          no

build.args-append      prefix=${prefix} \
                       CFLAGS="-Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1" \
                       CXXFLAGS="-Wall -Wextra -Werror -Wno-error=deprecated-declarations -O3 -DENABLE_NLS=1 -std=c++11" \
                       LDFLAGS="-O3 -lintl"

patchfiles             man.patch
compiler.cxx_standard  2011

destroot.args-append   prefix=${prefix}
destroot.target-append install-po

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0444 {*}[glob ${worksrcpath}/doc/*.html] \
    ${destroot}${docdir}
    xinstall -m 0444 {*}[glob ${worksrcpath}/doc/*.png] \
    ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} README.md gpscorrelate-gui.svg \
    ${destroot}${docdir}
}
