# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           legacysupport 1.1

# strndup
legacysupport.newest_darwin_requires_legacy 10

name                libextractor
version             1.13
revision            1
checksums           rmd160  dd366ef2c76e8909491f81a69f1561b2431bb4e7 \
                    sha256  bb8f312c51d202572243f113c6b62d8210301ab30cbaee604f9837d878cdf755 \
                    size    8173930

categories          devel
license             GPL-3+
maintainers         {ryandesign @ryandesign} openmaintainer

description         A library for extraction af meta-data.

long_description \
   libextractor is a library used to extract meta-data from files of \
   arbitrary type. It is designed to use helper-libraries to perform the \
   actual extraction, and to be trivially extendable by linking against \
   external extractors for additional file types.

homepage            https://www.gnu.org/software/libextractor/
master_sites        gnu

depends_build       path:bin/pkg-config:pkgconfig

depends_lib         port:bzip2 \
                    port:exiv2 \
                    port:flac \
                    port:gettext \
                    port:giflib \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gtk+-2.0.pc:gtk2 \
                    port:gstreamer1 \
                    port:gstreamer1-gst-plugins-base \
                    path:include/turbojpeg.h:libjpeg-turbo \
                    port:libarchive \
                    port:libgsf \
                    port:libiconv \
                    port:libmagic \
                    port:libmpeg2 \
                    port:libogg \
                    port:libsmf \
                    port:libtool \
                    port:libvorbis \
                    port:tidy \
                    port:tiff \
                    port:zlib

patchfiles          tidy-5.patch

configure.args      --enable-ffmpeg \
                    --enable-glib \
                    --enable-gsf \
                    --with-gstreamer \
                    --with-libiconv-prefix=${prefix} \
                    --with-libintl-prefix=${prefix} \
                    --with-ltdl=${prefix}

# The configure script looks for mp4v2 but the code that uses it never
# gets built because mp4v2 is missing a feature that the code requires.
# https://git.gnunet.org/libextractor.git/commit/?id=af0be8c6b6105ace644afebcb847df61411fbb52
# https://code.google.com/archive/p/mp4v2/issues/138
configure.args-append \
                    ac_cv_header_mp4v2_mp4v2_h=no \
                    ac_cv_lib_mp4v2_MP4ReadProvider=no

livecheck.type      regex
livecheck.url       https://ftp.gnu.org/gnu/${name}/
livecheck.regex     ${name}-(\[0-9.\]+)${extract.suffix}
