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

github.setup        william8000 lout 3.43.4
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  924e927525a7074db4967afca1c8bd62c826a66f \
                    sha256  5cc2700f842860dd4d0af95ef5aff8cf9fe1e155d04ee951f790697aa27e7807 \
                    size    1678961

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}
}
