source: trunk/dports/tex/texlive-common/Portfile

Last change on this file was 149832, checked in by dports@…, 13 months ago

texlive-*: update to TeX Live 2016
[merge from /users/dports/ports]

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1# -*- 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
2# $Id: Portfile 149832 2016-07-02 01:39:26Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           texlive 1.0
6
7name                texlive-common
8version             2016
9
10categories          tex
11maintainers         dports
12description         TeX Live common infrastructure.
13long_description    This port provides files that support a MacPorts    \
14                    installation of TeX Live, such as configuration     \
15                    files and the scripts that generate them.
16
17homepage            http://www.tug.org/texlive/
18platforms           darwin
19supported_archs     noarch
20license             Permissive
21
22master_sites        http://giraffe.cs.washington.edu/texlive/
23worksrcdir          ${distname}
24use_xz              yes
25
26checksums           rmd160  c8839abb8bc9668108644bfc8fad45a469019230 \
27                    sha256  6bb20a1acfe739d05517e17ec2a69fd3f703d610d59be330303dfc2a21298940
28
29livecheck.type  regex
30livecheck.url   ${master_sites}
31livecheck.regex ${name}-(\[\\d-\]+)\\.tar
32
33post-patch {
34    foreach x {texmf.cnf.d/10paths.cnf texmfcnf.lua texlive-update-cnf} {
35        reinplace "s|@@PREFIX@@|${prefix}|g" ${worksrcpath}/${x}
36        reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|g" ${worksrcpath}/${x}
37        reinplace "s|@@TEXMFPORTS@@|${texlive_texmfports}|g" ${worksrcpath}/${x}
38        reinplace "s|@@TEXMFLOCAL@@|${texlive_texmflocal}|g" ${worksrcpath}/${x}
39        reinplace "s|@@TEXMFSYSVAR@@|${texlive_texmfsysvar}|g" ${worksrcpath}/${x}
40        reinplace "s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|g" ${worksrcpath}/${x}
41        reinplace "s|@@TEXMFHOME@@|${texlive_texmfhome}|g" ${worksrcpath}/${x}
42        reinplace "s|@@TEXLIVE_BINDIR@@|${texlive_bindir}|g" ${worksrcpath}/${x}
43    }
44}
45
46use_configure   no
47
48build           { }
49
50set texmfdirs [list ${texlive_texmfdist} \
51                    ${texlive_texmfports} \
52                    ${texlive_texmflocal} \
53                    ${texlive_texmfsysvar} \
54                    ${texlive_texmfsysconfig}]
55destroot {
56    # Create texmf directories
57    foreach texmfdir $texmfdirs {
58        xinstall -d ${destroot}${texmfdir}
59    }
60
61    # Create empty ls-R files so that they're marked as owned by this
62    # port. The contents will be generated/updated by mktexlsr.
63    foreach texmfdir $texmfdirs {
64        touch ${destroot}${texmfdir}/ls-R
65    }
66
67    # Create fmt/updmap/hyphen files, directories, and install update script
68    xinstall -d ${destroot}${texlive_texmfsysconfig}/fmtutil.d
69    xinstall -d ${destroot}${texlive_texmfsysconfig}/language.d
70    xinstall -d ${destroot}${texlive_texmfsysconfig}/updmap.d
71    xinstall -m 644 ${worksrcpath}/updmap-hdr.cfg \
72        ${destroot}${texlive_texmfsysconfig}/updmap.d/00updmap-hdr.cfg
73    xinstall -m 644 ${worksrcpath}/fmtutil-hdr.cnf \
74        ${destroot}${texlive_texmfsysconfig}/fmtutil.d/00fmtutil-hdr.cnf
75    xinstall -m 644 ${worksrcpath}/language.us \
76        ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.dat
77    xinstall -m 644 ${worksrcpath}/language.us.def \
78        ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.def
79    xinstall -m 644 ${worksrcpath}/language.us.lua \
80        ${destroot}${texlive_texmfsysconfig}/language.d/00language.us.lua
81    xinstall -d ${destroot}${texlive_texmfsysvar}/web2c
82    touch ${destroot}${texlive_texmfsysvar}/web2c/updmap.cfg
83    touch ${destroot}${texlive_texmfsysvar}/web2c/fmtutil.cnf
84    xinstall -d ${destroot}${texlive_texmfsysvar}/tex/generic/config
85    touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.dat
86    touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.def
87    touch ${destroot}${texlive_texmfsysvar}/tex/generic/config/language.dat.lua
88    xinstall -m 755 ${worksrcpath}/texlive-update-cnf \
89        ${destroot}${prefix}/libexec/texlive-update-cnf
90
91    # Install texmf.cnf files
92    touch ${destroot}${texlive_texmfsysconfig}/texmf.cnf
93    xinstall -d ${destroot}${texlive_texmfsysconfig}/texmf.cnf.d
94    foreach cnffile [glob -directory ${worksrcpath}/texmf.cnf.d *.cnf] {
95        xinstall -m 644 $cnffile \
96            ${destroot}${texlive_texmfsysconfig}/texmf.cnf.d/
97    }
98
99    # Symlink texmf.cnf to its usual expected location, just in case
100    # anything tries to look for it there
101    xinstall -d ${destroot}${texlive_texmfports}/web2c
102    ln -s ${texlive_texmfsysconfig}/texmf.cnf \
103        ${destroot}${texlive_texmfports}/web2c/texmf.cnf
104
105    # Install texmfcnf.lua (for ConTeXt MkIV)
106    xinstall -m 644 ${worksrcpath}/texmfcnf.lua \
107        ${destroot}${texlive_texmfsysconfig}/
108
109}
110
111pre-activate {
112    # Delete ls-R index file if it exists
113    foreach texmfdir $texmfdirs {
114        if [file exists ${texmfdir}/ls-R] {
115            delete ${texmfdir}/ls-R
116        }
117    }
118
119    # An earlier version forgot to register language.def to this port,
120    # so delete it if it exists to prevent a conflict
121    if [file exists ${texlive_texmfsysvar}/tex/generic/config/language.def] {
122        delete ${texlive_texmfsysvar}/tex/generic/config/language.def
123    }
124}
125
126post-activate {
127    system "${prefix}/libexec/texlive-update-cnf texmf.cnf"
128    system "${prefix}/libexec/texlive-update-cnf fmtutil.cnf"
129    system "${prefix}/libexec/texlive-update-cnf language.dat"
130    system "${prefix}/libexec/texlive-update-cnf language.def"
131    system "${prefix}/libexec/texlive-update-cnf language.dat.lua"
132    system "${prefix}/libexec/texlive-update-cnf updmap.cfg"
133
134    # run mktexlsr if it exists (i.e. if we are upgrading an existing
135    # installation)
136    #
137    # Note that this could fail if mktexlsr is installed but broken
138    # during an upgrade, but that's ok (see #48358)
139    if [file exists ${prefix}/bin/mktexlsr] {
140        catch {texlive.mktexlsr}
141    }
142}
Note: See TracBrowser for help on using the repository browser.