# -*- 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 # $Id: Portfile 149832 2016-07-02 01:39:26Z dports@macports.org $ PortSystem 1.0 PortGroup texlive 1.0 name texlive-common version 2016 categories tex maintainers dports description TeX Live common infrastructure. long_description This port provides files that support a MacPorts \ installation of TeX Live, such as configuration \ files and the scripts that generate them. homepage http://www.tug.org/texlive/ platforms darwin supported_archs noarch license Permissive master_sites http://giraffe.cs.washington.edu/texlive/ worksrcdir ${distname} use_xz yes checksums rmd160 c8839abb8bc9668108644bfc8fad45a469019230 \ sha256 6bb20a1acfe739d05517e17ec2a69fd3f703d610d59be330303dfc2a21298940 livecheck.type regex livecheck.url ${master_sites} livecheck.regex ${name}-(\[\\d-\]+)\\.tar post-patch { foreach x {texmf.cnf.d/10paths.cnf texmfcnf.lua texlive-update-cnf} { reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFPORTS@@|${texlive_texmfports}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFLOCAL@@|${texlive_texmflocal}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFSYSVAR@@|${texlive_texmfsysvar}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|g" ${worksrcpath}/${x} reinplace "s|@@TEXMFHOME@@|${texlive_texmfhome}|g" ${worksrcpath}/${x} reinplace "s|@@TEXLIVE_BINDIR@@|${texlive_bindir}|g" ${worksrcpath}/${x} } } use_configure no build { } set texmfdirs [list ${texlive_texmfdist} \ ${texlive_texmfports} \ ${texlive_texmflocal} \ ${texlive_texmfsysvar} \ ${texlive_texmfsysconfig}] destroot { # Create texmf directories foreach texmfdir $texmfdirs { xinstall -d ${destroot}${texmfdir} } # Create empty ls-R files so that they're marked as owned by this # port. The contents will be generated/updated by mktexlsr. foreach texmfdir $texmfdirs { touch ${destroot}${texmfdir}/ls-R } # Create fmt/updmap/hyphen files, directories, and install update script xinstall -d ${destroot}${texlive_texmfsysconfig}/fmtutil.d xinstall -d ${destroot}${texlive_texmfsysconfig}/language.d xinstall -d ${destroot}${texlive_texmfsysconfig}/updmap.d xinstall -m 644 ${worksrcpath}/updmap-hdr.cfg \ ${destroot}${texlive_texmfsysconfig}/updmap.d/00updmap-hdr.cfg xinstall -m 644 ${worksrcpath}/fmtutil-hdr.cnf \ ${destroot}${texlive_texmfsysconfig}/fmtutil.d/00fmtutil-hdr.cnf xinstall -m 644 ${worksrcpath}/language.us \ ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.dat xinstall -m 644 ${worksrcpath}/language.us.def \ ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.def xinstall -m 644 ${worksrcpath}/language.us.lua \ ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.lua xinstall -d ${destroot}${texlive_texmfsysvar}/web2c touch ${destroot}${texlive_texmfsysvar}/web2c/updmap.cfg touch ${destroot}${texlive_texmfsysvar}/web2c/fmtutil.cnf xinstall -d ${destroot}${texlive_texmfsysvar}/tex/generic/config touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.dat touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.def touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.dat.lua xinstall -m 755 ${worksrcpath}/texlive-update-cnf \ ${destroot}${prefix}/libexec/texlive-update-cnf # Install texmf.cnf files touch ${destroot}${texlive_texmfsysconfig}/texmf.cnf xinstall -d ${destroot}${texlive_texmfsysconfig}/texmf.cnf.d foreach cnffile [glob -directory ${worksrcpath}/texmf.cnf.d *.cnf] { xinstall -m 644 $cnffile \ ${destroot}${texlive_texmfsysconfig}/texmf.cnf.d/ } # Symlink texmf.cnf to its usual expected location, just in case # anything tries to look for it there xinstall -d ${destroot}${texlive_texmfports}/web2c ln -s ${texlive_texmfsysconfig}/texmf.cnf \ ${destroot}${texlive_texmfports}/web2c/texmf.cnf # Install texmfcnf.lua (for ConTeXt MkIV) xinstall -m 644 ${worksrcpath}/texmfcnf.lua \ ${destroot}${texlive_texmfsysconfig}/ } pre-activate { # Delete ls-R index file if it exists foreach texmfdir $texmfdirs { if [file exists ${texmfdir}/ls-R] { delete ${texmfdir}/ls-R } } # An earlier version forgot to register language.def to this port, # so delete it if it exists to prevent a conflict if [file exists ${texlive_texmfsysvar}/tex/generic/config/language.def] { delete ${texlive_texmfsysvar}/tex/generic/config/language.def } } post-activate { system "${prefix}/libexec/texlive-update-cnf texmf.cnf" system "${prefix}/libexec/texlive-update-cnf fmtutil.cnf" system "${prefix}/libexec/texlive-update-cnf language.dat" system "${prefix}/libexec/texlive-update-cnf language.def" system "${prefix}/libexec/texlive-update-cnf language.dat.lua" system "${prefix}/libexec/texlive-update-cnf updmap.cfg" # run mktexlsr if it exists (i.e. if we are upgrading an existing # installation) # # Note that this could fail if mktexlsr is installed but broken # during an upgrade, but that's ok (see #48358) if [file exists ${prefix}/bin/mktexlsr] { catch {texlive.mktexlsr} } }