# -*- 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           compilers 1.0
PortGroup           github 1.0
PortGroup           meson 1.0

# CMake builds it, but Meson works better.
github.setup        acroucher zofu 1.1.1 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
categories          devel fortran
license             LGPL-3
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Object-oriented Fortran Unit-testing
long_description    Zofu is a framework for carrying out unit testing of Fortran code modules. \
                    As the name suggests, it makes use of the object-oriented features of Fortran 2003.
checksums           rmd160  a3790282236c0a3f1ff223bebb4996f5d6df4d20 \
                    sha256  b785a4e2fa87cd08a0dced8a69d6b2d4634bd5c0c70a9de16b76d9864527c9f5 \
                    size    37820

depends_build-append \
                    port:pkgconfig

compilers.choose    fc cc
compilers.setup     require_fortran

configure.args-append \
                    -Dincludedir=${prefix}/include/${name}

post-destroot {
    # Delete build objects, keep .mod files:
    fs-traverse f ${destroot}${prefix}/include/${name} {
        if {[file isfile ${f}] && !([file extension ${f}] == ".mod")} {
            delete ${f}
        }
    }
}

depends_test-append port:ninja

test.run            yes
test.target         test
