# -*- 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            gnuregex
set my_name     regex
version         0.12
revision        2
checksums       md5     6c25ca10e71adeede101e7646e796ebd \
                rmd160  042a77087b8604ab54002c5c1a61d2b2dec64cf4 \
                sha256  f36e2d8d56bf15054a850128fcb2f51807706a92d3bb4b37ceadd731535ce230 \
                size    297790

categories      sysutils
license         GPL-2+
maintainers     nomaintainer

description     GNU regex library

long_description \
    ${description}

homepage        https://www.gnu.org/directory/regex.html
distname        ${my_name}-${version}

master_sites    https://ftp.gnu.org/old-gnu/${my_name}/ \
                ftp://ftp.gnu.org/old-gnu/${my_name}/

build.args      subdirs=test

post-build {
    system -W ${worksrcpath} "MACOSX_DEPLOYMENT_TARGET=${macosx_deployment_target} libtool -lSystem -dynamic -install_name ${prefix}/lib/libgnuregex.dylib -o libgnuregex.dylib regex.o"
}

test.run        yes
test.args       ${build.args}
test.target     check

destroot {
    xinstall -m 0644 ${worksrcpath}/regex.h ${destroot}${prefix}/include/gnuregex.h
    xinstall ${worksrcpath}/libgnuregex.dylib ${destroot}${prefix}/lib
}

# Newer versions of GNU regex are available in the GNU libc tarball
# in the files posix/regex.c and posix/regex.h.
livecheck.type  none
