archrelease: copy trunk to extra-x86_64
[arch-packages.git] / texlive-core / trunk / PKGBUILD
blobe7d6f288b7cc37a27bc5f90fd821d2196c0a90b4
1 # Maintainer: Rémy Oudompheng <remy@archlinux.org>
3 pkgname=texlive-core
4 pkgver=2021.58710
5 _revnr=${pkgver#2021.}
6 pkgrel=2
7 pkgdesc="TeX Live core distribution"
8 license=('GPL')
9 arch=(any)
10 depends=('texlive-bin' 'perl')
11 optdepends=(
12   'dialog:      for texconfig'
13   'ghostscript: for epstopdf, epspdf and other ConTeXt tools' 
14   'java-runtime: for utilities like arara, texplate'
15   'perl-tk:     for texdoctk'
16   'psutils:     to manipulate the output of dvips'
17   'python:      for de-macro, dviasm, pythontex'
18   'ruby:        for old ConTeXT MkII and epspdf'
19   't1utils:     can be useful when installing Type1 fonts'
21 groups=('texlive-most')
22 conflicts=('tetex' 'texlive-latex3' 'pdfjam'
23            'texlive-genericextra'
24            'texlive-plainextra')
25 provides=('tetex' 'texlive-latex3' 'pdfjam'
26           'texlive-genericextra'
27           'texlive-plainextra')
28 replaces=('tetex' 'texlive-latex3' 'pdfjam'
29           'texlive-genericextra'
30           'texlive-plainextra')
31 url='http://tug.org/texlive/'
32 source=("https://sources.archlinux.org/other/texlive/$pkgname-$pkgver-src.zip"
33         "$pkgname.maps"
34         "$pkgname.fmts"
35         "mktexlsr.hook"
36         "mktexlsr.script"
37         "texlive-updmap.hook"
38         "texlive-updmap.script"
39         "texlive-fmtutil.hook"
40         "texlive-fmtutil.script"
41         "texmf.cnf"
42         "texmfcnf.lua"
43         "09-texlive-fonts.conf")
44 install=texlive.install
45 backup=(etc/texmf/web2c/texmf.cnf \
46         etc/texmf/chktex/chktexrc \
47         etc/texmf/dvipdfmx/dvipdfmx.cfg \
48         etc/texmf/dvips/config/config.ps \
49         etc/texmf/tex/generic/config/language.dat \
50         etc/texmf/tex/generic/config/language.def \
51         etc/texmf/tex/generic/tex-ini-files/pdftexconfig.tex \
52         etc/texmf/ttf2pk/ttf2pk.cfg \
53         etc/texmf/web2c/fmtutil.cnf \
54         etc/texmf/web2c/mktex.cnf \
55         etc/texmf/xdvi/XDvi)
56 sha256sums=('ef11a19ca15f3e937733ed9e17cc024afaf525afdf3d649c9ae4261f1bfb4415'
57             'bbed1c20c91daca967e344505b9dd4e502569365709ce6b87be5510c2ebb98ef'
58             '09cbe0717c53078d30bdc378322f82e673dafbe7cf76a11e0a3c6dd54dcdfea3'
59             'c76f01fe2a42e5860f7d0b2f16a4fc09101e1a14ea7488985e914cda749f1a21'
60             '05afeae62a5d4c9de79c838c9636e2aefe9ad1d6b787fed4e5930c13baf60eba'
61             '2141c0842668fb937fd21ca2fae39b642c9665656e404a0d4ee7bdc477bf51fe'
62             'ee6e76192a5ad880a2152cd7900b86c8465239fb228045a2f8360b0d7a449f4a'
63             'b641550fe7727422b6964d505db7dbc35b3680a9d47b8d97ac550828bdb9bac7'
64             'f96e9f815fa0a4b85e677f2a9215d9106b8abe46eceb3f3e36a6c76eda3e4a85'
65             'd17a0496f422ae06cabca5e54dc6ff88a204be1586e2a532740a322b0d756b04'
66             '0b6c3ee516608ce04d7133db52cadfa1be5d885b3f82bb39dc5897b213847e0d'
67             '5e79c40cf3ab93348fc89e97890198601767ea2c8fea89ea76088c17a2b35962')
69 build() {
70    cd "$srcdir"
71    echo -n "   --> extracting all packages... "
72    for p in *.tar.xz; do 
73      bsdtar -xf $p
74    done
75    echo "done"
76    rm -rf source doc
79 package() {
80    cd "$srcdir"
82    # Install packages.
83    install -m755 -d "$pkgdir"/var/lib/texmf/arch/installedpkgs
84    sed -i '/^#/d' CONTENTS
85    install -m644 CONTENTS "$pkgdir"/var/lib/texmf/arch/installedpkgs/${pkgname}_${_revnr}.pkgs
86    install -m644 $pkgname.maps "$pkgdir"/var/lib/texmf/arch/installedpkgs/
87    install -m644 $pkgname.fmts "$pkgdir"/var/lib/texmf/arch/installedpkgs/
88    install -m755 -d "$pkgdir"/usr/share
89    wanteddirs=$(for d in *; do test -d $d && [[ $d != texmf* ]] && echo $d; done) || true
90    for dir in $wanteddirs; do
91      find $dir -type d -exec install -d -m755 "$pkgdir"/usr/share/texmf-dist/'{}' \;
92      find $dir -type f -exec install -m644 '{}' "$pkgdir"/usr/share/texmf-dist/'{}' \;
93    done
94    find texmf-dist -type d -exec install -d -m755 "$pkgdir"/usr/share/'{}' \;
95    find texmf-dist -type f -exec install -m644 '{}' "$pkgdir"/usr/share/'{}' \;
96    find texmf-dist -type f -executable -exec chmod 755 "$pkgdir"/usr/share/'{}' \;
98    #############################################################
99    ### install texmf tree
100    echo "--> installing the /etc/texmf tree"
101    install -d -m755 "$pkgdir"/etc/texmf/web2c
102    install -d -m755 "$pkgdir"/etc/texmf/chktex
103    install -d -m755 "$pkgdir"/etc/texmf/dvips/config
104    install -d -m755 "$pkgdir"/etc/texmf/dvipdfmx
105    install -d -m755 "$pkgdir"/etc/texmf/tex/generic/config
106    install -d -m755 "$pkgdir"/etc/texmf/tex/generic/tex-ini-files
107    install -d -m755 "$pkgdir"/etc/texmf/ttf2pk
108    install -d -m755 "$pkgdir"/etc/texmf/xdvi
110    install -d -m755 "$pkgdir"/usr/share/fontconfig/conf.avail
111    install -m644 "$srcdir"/09-texlive-fonts.conf \
112           "$pkgdir"/usr/share/fontconfig/conf.avail/
114    # Remove manpages (already in texlive-bin).
115    rm -rf "$pkgdir"/usr/share/texmf-dist/doc/man
117    # copy config files to $TEXMFCONFIG tree
118    cp -a "$pkgdir"/usr/share/texmf-dist/chktex/chktexrc \
119         "$pkgdir"/etc/texmf/chktex/
120    cp -a "$pkgdir"/usr/share/texmf-dist/web2c/mktex.cnf \
121           "$pkgdir"/etc/texmf/web2c/
122    cp -a "$pkgdir"/usr/share/texmf-dist/web2c/updmap-hdr.cfg \
123           "$pkgdir"/etc/texmf/web2c/
124    cp -a "$pkgdir"/usr/share/texmf-dist/web2c/fmtutil-hdr.cnf \
125           "$pkgdir"/etc/texmf/web2c/fmtutil.cnf
126    cp -a "$pkgdir"/usr/share/texmf-dist/dvips/config/config.ps \
127           "$pkgdir"/etc/texmf/dvips/config/
128    cp -a "$pkgdir"/usr/share/texmf-dist/dvipdfmx/dvipdfmx.cfg \
129           "$pkgdir"/etc/texmf/dvipdfmx/
130    cp -a "$pkgdir"/usr/share/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex \
131           "$pkgdir"/etc/texmf/tex/generic/tex-ini-files/
132    cp -a "$pkgdir"/usr/share/texmf-dist/tex/generic/config/language.dat \
133           "$pkgdir"/etc/texmf/tex/generic/config/
134    cp -a "$pkgdir"/usr/share/texmf-dist/tex/generic/config/language.def \
135           "$pkgdir"/etc/texmf/tex/generic/config/
136    cp -a "$pkgdir"/usr/share/texmf-dist/ttf2pk/ttf2pk.cfg \
137           "$pkgdir"/etc/texmf/ttf2pk/
138    cp -a "$pkgdir"/usr/share/texmf-dist/xdvi/XDvi \
139           "$pkgdir"/etc/texmf/xdvi/
140    # remove TL specific warnings in the language.{dat,def} files:
141    sed -i -e '/DO NOT EDIT/,+3 d' "$pkgdir"/etc/texmf/tex/generic/config/language.*
143    # replace upstream texmf.cnf with ours
144    rm -f "$pkgdir"/usr/share/texmf-dist/web2c/texmf.cnf
145    install -m644 "$srcdir"/texmf.cnf "$pkgdir"/etc/texmf/web2c/texmf.cnf
146    # since the location of texmf.cnf is hard-wired to be under /usr/share/texmf/web2c
147    # we make a symlink from /etc/texmf/web2c/texmf.cnf to the latter
148    ln -sf /etc/texmf/web2c/texmf.cnf "$pkgdir"/usr/share/texmf-dist/web2c/texmf.cnf
149    # replace upstream texmfcnf.lua with ours
150    install -m644 "$srcdir"/texmfcnf.lua "$pkgdir"/usr/share/texmf-dist/web2c/texmfcnf.lua
152    # install Perl libraries
153    mv "$pkgdir"/usr/share/texmf-dist/tlpkg "$pkgdir"/usr/share
154    rm -rf "$pkgdir"/usr/share/tlpkg/tlpobj
156    ## install pacman hooks
157    install -D -m644 ${srcdir}/mktexlsr.hook "$pkgdir/usr/share/libalpm/hooks/mktexlsr.hook"
158    install -D -m644 ${srcdir}/texlive-updmap.hook "$pkgdir/usr/share/libalpm/hooks/texlive-updmap.hook"
159    install -D -m644 ${srcdir}/texlive-fmtutil.hook "$pkgdir/usr/share/libalpm/hooks/texlive-fmtutil.hook"
160    install -D -m755 ${srcdir}/mktexlsr.script "$pkgdir/usr/share/libalpm/scripts/mktexlsr"
161    install -D -m755 ${srcdir}/texlive-updmap.script "$pkgdir/usr/share/libalpm/scripts/texlive-updmap"
162    install -D -m755 ${srcdir}/texlive-fmtutil.script "$pkgdir/usr/share/libalpm/scripts/texlive-fmtutil"
164    # remove upstream updmap.cfg: it contains too many maps.
165    rm "${pkgdir}/usr/share/texmf-dist/web2c/updmap.cfg"
166    # remove upstream fmtutil.cnf: it will be autogenerated
167    rm "${pkgdir}/usr/share/texmf-dist/web2c/fmtutil.cnf"
169    # more cleanup
170    rm -rf "$pkgdir/usr/share/texmf-dist/scripts/context/stubs/mswin/"
172     # link programs from /usr/share/texmf-dist/scripts
173     _linked_scripts="
174 a2ping/a2ping.pl
175 accfonts/mkt1font
176 accfonts/vpl2ovp
177 accfonts/vpl2vpl
178 adhocfilelist/adhocfilelist.sh
179 albatross/albatross.sh
180 arara/arara.sh
181 attachfile2/pdfatfi.pl
182 bundledoc/arlatex
183 bundledoc/bundledoc
184 checkcites/checkcites.lua
185 checklistings/checklistings.sh
186 chklref/chklref.pl
187 chktex/chkweb.sh
188 chktex/deweb.pl
189 cjk-gs-integrate/cjk-gs-integrate.pl
190 clojure-pamphlet/pamphletangler
191 cluttex/cluttex.lua
192 context/perl/mptopdf.pl
193 context/stubs/unix/context
194 context/stubs/unix/contextjit
195 context/stubs/unix/luatools
196 context/stubs/unix/mtxrun
197 context/stubs/unix/mtxrunjit
198 context/stubs/unix/texexec
199 context/stubs/unix/texmfstart
200 ctan-o-mat/ctan-o-mat.pl
201 ctanbib/ctanbib
202 ctanify/ctanify
203 ctanupload/ctanupload.pl
204 de-macro/de-macro
205 dosepsbin/dosepsbin.pl
206 dtxgen/dtxgen
207 dviasm/dviasm.py
208 dviinfox/dviinfox.pl
209 epstopdf/epstopdf.pl
210 findhyph/findhyph
211 fontools/afm2afm
212 fontools/autoinst
213 fontools/ot2kpx
214 fragmaster/fragmaster.pl
215 git-latexdiff/git-latexdiff
216 installfont/installfont-tl
217 jfmutil/jfmutil.pl
218 ketcindy/ketcindy.sh
219 latex-git-log/latex-git-log
220 latex-papersize/latex-papersize.py
221 latex2man/latex2man
222 latex2nemeth/latex2nemeth
223 latexdiff/latexdiff-vc.pl
224 latexdiff/latexdiff.pl
225 latexdiff/latexrevise.pl
226 latexfileversion/latexfileversion
227 latexindent/latexindent.pl
228 latexmk/latexmk.pl
229 latexpand/latexpand
230 light-latex-make/llmk.lua
231 ltxfileinfo/ltxfileinfo
232 ltximg/ltximg.pl
233 luaotfload/luaotfload-tool.lua
234 lwarp/lwarpmk.lua
235 make4ht/make4ht
236 match_parens/match_parens
237 mf2pt1/mf2pt1.pl
238 mkjobtexmf/mkjobtexmf.pl
239 pdfbook2/pdfbook2
240 pdfcrop/pdfcrop.pl
241 pdfjam/pdfjam
242 pdflatexpicscale/pdflatexpicscale.pl
243 pdftex-quiet/pdftex-quiet
244 pdfxup/pdfxup
245 pfarrei/a5toa4.tlu
246 pfarrei/pfarrei.tlu
247 pkfix-helper/pkfix-helper
248 pkfix/pkfix.pl
249 ps2eps/ps2eps.pl
250 purifyeps/purifyeps
251 pythontex/depythontex.py
252 pythontex/pythontex.py
253 simpdftex/simpdftex
254 spix/spix.py
255 srcredact/srcredact.pl
256 sty2dtx/sty2dtx.pl
257 tex4ebook/tex4ebook
258 tex4ht/ht.sh
259 tex4ht/htcontext.sh
260 tex4ht/htlatex.sh
261 tex4ht/htmex.sh
262 tex4ht/httex.sh
263 tex4ht/httexi.sh
264 tex4ht/htxelatex.sh
265 tex4ht/htxetex.sh
266 tex4ht/mk4ht.pl
267 tex4ht/xhlatex.sh
268 texcount/texcount.pl
269 texdef/texdef.pl
270 texdiff/texdiff
271 texdirflatten/texdirflatten
272 texdoc/texdoc.tlu
273 texdoctk/texdoctk.pl
274 texfot/texfot.pl
275 texlive-extra/allcm.sh
276 texlive-extra/allneeded.sh
277 texlive-extra/dvi2fax.sh
278 texlive-extra/dvired.sh
279 texlive-extra/e2pall.pl
280 texlive-extra/fontinst.sh
281 texlive-extra/kpsetool.sh
282 texlive-extra/kpsewhere.sh
283 texlive-extra/ps2frag.sh
284 texlive-extra/pslatex.sh
285 texlive-extra/texconfig-dialog.sh
286 texlive-extra/texconfig-sys.sh
287 texlive-extra/texconfig.sh
288 texlive-extra/texlinks.sh
289 texlive/fmtutil-sys.sh
290 texlive/fmtutil-user.sh
291 texlive/fmtutil.pl
292 texlive/mktexlsr
293 texlive/mktexmf
294 texlive/mktexpk
295 texlive/mktextfm
296 texlive/rungs.tlu
297 texlive/updmap-sys.sh
298 texlive/updmap-user.sh
299 texlive/updmap.pl
300 texliveonfly/texliveonfly.py
301 texloganalyser/texloganalyser
302 texplate/texplate.sh
303 thumbpdf/thumbpdf.pl
304 typeoutfileinfo/typeoutfileinfo.sh
305 xindex/xindex.lua
306 xindy/texindy.pl
307 xindy/xindy.pl
309     install -m755 -d "$pkgdir/usr/bin"
310     for _script in ${_linked_scripts}; do
311         _scriptbase=$(basename $_script)
312         _scriptbase=${_scriptbase%.*}
313         ln -s /usr/share/texmf-dist/scripts/${_script} "${pkgdir}/usr/bin/${_scriptbase}"
314     done
315     ln -s /usr/share/texmf-dist/scripts/listings-ext/listings-ext.sh "${pkgdir}/usr/bin/listings-ext.sh"
317     # additional symlinks
318     ln -s allcm "${pkgdir}"/usr/bin/allec
319     ln -s cluttex "${pkgdir}"/usr/bin/cllualatex
320     ln -s cluttex "${pkgdir}"/usr/bin/clxelatex
321     ln -s epstopdf "${pkgdir}"/usr/bin/repstopdf
322     ln -s fmtutil "${pkgdir}"/usr/bin/mktexfmt
323     ln -s kpsetool "${pkgdir}"/usr/bin/kpsepath
324     ln -s kpsetool "${pkgdir}"/usr/bin/kpsexpand
325     ln -s luaotfload-tool "${pkgdir}"/usr/bin/mkluatexfontdb
326     ln -s mktexlsr "${pkgdir}"/usr/bin/texhash
327     ln -s pdfcrop "${pkgdir}"/usr/bin/rpdfcrop
328     ln -s texdef "${pkgdir}"/usr/bin/latexdef