# -*- 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.33
revision            0
checksums           rmd160  66d4644a9f5822c9dc0bf82aa7597c0e5c07cae6 \
                    sha256  c55504e725cf44b6ca67e1cd7504ad36dc98d7a0469a9e8d627fd0fb3848aa1d \
                    size    8607614

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 \
                    port: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      --disable-silent-rules \
                    --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}
