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

name                flusspferd
version             0.8
revision            4
categories          devel
maintainers         flusspferd.org:team
description         provides Javascript bindings for C++.
long_description    ${name} ${description}
homepage            http://flusspferd.org/

platforms           darwin

depends_lib         port:spidermonkey

master_sites        sourceforge
use_bzip2           yes
checksums           md5     4a93f9b8ee2ec1fd9c50029f184ceffa \
                    sha1    df18e259e2ee0cd75ad13130881ae7f55ae0bd27 \
                    rmd160  3b1f7a6d16708dfcfeb1e827a2e93aaa8b45e95e

boost.version       1.71

# spidermonkey is not universal
universal_variant   no

configure.args      -DENABLE_TESTS=OFF \
                    -DFORCE_PLUGINS=ON \
                    -DPLUGIN_SQLITE3=OFF \
                    -DPLUGIN_GMP=OFF

variant test description { Build Unit Tests } {
    configure.args-append -DENABLE_TESTS=ON
    test {
        system "cd ${worksrcpath} && ./util/run_tests.sh"
    }
}

variant readline description { Build with GNU/readline support instead of libedit } {
    configure.args-append -DUSE_READLINE=ON
    depends_lib-append port:readline
}

variant sqlite description { Add SQLite support } {
    depends_lib-append port:sqlite3
    configure.args-append -DPLUGIN_SQLITE3=ON
}

variant gmp description { Add GMP support } {
    depends_lib-append port:gmp
    configure.args-append -DGMP_ROOT=${prefix} -DPLUGIN_GMP=ON
}
