# -*- 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                ossp-val
version             0.9.4
revision            0
checksums           rmd160  c25be844d57bf3813bca16366e9d309ef0568094 \
                    sha256  8471360ea0cf60ddfd012dcfd0951280a7cef5fa74d93c722cd473cf303ec817 \
                    size    312593

categories          devel
license             BSD
maintainers         nomaintainer

description         flexible name to value mapping library for C variables

long_description    {*}${description}

homepage            http://www.ossp.org/pkg/lib/val/
master_sites        ftp://ftp.ossp.org/pkg/lib/val/ freebsd
distname            val-${version}

patchfiles          implicit.patch

configure.args      --mandir=${prefix}/share/man

test.run            yes
test.target         check

platform darwin arm {
    depends_build-append    port:automake

    post-patch {
        # Use newer config.guess and config.sub to support Apple Silicon.
        set automake_dirs [glob -directory ${prefix}/share automake-*]
        set automake_dir [lindex [lsort -command vercmp $automake_dirs] end]
        copy -force ${automake_dir}/config.guess ${automake_dir}/config.sub \
            ${worksrcpath}
    }
}
