# -*- coding: utf-8; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup               cmake 1.1
PortGroup               github 1.0

name                    ascent
github.setup            AnyarInc Ascent 0.7.1 v
github.tarball_from     archive
revision                1

categories              math science
license                 Apache-2
platforms               any
supported_archs         noarch
maintainers             {sethm.id.au:dev @McDaMastR} \
                        openmaintainer

description             C++ simulation engine and differential equation solver
long_description        An extremely fast and flexible {*}${description}.

dist_subdir             ${name}/${version}_1

checksums               rmd160  6fb8b2417e91ec92b09989bd382dda7d033dbfa9 \
                        sha256  e8dbee98db3d58f7e52a1c606c8137f0e40d56058d1dc60d5c035635c51182c1 \
                        size    191650

patchfiles              fix-project-version.diff

post-patch {
    reinplace "s|@@VERSION@@|${version}|g" ${worksrcpath}/CMakeLists.txt
}

compiler.cxx_standard   2020

configure.args-append   -DBUILD_EXAMPLES=OFF \
                        -DBUILD_TESTING=ON

test.run                yes
test.cmd                ctest

post-destroot {
    set destdocdir  ${destroot}${prefix}/share/doc/${name}

    xinstall -d ${destdocdir}
    xinstall -W ${worksrcpath} -m 644 \
        LICENSE \
        README.md \
        ${destdocdir}
}
