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

# bakefile 1.x is available but is incompatible with 0.2.x.
# Probably this port should be updated to 1.x and if needed a new
# bakefile-0.2 port can be created to track the 0.2 branch.
github.setup        vslavik bakefile 0.2.13 v
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            0
checksums           rmd160  faf3c93f9e0fd461b57b288aaa4dc8271ae2b485 \
                    sha256  985f55c7b3fd43a94dabef07c54e645e1b028b627ad78fb6e1f95848ac985e67 \
                    size    340370

categories          devel
maintainers         nomaintainer
license             MIT

description         cross-platform, cross-compiler native makefile generator

long_description    Bakefile is a cross-platform, cross-compiler native \
                    makefile generator. It takes a compiler-independent \
                    description of build tasks as input and generates \
                    a native makefile (autoconf's Makefile.in, Visual C++ \
                    project, bcc makefile etc.).

homepage            https://bakefile.org

post-extract {
    move ${worksrcpath}/configure.in ${worksrcpath}/configure.ac
}

pre-configure {
    system -W ${worksrcpath} "./bootstrap"
}

depends_build-append \
                    port:autoconf \
                    port:automake \
                    port:docbook-xsl-nons \
                    port:libtool \
                    port:libxslt \
                    port:pkgconfig \
                    port:swig-python

# configure fails to detect python in usr/bin correctly on newer MacOS
depends_lib-append  port:python27
configure.python    ${prefix}/bin/python2.7

# See: https://github.com/vslavik/bakefile/issues/120
configure.args-append \
                    --enable-maintainer-mode

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -W ${worksrcpath} -m 0644 AUTHORS COPYING NEWS README THANKS \
        ${destroot}${docdir}
    copy ${worksrcpath}/doc/html ${destroot}${docdir}
}
