# -*- 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 2025-11-05
github.tarball_from archive
epoch               1
revision            0

checksums           rmd160 84618afd5a95e6608ee07178a9f9ce4f4ffadba0 \
                    sha256 87f6029d2f6de8aa023654240a03ada90e876ce9a4676e258dd01ea4c26ffd67 \
                    size   397504

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.md doc/syntax.html doc/syntax.txt \
        ${destroot}${docdir}
}
