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

github.setup        gphoto gphoto2 2.5.32 v
revision            0
categories          graphics
maintainers         {ryandesign @ryandesign} openmaintainer
license             LGPL-2.1+

description         Command-line interface to libgphoto2
long_description    ${name} is the command line interface to libgphoto2. \
                    It allows almost everything that libgphoto2 can do.

homepage            http://www.gphoto.org/proj/${name}

use_xz              yes
checksums           rmd160  83258b01868b7a3b0e51c232c9b54e7139e9e9b8 \
                    sha256  be08a449bbed9613bc9db105997c4ba71410d41870496420359a99b37502c406 \
                    size    607452
github.tarball_from releases

installs_libs       no

depends_build       port:gettext \
                    port:bin/pkg-config:pkgconfig

# TODO: libusb-compat seems to be used.
depends_lib         port:gettext-runtime \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libexif \
                    port:libgphoto2 \
                    port:libiconv \
                    port:libusb-compat \
                    port:popt \
                    port:readline

configure.env       POPT_CFLAGS=-I${prefix}/include \
                    "POPT_LIBS=-L${prefix}/lib -lpopt"
configure.args      --with-libiconv-prefix=${prefix} \
                    --without-aalib \
                    --without-cdk \
                    ac_cv_prog_AWK=/usr/bin/awk

if {[string match *gcc-4.* ${configure.compiler}]} {
    patchfiles-append \
                    patch-gcc4.diff
}

destroot.target     install-strip
post-destroot {
    xinstall -m 0755 -d ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} COPYING ChangeLog INSTALL NEWS README \
        TODO ${destroot}${prefix}/share/doc/${name}
}
