# -*- 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           github 1.0
github.setup        qorelanguage qore 2.2.0 release-
github.tarball_from releases

PortGroup           cmake 1.1

categories          lang
license             {LGPL-2.1 MIT}
maintainers         {davidnichols @davidnich} openmaintainer
use_bzip2           yes
description         multi-threaded embeddable scripting language
long_description    Qore is a scripting language designed for multi-threading and SMP scalability
homepage            http://qore.org

checksums           rmd160 c72c2390cd9d98e6826c40c11be8291a830be554 \
                    sha256 32ef14f4f10b4cd14db8dd7f5133c8e8b83436431496b96b1b5f3b35c68befa6 \
                    size 59716461

compiler.cxx_standard  2017

depends_build-append \
                    port:bison \
                    port:flex \
                    port:pkgconfig

depends_lib-append  path:lib/libssl.dylib:openssl \
                    port:pcre2 \
                    port:zlib \
                    port:bzip2 \
                    port:gmp \
                    port:mpfr \
                    port:tbb

compiler.thread_local_storage yes

configure.args-append -DSINGLE_COMPILATION_UNIT=1

# check_function_exists doesn't catch tbb's function, enforce it
configure.args-append \
                    -DCMAKE_INCLUDE_PATH="${prefix}/include\;${prefix}/libexec/tbb/include" \
                    -DCMAKE_LIBRARY_PATH="${prefix}/lib\;${prefix}/libexec/tbb/lib" \
                    -DHAVE_TBBMALLOC=ON
