# -*- 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 1.19.1 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 33595406c8b0052875075a13093955907471e8d8 \
                    sha256 f2902317bfe77da1015b114fd7c35ee8ac06d60bc0cc22dd36f8ac6bc9b642ec \
                    size 50034482

compiler.cxx_standard  2011

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

depends_lib-append  path:lib/libssl.dylib:openssl \
                    port:pcre \
                    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
