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

name                libgphoto2
version             2.5.32
revision            0
checksums           rmd160  cc878b93ba708aae417d01aa31a36ff2f6f8b5fc \
                    sha256  02b29ab0bcfceda1c7f81c75ec7cb5e64d329cf4b8fd0fcd5bc5a89ff09561bc \
                    size    8450408

categories          devel
maintainers         {ryandesign @ryandesign} openmaintainer
license             LGPL-2+

description         The gphoto2 digital camera library

long_description    The gphoto2 library can be used by applications to \
                    access various digital camera models.

homepage            http://www.gphoto.org/proj/libgphoto2/
master_sites        sourceforge:project/gphoto/libgphoto/${version}
use_bzip2           yes

depends_build       path:bin/pkg-config:pkgconfig

depends_lib         port:curl \
                    path:bin/dbus-daemon:dbus \
                    port:gettext \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libexif \
                    port:libiconv \
                    port:libusb-compat \
                    port:libxml2 \
                    port:libtool \
                    port:gd2

patchfiles          static_assert.patch

configure.args      --with-drivers=all \
                    --with-libexif=${prefix} \
                    ac_cv_prog_AWK=/usr/bin/awk \
                    ac_cv_path_RSYNC=no

# By default, upstream's configure script adds a number of strict compilation
# options, which can cause build failures with some compiler versions. However,
# said script also allows one to easily disable those, simply by specifying
# CFLAGS to Make.
#
# As noted in 'configure.ac':
#
# >>> If, for some reason, you need to build without all these compiler
# >>> warnings, run the build while setting CFLAGS to an empty string:
# >>>   $ make all check CFLAGS=
#
# In our case, utilize our standard cflags. That prevents use of the default
# warning-related options, along with adding anything necessary for MacPorts.

build.args-append   CFLAGS="${configure.cflags} [get_canonical_archflags cc]"

variant doxygen description {Use doxygen to generate API docs} {
    depends_build-append    path:bin/doxygen:doxygen \
                            path:bin/dot:graphviz
}
if {![variant_isset doxygen]} {
    configure.args-append   ac_cv_path_DOT=no \
                            ac_cv_path_DOXYGEN=no
}

livecheck.regex     /${name}-(\[0-9.\]+)${extract.suffix}
