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

name                aslib
github.setup        aslze asl 1.11.12
revision            1
categories          devel
license             GPL-3
maintainers         {@barracuda156 macos-powerpc.org:barracuda} \
                    openmaintainer

description         Compact C++ cross-platform utility library
long_description    {*}${description}
checksums           rmd160  38b7921591e9ef52e80c76ad14eb3886e4abf977 \
                    sha256  1e4becf864fbf25b1b41a1914bfdb8b00d7b7dbf03d7d3e6bca56faa4f51cf63 \
                    size    201370
github.tarball_from archive

depends_lib-append  port:mbedtls3

post-extract {
    # DOS to UNIX line endings so we can patch properly.
    fs-traverse file ${worksrcpath} {
        switch [file extension ${file}] {
            .cpp -
            .h -
            .txt {
                reinplace "s|\r||g" ${file}
            }
        }
    }
}

# https://github.com/aslze/asl/issues/30
patchfiles-append   12008dbdb854af9fa8f65a6a2e4b5b919acdab06.patch

configure.args-append \
                    -DASL_BUILD_SHARED=ON \
                    -DASL_BUILD_STATIC=ON \
                    -DASL_IPV6=ON \
                    -DASL_SAMPLES=OFF \
                    -DASL_TESTS=ON \
                    -DASL_TLS=ON

compiler.cxx_standard   2011

test.run            yes
