# -*- 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
# $Id$

PortSystem          1.0

name                pcre
version             8.39
subport pcre2 {
    version         10.22
}
categories          devel
license             BSD
platforms           darwin freebsd
maintainers         larryv

description         Perl Compatible Regular Expressions
long_description    The PCRE library is a set of functions that \
                    implement regular expression pattern matching \
                    using the same syntax and semantics as Perl 5. \
                    PCRE has its own native API, as well as a set of \
                    wrapper functions that correspond to the POSIX \
                    regular expression API.
homepage            http://www.pcre.org

depends_lib         port:bzip2 \
                    port:libedit \
                    port:zlib

master_sites        sourceforge:project/pcre/${subport}/${version} \
                    ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre \
                    ftp://ftp.fu-berlin.de/unix/misc/pcre \
                    ftp://ftp.tin.org/pub/libs/pcre
distname            ${subport}-${version}
use_bzip2           yes

set rmd160(pcre)    bd3353494b85f184ebe3ba0de55584c3b9e74658
set sha256(pcre)    b858099f82483031ee02092711689e7245586ada49e534a06e678b8ea9549e8b
set rmd160(pcre2)   df5b3c6b431fff1a0a933a4ebeb07f209afc0d76
set sha256(pcre2)   b2b44619f4ac6c50ad74c2865fd56807571392496fae1c9ad7a70993d018f416
checksums           rmd160  $rmd160(${subport}) \
                    sha256  $sha256(${subport})

patchfiles          no-darwin-pthread-flag.patch

configure.args      --disable-silent-rules \
                    --docdir=${prefix}/share/doc/${subport} \
                    --enable-jit \
                    --enable-[regsub {\d$} ${subport} &-]16 \
                    --enable-[regsub {\d$} ${subport} &-]32 \
                    --enable-${subport}grep-libbz2 \
                    --enable-${subport}grep-libz \
                    --enable-${subport}test-libedit
subport pcre {
    configure.args-append --enable-unicode-properties
}

platform darwin 8 {
    # ticket #18448
    if {[variant_isset universal]} {
        configure.ldflags-append -lncurses
    }
}

test.run            yes
test.target         check

livecheck.distname  ${subport}