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

name                texlive-pstricks
version             78101
revision            1

categories          tex
maintainers         {dports @drkp}
license             Copyleft Permissive
description         TeX Live: PSTricks
long_description    PSTricks core and all add-on packages.

checksums           texlive-pstricks-78101-run.tar.xz \
                    rmd160  59f5dbbd30f8543b16a72b646d6a783f22dd388c \
                    sha256  ea2e86acc9e60066762a4d336c6317c97c7978407600272748eab4a600c802e8 \
                    size    29849620 \
                    texlive-pstricks-78101-doc.tar.xz \
                    rmd160  723b67722a1945abd828721ae9e572d65b303c59 \
                    sha256  4f101714a771f0aed00c1e28eb68d094500d19a61224348407c197899ccd7d7c \
                    size    430060112 \
                    texlive-pstricks-78101-src.tar.xz \
                    rmd160  0b869c9223fc503edbcade18ee885a8000b6d023 \
                    sha256  392b8c15d10d17cf890332e32c60d3f5364c2e80c15af69112e2de7dc4b54929 \
                    size    444000

depends_lib         port:texlive-basic port:texlive-plain-generic

texlive.binaries    pedigree ps4pdf pst2pdf

# pedigree's location for its bundled Perl module and config file is
# computed based on TEXMFROOT, which is not correct for our installation.
# Patch in the correct paths.
patchfiles          patch-runfiles_texmf-dist_scripts_pedigree-perl_pedigree.pl.diff

post-patch {
    reinplace -E \
        "s|@@TEXMFDIST@@|${texlive_texmfdist}|; \
         s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|; \
         s|@@TEXMFLOCAL@@|${texlive_texmflocal}|" \
        ${worksrcpath}/runfiles/texmf-dist/scripts/pedigree-perl/pedigree.pl
}

texlive.texmfport
