archrelease: copy trunk to extra-x86_64
[arch-packages.git] / texlive-bin / trunk / PKGBUILD
blobe645e10b56caa2796fb9c82ac6b0d3f009d0c243
1 # Maintainer: Rémy Oudompheng <remy@archlinux.org>
2 # Contributor: francois <francois.archlinux.org>
4 pkgname=('texlive-bin' 'libsynctex')
5 pkgver=2023.66539
6 pkgrel=1
7 license=('GPL')
8 arch=('x86_64')
9 makedepends=('git' 'cairo' 'pixman' 'graphite' 't1lib' 'gd'
10          'libsigsegv' 'zziplib' 'libpng' 'libjpeg' 'freetype2'
11          'icu' 'harfbuzz' 'harfbuzz-icu' 'gmp' 'mpfr' 'potrace' 'libpaper'
12          'perl' 'clisp' 'ffcall' 'libxcrypt')
13 url='https://tug.org/texlive/'
14 _commit=0d0bb3a2401e8825b4987eee51e8ef469eb8c3fc # tags/texlive-2023.0
15 source=("git+https://github.com/Tex-Live/texlive-source.git#commit=${_commit}"
16         "ptex-debug-print.patch")
17 sha256sums=('SKIP'
18             'aa838f09003c62c2efb5770a8de66f99b409df049fbd65098d80fd1957d06c50')
20 prepare() {
21     cd "$srcdir/texlive-source"
23     # bibtex-x needs kpathsea flags
24     sed -i '/AC_SEARCH_LIBS/a KPSE_KPATHSEA_FLAGS' texk/bibtex-x/configure.ac
25     (cd texk/bibtex-x && autoreconf)
26     # t4ht expects to be un /usr/share/texmf/bin/t4ht (FS#27251)
27     sed -i s/SELFAUTOPARENT/TEXMFROOT/ texk/tex4htk/t4ht.c
28     # remove spurious ptex "guessed encoding" print
29     patch -Np1 -i "${srcdir}/ptex-debug-print.patch"
32 build() {
33    cd "$srcdir/texlive-source"
35    #############################################################
36    ### configure
37    mkdir -p Work
38    cd Work
39    echo "--> Initial configuration..."
40    # we use temporary prefix to avoid messing the existing
41    # $pkgdir/usr/share/texmf tree
42    #
43    # Preset float endianness to avoid a crash in cairo configure
44    # with recent toolchains. We are not building cairo anyway.
45    ax_cv_c_float_words_bigendian=no \
46      ../configure --prefix=/usr -C \
47      --sysconfdir=/etc \
48      --datarootdir=/usr/share \
49      --datadir=/usr/share \
50      --mandir=/usr/share/man \
51      --disable-native-texlive-build \
52      --with-banner-add="/Arch Linux" \
53      --disable-multiplatform \
54      --disable-dialog \
55      --disable-psutils \
56      --disable-t1utils \
57      --disable-bibtexu \
58      --disable-xz \
59      --enable-shared \
60      --disable-static \
61      --with-system-zlib \
62      --with-system-zziplib \
63      --with-system-pnglib \
64      --with-system-ncurses \
65      --with-system-t1lib \
66      --with-system-gd \
67      --with-system-freetype2 \
68      --with-system-pixman \
69      --with-system-cairo \
70      --with-system-harfbuzz \
71      --with-system-graphite \
72      --with-system-icu \
73      --with-system-gmp \
74      --with-system-mpfr \
75      --with-system-potrace \
76      --with-system-libpaper \
77      --with-freetype2-libdir=/usr/lib \
78      --with-freetype2-include=/usr/include/freetype2 \
79      --with-xdvi-x-toolkit=xaw \
80      --disable-dump-share \
81      --disable-aleph \
82      --enable-luatex \
83      --with-clisp-runtime=default \
84      --enable-xindy --disable-xindy-rules --disable-xindy-docs
85    #############################################################
86    ### make
87    echo "-------------------------------------------------------"
88    echo "--> Building the whole beast ..."
89    echo "-------------------------------------------------------"
90    make
93 package_libsynctex() {
94     pkgdesc='Library for synchronization between TeX files and resulting file'
95     depends=('glibc' 'zlib')
97     cd "${srcdir}/texlive-source/Work"
98     make -C texk/web2c DESTDIR="${pkgdir}" \
99         install-data-am install-libLTLIBRARIES
101     rm -f "$pkgdir"/usr/share/man/man1/hi*.*
104 package_texlive-bin() {
105    pkgdesc="TeX Live binaries"
106    depends=('cairo' 'pixman' 'graphite' 't1lib' 'gd' 'poppler' 'ffcall'
107             'libsigsegv' 'zziplib' 'libpng' 'libjpeg' 'freetype2' 'libxcrypt'
108             'icu' 'harfbuzz' 'harfbuzz-icu' 'gmp' 'mpfr' 'potrace' 'libpaper'
109             'libsynctex')
110    provides=('lcdf-typetools' 'kpathsea' 'xindy')
111    optdepends=('ed: for texconfig'
112                'biber: for bibliography processing')
114    cd "$srcdir/texlive-source"
116    #############################################################
117    ### install
118    # fixes for xindy
119    find utils/xindy -name Makefile -exec sed -i -e "s|^prefix =.\+$|prefix = $pkgdir/usr|" -e "s|^mandir =.\+$|mandir = \${prefix}/share/man|" -e "s|^datadir =.\+$|datadir = \${datarootdir}/texmf|" -e "s|^docdir =.\+$|docdir = \${datadir}/doc/xindy|" '{}' \;
121    echo "-------------------------------------------------------"
122    echo "--> Proceeding with make install ..."
123    echo "-------------------------------------------------------"
124    cd Work
125    make DESTDIR="${pkgdir}" texmf="$pkgdir"/usr/share/texmf install
126    rm -rf "${pkgdir}"/usr/{texmf,share/texmf-dist}
128    ## symlink engines by hand. texlinks has moved to texlive-core...
129    mkdir -p "${pkgdir}"/usr/bin
130    ln -s eptex "${pkgdir}"/usr/bin/platex
131    ln -s euptex "${pkgdir}"/usr/bin/uplatex
132    ln -s luatex "${pkgdir}"/usr/bin/dvilualatex
133    ln -s luatex "${pkgdir}"/usr/bin/dviluatex
134    ln -s luahbtex "${pkgdir}"/usr/bin/lualatex
135    ln -s pdftex "${pkgdir}"/usr/bin/amstex
136    ln -s pdftex "${pkgdir}"/usr/bin/cslatex
137    ln -s pdftex "${pkgdir}"/usr/bin/csplain
138    ln -s pdftex "${pkgdir}"/usr/bin/eplain
139    ln -s pdftex "${pkgdir}"/usr/bin/etex
140    ln -s pdftex "${pkgdir}"/usr/bin/jadetex
141    ln -s pdftex "${pkgdir}"/usr/bin/latex
142    ln -s tex "${pkgdir}"/usr/bin/lollipop
143    ln -s pdftex "${pkgdir}"/usr/bin/mex
144    ln -s pdftex "${pkgdir}"/usr/bin/mllatex
145    ln -s pdftex "${pkgdir}"/usr/bin/mltex
146    ln -s pdftex "${pkgdir}"/usr/bin/pdfetex
147    ln -s pdftex "${pkgdir}"/usr/bin/pdfcslatex
148    ln -s pdftex "${pkgdir}"/usr/bin/pdfcsplain
149    ln -s pdftex "${pkgdir}"/usr/bin/pdfjadetex
150    ln -s pdftex "${pkgdir}"/usr/bin/pdflatex
151    ln -s pdftex "${pkgdir}"/usr/bin/pdfmex
152    ln -s pdftex "${pkgdir}"/usr/bin/pdfxmltex
153    ln -s pdftex "${pkgdir}"/usr/bin/texsis
154    ln -s pdftex "${pkgdir}"/usr/bin/utf8mex
155    ln -s pdftex "${pkgdir}"/usr/bin/xmltex
156    ln -s xetex "${pkgdir}"/usr/bin/xelatex
158    #############################################################
159    # remove dangling symlinks
160    _bibtexextra_scripts="
161 bbl2bib
162 bib2gls
163 bibcop
164 bibdoiadd
165 bibexport
166 bibmradd
167 biburl2doi
168 bibzbladd
169 citeproc-lua
170 convertgls2bib
171 listbib
172 ltx2crossrefxml
173 multibibliography
174 urlbst
176    _core_scripts="
177 a2ping
178 a5toa4
179 adhocfilelist
180 afm2afm
181 albatross
182 allcm
183 allec
184 allneeded
185 arara
186 arlatex
187 autoinst
188 bundledoc
189 checkcites
190 checklistings
191 chklref
192 chkweb
193 cjk-gs-integrate
194 cluttex
195 cllualatex
196 clxelatex
197 ctanbib
198 ctanify
199 ctanupload
200 ctan-o-mat
201 de-macro
202 depythontex
203 deweb
204 digestif
205 dosepsbin
206 dtxgen
207 dvi2fax
208 dviasm
209 dviinfox
210 dvired
211 e2pall
212 epstopdf
213 findhyph
214 fmtutil
215 fmtutil-sys
216 fmtutil-user
217 fontinst
218 fragmaster
219 git-latexdiff
221 htcontext
222 htlatex
223 htmex
224 httex
225 httexi
226 htxelatex
227 htxetex
228 installfont-tl
229 jfmutil
230 ketcindy
231 kpsepath
232 kpsetool
233 kpsewhere
234 kpsexpand
235 latex-git-log
236 latex-papersize
237 latex2man
238 latex2nemeth
239 latexdef
240 latexdiff
241 latexdiff-vc
242 latexfileversion
243 latexindent
244 latexmk
245 latexpand
246 latexrevise
247 listings-ext.sh
248 llmk
249 ltxfileinfo
250 ltximg
251 luafindfont
252 luaotfload-tool
253 lwarpmk
254 make4ht
255 match_parens
256 mf2pt1
257 mk4ht
258 mkjobtexmf
259 mkt1font
260 mktexfmt
261 mktexlsr
262 mktexmf
263 mktexpk
264 mktextfm
265 mptopdf
266 optexcount
267 ot2kpx
268 pamphletangler
269 pdfatfi
270 pdfbook2
271 pdfcrop
272 pdfjam
273 pdflatexpicscale
274 pdftex-quiet
275 pdfxup
276 pfarrei
277 pkfix
278 pkfix-helper
279 ps2eps
280 ps2frag
281 pslatex
282 purifyeps
283 pythontex
284 repstopdf
285 rpdfcrop
286 rungs
287 simpdftex
288 spix
289 srcredact
290 sty2dtx
291 tex4ebook
292 texaccents
293 texconfig
294 texconfig-dialog
295 texconfig-sys
296 texcount
297 texdef
298 texdiff
299 texdirflatten
300 texdoc
301 texdoctk
302 texfot
303 texhash
304 texindy
305 texlinks
306 texliveonfly
307 texloganalyser
308 texlogfilter
309 texlogsieve
310 texosquery
311 texosquery-jre5
312 texosquery-jre8
313 texplate
314 thumbpdf
315 tlcockpit
316 tlshell
317 typeoutfileinfo
318 updmap
319 updmap-sys
320 updmap-user
321 vpl2ovp
322 vpl2vpl
323 xelatex-unsafe
324 xetex-unsafe
325 xhlatex
326 xindex
327 xindy
329    _games_scripts="rubikrotation"
330    _humanities_scripts="diadia"
331    _langcyrillic_scripts="rubibtex rumakeindex"
332    _langextra_scripts="ebong"
333    _langgreek_scripts="mkgrkindex"
334    _langjapanese_scripts="convbkmk ptex2pdf
335 kanji-fontmap-creator
336 kanji-config-updmap
337 kanji-config-updmap-sys
338 kanji-config-updmap-user
340    _langkorean_scripts="jamo-normalize komkindex ttf2kotexfont"
341    _latexextra_scripts="
342 authorindex
343 exceltex
344 hyperxmp-add-bytecount
345 l3build
346 makedtx
347 makeglossaries
348 makeglossaries-lite
349 pagelayoutapi
350 pdfannotextractor
351 perltex
352 ps4pdf
353 splitindex
354 svn-multi
355 textestvis
357 webquiz
358 wordcount
359 yplan"
360    _music_scripts="lily-glyph-commands lily-image-commands lily-rebuild-pdfs
361 m-tx
362 musixtex
363 musixflx
364 pmxchords"
365    _pictures_scripts="
366 cachepic
367 epspdf
368 epspdftk
369 fig4latex
370 getmapdl
371 mathspic
372 mkpic
373 pn2pdf
374 tikztosvg"
375    _pstricks_scripts="pedigree pst2pdf"
376    _science_scripts="pygmentex ulqda"
377    for s in \
378         ${_bibtexextra_scripts} \
379         ${_core_scripts}        \
380         ${_games_scripts}       \
381         ${_htmlxml_scripts}     \
382         ${_humanities_scripts}   \
383         ${_langcyrillic_scripts} \
384         ${_langextra_scripts}    \
385         ${_langgreek_scripts}    \
386         ${_langjapanese_scripts} \
387         ${_langkorean_scripts} \
388         ${_latexextra_scripts} \
389         ${_music_scripts}      \
390         ${_pictures_scripts}   \
391         ${_pstricks_scripts}   \
392         ${_science_scripts}    \
393         tlmgr; do
394        ! readlink -e "$pkgdir"/usr/bin/$s && rm "$pkgdir"/usr/bin/$s
395        if [[ -f "$pkgdir/usr/share/man/man1/${s%.*}.1" ]]; then
396            rm -vf "$pkgdir/usr/share/man/man1/${s%.*}.1"
397        fi
398    done
399    ###################################################################
401    # Install old ConTeXt stubs
402    cd "$srcdir/texlive-source"
403    for stub in context contextjit luatools mtxrun mtxrunjit texexec texmfstart; do
404        install -m755 texk/texlive/linked_scripts/context/stubs/unix/"$stub" "$pkgdir/usr/bin/$stub"
405    done
407    # remove libsynctex
408    rm -f "$pkgdir"/usr/include/synctex/*
409    rm -f "$pkgdir"/usr/lib/libsynctex.*
410    rm -f "$pkgdir"/usr/lib/pkgconfig/synctex.pc
411    rm -f "$pkgdir"/usr/share/man/man*/synctex.*