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

github.setup        Goddard-Fortran-Ecosystem gFTL 1.14.0 v
revision            0
categories          devel fortran
license             Apache-2
platforms           any
supported_archs     noarch
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
description         Software containers for Fortran
long_description    {*}${description}
checksums           rmd160  fea2f615d4db6d08e72175dc00ee36ebddfb83a6 \
                    sha256  bf8e3ba3f708ea327c7eb1a5bd1afdce41358c6df1a323aba0f73575c25d5fc8 \
                    size    170347
github.tarball_from archive

depends_build-append \
                    port:m4

# Oh: https://github.com/Goddard-Fortran-Ecosystem/gFTL/issues/200
patchfiles-append   patch-fix-paths.diff

post-patch {
    reinplace "s,@PREFIX@,${prefix},g" ${worksrcpath}/CMakeLists.txt
}

build.env-append    M4=${prefix}/bin/gm4

# That was non-trivial: https://github.com/Goddard-Fortran-Ecosystem/gFTL/issues/184
build.target        all m4_type_includes test_generated_incs

compilers.setup     require_fortran

test.run            yes
test.cmd            ctest
