archrelease: copy trunk to extra-x86_64
[arch-packages.git] / texlive-core / trunk / PKGBUILD
blobbbef789014ba164bec5594d0b877e259996e78e9
1 # Maintainer: Rémy Oudompheng <remy@archlinux.org>
3 pkgname=texlive-core
4 pkgver=2023.66587
5 _revnr=${pkgver#2023.}
6 pkgrel=2
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-2023.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=('2cdaf356d89351e61152243f1192a5e000a9586c67b873737f01878a3e5724ff'
60             'bbed1c20c91daca967e344505b9dd4e502569365709ce6b87be5510c2ebb98ef'
61             '7da46b34158b7fd997e494adaffdc5778617706680ba8124343d9973c2b1e965'
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     # texaccents is a SNOBOL program and will not be linked
178     _linked_scripts="
179 a2ping/a2ping.pl
180 accfonts/mkt1font
181 accfonts/vpl2ovp
182 accfonts/vpl2vpl
183 adhocfilelist/adhocfilelist.sh
184 albatross/albatross.sh
185 arara/arara.sh
186 attachfile2/pdfatfi.pl
187 bundledoc/arlatex
188 bundledoc/bundledoc
189 checkcites/checkcites.lua
190 checklistings/checklistings.sh
191 chklref/chklref.pl
192 chktex/chkweb.sh
193 chktex/deweb.pl
194 cjk-gs-integrate/cjk-gs-integrate.pl
195 clojure-pamphlet/pamphletangler
196 cluttex/cluttex.lua
197 context/perl/mptopdf.pl
198 ctan-o-mat/ctan-o-mat.pl
199 ctanbib/ctanbib
200 ctanify/ctanify
201 ctanupload/ctanupload.pl
202 de-macro/de-macro
203 dosepsbin/dosepsbin.pl
204 digestif/digestif.texlua
205 dtxgen/dtxgen
206 dviasm/dviasm.py
207 dviinfox/dviinfox.pl
208 epstopdf/epstopdf.pl
209 findhyph/findhyph
210 fontools/afm2afm
211 fontools/autoinst
212 fontools/ot2kpx
213 fragmaster/fragmaster.pl
214 git-latexdiff/git-latexdiff
215 installfont/installfont-tl
216 jfmutil/jfmutil.pl
217 ketcindy/ketcindy.sh
218 latex-git-log/latex-git-log
219 latex-papersize/latex-papersize.py
220 latex2man/latex2man
221 latex2nemeth/latex2nemeth
222 latexdiff/latexdiff-vc.pl
223 latexdiff/latexdiff.pl
224 latexdiff/latexrevise.pl
225 latexfileversion/latexfileversion
226 latexindent/latexindent.pl
227 latexmk/latexmk.pl
228 latexpand/latexpand
229 light-latex-make/llmk.lua
230 ltxfileinfo/ltxfileinfo
231 ltximg/ltximg.pl
232 luafindfont/luafindfont.lua
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 optexcount/optexcount
240 pdfbook2/pdfbook2
241 pdfcrop/pdfcrop.pl
242 pdfjam/pdfjam
243 pdflatexpicscale/pdflatexpicscale.pl
244 pdftex-quiet/pdftex-quiet
245 pdfxup/pdfxup
246 pfarrei/a5toa4.tlu
247 pfarrei/pfarrei.tlu
248 pkfix-helper/pkfix-helper
249 pkfix/pkfix.pl
250 ps2eps/ps2eps.pl
251 purifyeps/purifyeps
252 pythontex/depythontex.py
253 pythontex/pythontex.py
254 simpdftex/simpdftex
255 spix/spix.py
256 srcredact/srcredact.pl
257 sty2dtx/sty2dtx.pl
258 tex4ebook/tex4ebook
259 tex4ht/ht.sh
260 tex4ht/htcontext.sh
261 tex4ht/htlatex.sh
262 tex4ht/htmex.sh
263 tex4ht/httex.sh
264 tex4ht/httexi.sh
265 tex4ht/htxelatex.sh
266 tex4ht/htxetex.sh
267 tex4ht/mk4ht.pl
268 tex4ht/xhlatex.sh
269 texcount/texcount.pl
270 texdef/texdef.pl
271 texdiff/texdiff
272 texdirflatten/texdirflatten
273 texdoc/texdoc.tlu
274 texdoctk/texdoctk.pl
275 texfot/texfot.pl
276 texlive-extra/allcm.sh
277 texlive-extra/allneeded.sh
278 texlive-extra/dvi2fax.sh
279 texlive-extra/dvired.sh
280 texlive-extra/e2pall.pl
281 texlive-extra/fontinst.sh
282 texlive-extra/kpsetool.sh
283 texlive-extra/kpsewhere.sh
284 texlive-extra/ps2frag.sh
285 texlive-extra/pslatex.sh
286 texlive-extra/texconfig-dialog.sh
287 texlive-extra/texconfig-sys.sh
288 texlive-extra/texconfig.sh
289 texlive-extra/texlinks.sh
290 texlive-extra/xelatex-unsafe.sh
291 texlive-extra/xetex-unsafe.sh
292 texlive/fmtutil-sys.sh
293 texlive/fmtutil-user.sh
294 texlive/fmtutil.pl
295 texlive/mktexlsr
296 texlive/mktexmf
297 texlive/mktexpk
298 texlive/mktextfm
299 texlive/rungs.lua
300 texlive/updmap-sys.sh
301 texlive/updmap-user.sh
302 texlive/updmap.pl
303 texliveonfly/texliveonfly.py
304 texloganalyser/texloganalyser
305 texlogfilter/texlogfilter
306 texlogsieve/texlogsieve
307 texplate/texplate.sh
308 thumbpdf/thumbpdf.pl
309 typeoutfileinfo/typeoutfileinfo.sh
310 xindex/xindex.lua
311 xindy/texindy.pl
312 xindy/xindy.pl
314     install -m755 -d "$pkgdir/usr/bin"
315     install -m755 -d "$pkgdir/usr/share/man/man1"
316     for _script in ${_linked_scripts}; do
317         _scriptbase=$(basename $_script)
318         _scriptbase=${_scriptbase%.*}
319         ln -s /usr/share/texmf-dist/scripts/${_script} "${pkgdir}/usr/bin/${_scriptbase}"
320         if [[ -f "$srcdir/texlive-man/man1/${_scriptbase}.1" ]]; then
321             install -m644 "$srcdir/texlive-man/man1/${_scriptbase}.1" "${pkgdir}/usr/share/man/man1/"
322         fi
323     done
324     ln -s /usr/share/texmf-dist/scripts/listings-ext/listings-ext.sh "${pkgdir}/usr/bin/listings-ext.sh"
326     # additional symlinks
327     ln -s allcm "${pkgdir}"/usr/bin/allec
328     ln -s cluttex "${pkgdir}"/usr/bin/cllualatex
329     ln -s cluttex "${pkgdir}"/usr/bin/clxelatex
330     ln -s epstopdf "${pkgdir}"/usr/bin/repstopdf
331     ln -s fmtutil "${pkgdir}"/usr/bin/mktexfmt
332     ln -s kpsetool "${pkgdir}"/usr/bin/kpsepath
333     ln -s kpsetool "${pkgdir}"/usr/bin/kpsexpand
334     ln -s luaotfload-tool "${pkgdir}"/usr/bin/mkluatexfontdb
335     ln -s mktexlsr "${pkgdir}"/usr/bin/texhash
336     ln -s pdfcrop "${pkgdir}"/usr/bin/rpdfcrop
337     ln -s texdef "${pkgdir}"/usr/bin/latexdef
338     for _scriptbase in allec kpsepath kpsexpand mktexfmt texhash; do
339         install -m644 "$srcdir/texlive-man/man1/${_scriptbase}.1" "${pkgdir}/usr/share/man/man1/"
340     done