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

name                fonttools-utils
github.setup        twardoch fonttools-utils 2b77a32b2405229650fd2d6115828a30fb2b9f6e
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version             20180828
revision            1
description         Font-related tools based on FontTools
long_description    Font-related tools that use the Python FontTools \
                    package: MacOSXSystemFontReplacer replaces UI fonts\; \
                    pyftfeatfreeze "freezes" OpenType features into a font
categories          print
license             Apache-2
maintainers         nomaintainer

checksums           rmd160  b61e627fb760971cc57f1abe1867d95076dedf23 \
                    sha256  62acb66ae1740a0a739d2e2e157cfc87929b0e170b2999074a95d5da163abfae \
                    size    1124658

python.default_version 27

depends_run         port:py27-fonttools

build {}

destroot {
    set docdir ${prefix}/share/doc/${name}

    foreach tool {mac-os-x-system-font-replacer pyftfeatfreeze} {
        set tool_dir ${docdir}/${tool}
        xinstall -d ${destroot}${tool_dir}
        xinstall -m 0644 -W ${worksrcpath}/${tool} \
            AUTHORS CONTRIBUTORS LICENSE README.md ${destroot}${tool_dir}
        set script [glob ${worksrcpath}/${tool}/*.py]
        reinplace "s|#!/usr/bin/env python|#!${python.bin}|" ${script}
        xinstall -m 0755 ${script} ${destroot}${prefix}/bin
    }
}