# -*- 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
PortGroup           cmake           1.1
PortGroup           github          1.0
PortGroup           legacysupport   1.1

github.setup        google re2 2024-04-01
github.tarball_from archive
epoch               1
revision            4

checksums           rmd160 6cff98a2c0ce263f8e76127830117994ec202e11 \
                    sha256 3f6690c3393a613c3a0b566309cf04dc381d61470079b653afc47c67fb898198 \
                    size   389819

categories          devel textproc
maintainers         {gmail.com:herby.gillot @herbygillot} \
                    openmaintainer

description         an efficient, principled regular expression library

long_description    RE2 is a fast, safe, thread-friendly alternative to \
                    backtracking regular expression engines like those \
                    used in PCRE, Perl, and Python. It is a C++ library.

license             BSD

patchfiles          patch-re2pc-avoid-overlinking.diff

# clock_gettime needed for abseil
# https://github.com/macports/macports-ports/pull/19905#issuecomment-1680281240
legacysupport.newest_darwin_requires_legacy 15

compiler.cxx_standard \
                    2017
compiler.thread_local_storage \
                    yes

configure.args-append \
                    -DBUILD_SHARED_LIBS:BOOL=ON

depends_lib-append  port:abseil

post-destroot {
    # install additional documents.
    set docdir ${prefix}/share/doc/re2
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} \
        LICENSE README doc/syntax.html doc/syntax.txt \
        ${destroot}${docdir}
}
