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

github.setup        zrax string_theory 3.9
revision            0
categories          devel
license             MIT

description         C++ string library
long_description    Flexible modern C++ string library with type-safe formatting

maintainers         {@dpogue dpogue.ca:darryl} openmaintainer

checksums           rmd160  ee42fcf79c6defce16c0632991be1a3d7f79e8f6 \
                    sha256  9bb0a9697319964479f813d9c61e3c5a1f57f7e8a5bc6db14cba7489addc3f49 \
                    size    68952
github.tarball_from archive

if {[variant_isset debug]} {
    cmake.build_type Debug
} else {
    cmake.build_type RelWithDebInfo
}

# https://github.com/zrax/string_theory/issues/55
patchfiles-append   patch-fix-st_config.diff

compiler.cxx_standard 2020

configure.args-append \
                    -DST_BUILD_TESTS:BOOL=OFF \
                    -DST_ENABLE_STL_FILESYSTEM:BOOL=ON \
                    -DST_ENABLE_STL_STRINGS:BOOL=ON

variant tests description "Enable test support" {
    fetch.type      git
    post-fetch {
        system -W ${worksrcpath} "git submodule update --init"
    }

    configure.args-replace \
                    -DST_BUILD_TESTS:BOOL=OFF \
                    -DST_BUILD_TESTS:BOOL=ON

    test.run        yes
}
