PortSystem          1.0
PortGroup           github 1.0

github.setup        william8000 lout 3.43.2
github.tarball_from archive
revision            0
license             GPL-3+
categories          textproc
platforms           darwin freebsd
maintainers         {judaew @judaew} openmaintainer
description         A text formatting system similar to TeX, but simpler
long_description \
    Lout is a text-formatting system and a purely functional programming    \
    language. It outputs PostScript directly, achieving high quality        \
    printouts in one step.

homepage            https://savannah.nongnu.org/projects/lout/

checksums           rmd160  37b1113d014248ae333b40165c72c8d9b1ed1942 \
                    sha256  11a3185ec7a5c454ee2e3b907bbb6045657b6ff09a6a4a41f6adb5abca66cf99 \
                    size    1678314

depends_build       port:zlib

use_configure       no

# see <https://github.com/macports/macports-ports/pull/662>
compiler.blacklist-append   {macports-clang-3.[0-9]} {clang > 800}
compiler.fallback-append    macports-clang-5.0

use_parallel_build  yes
build.args          PREFIX=${prefix} \
                    CC=${configure.cc} \
                    LOUTLIBDIR=${prefix}/share/lout \
                    PDF_COMPRESSION=1 \
                    ZLIB=${prefix}/lib/libz.a \
                    ZLIBPATH=-I${prefix}/include \
                    USESTAT=1 \
                    COLLATE=1

set docdir          ${prefix}/share/doc/${name}-${version}

destroot.target     allinstall
destroot.destdir    PREFIX=${destroot}${prefix}
destroot.args       LOUTLIBDIR=${destroot}${prefix}/share/lout \
                    LOUTLIB=${destroot}${prefix}/share/lout \
                    MANDIR=${destroot}${prefix}/share/man/man1 \
                    LOUTDOCDIR=${destroot}${docdir}

pre-destroot {
    xinstall -d ${destroot}${docdir}
}
