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

name                angelscript
version             2.38.0
revision            0
categories          devel
maintainers         nomaintainer
license             zlib

description         Flexible cross-platform scripting library

long_description    The AngelCode Scripting Library, or AngelScript as it is \
                    also known, is an extremely flexible cross-platform \
                    scripting library designed to allow applications to \
                    extend their functionality through external scripts. It \
                    has been designed from the beginning to be an easy to \
                    use component, both for the application programmer and \
                    the script writer.

homepage            https://www.angelcode.com/angelscript/
master_sites        ${homepage}sdk/files/
distname            ${name}_${version}
use_zip             yes

checksums           rmd160  ae6dfc13eebd230a85c9cfe263a415aaae48e1bc \
                    sha256  b33b5dbcda10317ef67d628353d83246984ce6fcac102d4dc2aed121eba52e6f \
                    size    2060096

worksrcdir          sdk/${name}/projects/cmake

patchfiles          macports-smoke-test.patch

compiler.cxx_standard \
                    2011

configure.args-append \
                    -DBUILD_SHARED_LIBS=ON

post-destroot {
    set docdir ${destroot}${prefix}/share/doc
    xinstall -d ${docdir}
    copy ${workpath}/sdk/docs ${docdir}/${name}
}

test.run            yes
test {
    set t ${workpath}/smoke
    system -W ${build.dir} "${configure.cxx} ${configure.cxxflags} [get_canonical_archflags cxx] \
        -I${workpath}/sdk/${name}/include ${worksrcpath}/macports-smoke.cpp -L${build.dir} -l${name} -o ${t}"
    system -W ${build.dir} "env DYLD_LIBRARY_PATH=${build.dir} ${t}"
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     ${name}_(\[0-9.\]+)${extract.suffix}
