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