# -*- 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        jung-kurt luahpdf c8b2677cba
name                lua-luahpdf
version             1.5
revision            1
license             MIT
categories          devel
platforms           darwin
maintainers         nomaintainer
description         Lua module that lets you programmatically create PDF files
long_description    LuaHPDF is a Lua module that lets you programmatically create PDF files using \
                    Lua. It does this by binding to the Haru Free PDF Library, an open-source \
                    library that manages the details of PDF generation. \
                    With this module, you can write Lua programs that will produce PDF files that \
                    include lines, text and graphics, PNG and JPEG images, compression, \
                    encryption, Type1 and TrueType fonts, various character sets, outlines, \
                    links.

checksums           rmd160  ee7d234de41de41b3c8de2e10a5cff3de920a817 \
                    sha256  2b01967287b83f9efd35d5a317b0838a609f55e07419f58aad74be7399bcc2ea

depends_lib         port:lua \
                    port:libharu \
                    port:libpng \
                    port:zlib

patchfiles          patch-Makefile.diff

use_configure       no

set lua_version     5.3

build.args-append   CC=${configure.cc} \
                    LUAINC="${configure.cppflags}" \
                    CFLAGS="${configure.cflags} [get_canonical_archflags cc]" \
                    LDFLAGS="${configure.ldflags} [get_canonical_archflags ld]" \
                    PLATFORM=macosx \
                    PREFIX=${prefix}

destroot.args-append \
                    MODDIR=${prefix}/lib/lua/${lua_version} \
                    PREFIX=${prefix}

post-destroot {
    xinstall -d -m 755                                 ${destroot}${prefix}/share/examples
    file copy   ${worksrcpath}/demo                    ${destroot}${prefix}/share/examples/${name}
    file rename ${destroot}${prefix}/share/doc/luahpdf ${destroot}${prefix}/share/doc/${name}
}