# -*- 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-bin-extra
version             78219
revision            0

categories          tex
maintainers         {dports @drkp}
license             Copyleft Permissive
description         TeX Live: TeX auxiliary programs
long_description    Myriad additional TeX-related support programs. Includes programs and macros for DVI file manipulation, literate programming, patgen, and plenty more.

checksums           texlive-bin-extra-78219-run.tar.xz \
                    rmd160  0ac9bf57fa5b23823b9e0160e153e54efab4077e \
                    sha256  ac8406da5a7f4c1aa53cdd7e8ef86b7a9d87e6ddf244edf531297f88ef721230 \
                    size    89351456 \
                    texlive-bin-extra-78219-doc.tar.xz \
                    rmd160  871f1353fc7c37488c99003673cd4ae1cdcff78f \
                    sha256  9b5d0c454d4d1115165b78625a7b2f64ac8c40c7867bbcef8820067072c1199c \
                    size    37389044 \
                    texlive-bin-extra-78219-src.tar.xz \
                    rmd160  3deb27367378a8268fad94048dfee045278145a6 \
                    sha256  5305aece884524abf711d67ecd1394a14974b6ddf123510bd84e7e8e02792518 \
                    size    492208

depends_lib         port:texlive-basic

texlive.formats      \
    {0 mflua mflua-nowin - {mf.ini}}

texlive.binaries    a2ping a5toa4 adhocfilelist allcm allec allneeded arara arlatex bibtex8 bibtexu bundledoc checklistings chkdvifont chklref chktex chkweb cllualatex cluttex clxelatex ctan-o-mat ctanbib ctangle ctanify ctanupload ctie ctwill ctwill-proofsort ctwill-refsort ctwill-twinx cweave de-macro depythontex deweb digestif dt2dv dtxgen dv2dt dvi2fax dviasm dvibook dviconcat dvicopy dvidvi dvihp dviinfox dvilj dvilj2p dvilj4 dvilj4l dvilj6 dvipos dvired dviselect dvispc dvitodvi dvitype e2pall edtx2dtx explcheck findhyph fragmaster git-latexdiff gsftopk installfont-tl ketcindy kpsepath kpsetool kpsewhere kpsexpand l3sys-query lacheck latex-git-log latex-papersize latex2man latex2nemeth latexdef latexfileversion latexindent latexpand listings-ext.sh llmk ltxfileinfo ltximg make4ht match_parens mflua mflua-nowin mfluajit mfluajit-nowin mkjobtexmf mkocp mkofm optexcount pamphletangler patgen pdfbook2 pdfclose pdfcrop pdflatexpicscale pdfopen pdftex-quiet pdftosrc pdfxup pfarrei pkfix pkfix-helper pooltype ppmcheckpdf ps2frag pslatex purifyeps pythontex rpdfcrop runtexfile runtexshebang show-pdf-tags spix sqltex srcredact sty2dtx synctex tangle tex4ebook texaccents texblend texconfig texconfig-dialog texconfig-sys texcount texdef texdiff texdirflatten texdoc texdoctk texfot texlinks texliveonfly texloganalyser texlogfilter texlogsieve texosquery texosquery-jre5 texosquery-jre8 texplate tie tlcockpit tpic2pdftex twill twill-refsort typeoutfileinfo upmendex weave xdvipsk xindex

# Dependencies for tools that are part of this package in TeX Live,
# but are packaged as separate ports
depends_run-append  port:texlive-tlpdb \
                    port:latexmk \
                    port:opendetex \
                    port:latexdiff \
                    port:pdfjam \
                    port:dvipng \
                    path:bin/dvisvgm:dvisvgm

PortGroup           perl5 1.0
perl5.branches      5.34

# Fix perl paths for any perl scripts that have dependencies. Some of
# the included packages install other perl scripts, but they don't
# require any non-core modules and thus should be able to run with any
# reasonable installed version of perl.
post-patch {
    reinplace -E "1 s,^#! ?(/usr/bin/env perl|/usr/bin/perl),#!${prefix}/bin/perl${perl5.major}," \
        ${worksrcpath}/runfiles/texmf-dist/scripts/ctan-o-mat/ctan-o-mat.pl \
        ${worksrcpath}/runfiles/texmf-dist/scripts/ctanify/ctanify \
        ${worksrcpath}/runfiles/texmf-dist/scripts/ctanupload/ctanupload.pl \
        ${worksrcpath}/runfiles/texmf-dist/scripts/latex-git-log/latex-git-log \
        ${worksrcpath}/runfiles/texmf-dist/scripts/latexindent/latexindent.pl \
        ${worksrcpath}/runfiles/texmf-dist/scripts/ltximg/ltximg.pl \
        ${worksrcpath}/runfiles/texmf-dist/scripts/purifyeps/purifyeps \
        ${worksrcpath}/runfiles/texmf-dist/scripts/texdoctk/texdoctk.pl
}

# dependencies for latexindent
depends_run-append port:p${perl5.major}-data-dumper \
                   port:p${perl5.major}-file-homedir \
                   port:p${perl5.major}-file-which \
                   port:p${perl5.major}-getopt-long \
                   port:p${perl5.major}-log-dispatch \
                   port:p${perl5.major}-log-log4perl \
                   port:p${perl5.major}-mime-charset \
                   port:p${perl5.major}-text-parsewords \
                   port:p${perl5.major}-unicode-linebreak \
                   port:p${perl5.major}-yaml-tiny

# dependencies for ctan-o-mat (also p5-data-dumper)
depends_run-append port:p${perl5.major}-libwww-perl \
                   port:p${perl5.major}-lwp-protocol-https

# dependencies for ctanify
depends_run-append port:p${perl5.major}-file-copy-recursive

# dependencies for ctanupload
depends_run-append port:p${perl5.major}-html-formatter \
                   port:p${perl5.major}-www-mechanize
# dependencies for latex-git-log
depends_run-append port:p${perl5.major}-ipc-system-simple

# dependencies for purifyeps (also p5-file-which)
depends_run-append port:pstoedit

# dependencies for texdoctk
depends_run-append port:p${perl5.major}-tk \

# ltximg also depends on p5-data-dumper

pre-activate {
    # Handle conflicts for TL2023 update
    if { ![catch {set vers [lindex [registry_active texlive-lang-japanese] 0]}]
         && ([vercmp [lindex $vers 1] 66482] < 0) } {
        registry_deactivate_composite texlive-lang-japanese "" [list ports_nodepcheck 1]
    }
}

texlive.texmfport
