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

name                pcre
if {${subport} eq ${name}} {
    version         8.45
    revision        0
}
subport pcre2 {
    PortGroup       github 1.0

    github.setup    PCRE2Project pcre2 10.40 pcre2-
    github.tarball_from releases
    revision        0

    patchfiles-append no-OSCacheControl-on-tiger.diff
}
categories          devel
license             BSD
platforms           darwin freebsd
maintainers         {larryv @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            https://www.pcre.org

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

master_sites-append 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)    9792fbed380a39be36674e74839b9a2a6a4ce65a
set sha256(pcre)    4dae6fdcd2bb0bb6c37b5f97c33c2be954da743985369cddac3546e3218bffb8
set size(pcre)      1578809
set rmd160(pcre2)   9728e170b4da3ed594e18934b403e97fe4b72291
set sha256(pcre2)   14e4b83c4783933dc17e964318e6324f7cae1bc75d8f3c79bc6969f00c159d68
set size(pcre2)     1765440
checksums           rmd160  $rmd160(${subport}) \
                    sha256  $sha256(${subport}) \
                    size    $size(${subport})

patchfiles-append   no-darwin-pthread-flag.patch

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

variant universal {}
configure.args-append --enable-jit

subport pcre {
    PortGroup clang_dependency 1.0
    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}
