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

name                scons
version             4.10.0
revision            0
checksums           rmd160  53baf3f0a65bf34992e1e330f43906ca10a675cf \
                    sha256  61e2fc42e0e2c750105d61f26cc1dfebcae9f4103d3dc0e9aeb373016b0d208c \
                    size    3257277

categories          devel python
supported_archs     noarch
platforms           {darwin any}
license             MIT
maintainers         {ryandesign @ryandesign} openmaintainer

description         A software construction tool
long_description    SCons is an Open Source software construction \
                    tool--that is, a next-generation build tool. Think \
                    of SCons as an improved, cross-platform substitute \
                    for the classic Make utility with integrated \
                    functionality similar to autoconf/automake and \
                    compiler caches such as ccache.

homepage            https://www.scons.org
master_sites        sourceforge:project/scons/scons/${version}
distname            SCons-${version}
worksrcdir          scons-${version}

# Keep the python version synchronized with ports that need extra python modules
# in their scons scripts, including: cantera
python.default_version \
                    313

patchfiles          python-interp.patch
post-patch {
    reinplace -W ${worksrcpath}/SCons/Utilities "1s|__PYTHON__|${python.bin}|" \
        ConfigureCache.py sconsign.py
}

post-destroot {
    xinstall -m 0755 -d \
        ${destroot}${prefix}/share/doc/${name}
    xinstall -m 0644 -W ${worksrcpath} \
        LICENSE README.rst \
        ${destroot}${prefix}/share/doc/${name}
    file mkdir ${destroot}${python.prefix}/share/man/man1
    foreach manfile [glob -tails -directory ${worksrcpath} *.1] {
        copy ${worksrcpath}/${manfile} \
            ${destroot}${python.prefix}/share/man/man1/${manfile}
        ln -s ${python.prefix}/share/man/man1/${manfile} \
            ${destroot}${prefix}/share/man/man1/${manfile}
    }
}
