# -*- 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                pkgconfig
version             0.29.2
categories          devel
maintainers         {ryandesign @ryandesign}
license             GPL-2+
installs_libs       no
homepage            http://pkg-config.freedesktop.org/
master_sites        ${homepage}releases/
distname            pkg-config-${version}
platforms           darwin freebsd
use_parallel_build  yes

description         pkg-config, a system for managing library compile and \
                    link flags

long_description    The pkg-config program is used to retrieve information \
                    about installed libraries in the system. It is typically \
                    used to compile and link against one or more libraries.

checksums           rmd160  31e6a17810893d95fd33967c2e433beb2175cd8a \
                    sha256  6fc69c01688c9458a57eb9a1664c9aba372ccda420a02bf4429fe610e7e7d591

depends_lib         port:libiconv

patchfiles          patch-glib-configure.diff

set docdir          ${prefix}/share/doc/${name}

configure.args      --disable-silent-rules \
                    --disable-host-tool \
                    --with-pc-path=${prefix}/lib/pkgconfig:${prefix}/share/pkgconfig \
                    --with-internal-glib \
                    --docdir=${docdir}

configure.env       PKG_CONFIG=false

post-configure {
    system "ed - ${worksrcpath}/glib/config.h < ${filespath}/glib-config.h.ed"
}

test.run            yes
test.target         check

destroot.keepdirs   ${destroot}${prefix}/lib/pkgconfig ${destroot}${prefix}/share/pkgconfig

post-destroot {
    xinstall -m 644 -W ${worksrcpath} \
        AUTHORS \
        COPYING \
        NEWS \
        README \
        ${destroot}${docdir}
}

livecheck.type      regex
livecheck.url       "${homepage}releases/?C=M&O=D"
livecheck.regex     pkg-config-(\[0-9.\]+)\\.tar
