summaryrefslogtreecommitdiff
path: root/libre/texlive-bin/PKGBUILD
blob: 21dccc170d51bb5e692ac6928e36b57aa92eb0b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
# Maintainer (Arch): Rémy Oudompheng <remy@archlinux.org>
# Contributor (Arch): francois <francois.archlinux.org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: André Silva <emulatorman@hyperbola.info>
# Contributor: Michał Masłowski <mtjm@mtjm.eu>
# Contributor: Isaac David <isacdaavid(at)isacdaavid!info>
# Contributor: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>

# parabola changes and rationale:
#  - rebranded to parabola
#  - versioned dependencies to mitigate breakage from Arch's .so bumps
#  - diable xindy on armv7h

pkgname=('texlive-bin' 'libsynctex')
pkgver=2018.48691
pkgrel=9
pkgrel+=.par1
license=('GPL')
arch=('x86_64')
arch+=('i686' 'armv7h')
makedepends=('git' 'cairo' 'pixman' 'graphite' 't1lib' 'gd' 'poppler'
         'libsigsegv' 'zziplib' 'libpng' 'libjpeg' 'freetype2'
         'icu' 'harfbuzz' 'harfbuzz-icu' 'gmp' 'mpfr' 'potrace' 'libpaper'
         'perl' 'clisp' 'ffcall')
makedepends_i686=('pkgconf')
url='http://tug.org/texlive/'
_commit=f68b0992e13a2e155d71beb3e016ea4139023224  # texlive-2018.2
source=("git+https://github.com/Tex-Live/texlive-source.git#commit=${_commit}"
        "pdftex-poppler0.76.patch"
        "luatex-poppler-fixes.patch"
        "xetex-poppler-fixes.patch"
        "freetype-pkgconfig.patch"
        "synctex-missing-header.patch")
sha256sums=('SKIP'
            '0b4070f489edef771f308687d9e99cb54e8a442f0229767c6fda5515045cd797'
            '6daa9fb9991f34406a0620a7f9185776ce1ac601a9c66a537c4b90ce97c1ffc6'
            '7deb8bd50640b0f4ff9b4c11985fe6153906384b62cb9b5a3c4b52397fb941ca'
            'bed44f4ccda369410e90eac527cf44b8c1afda7d987ae521b4fd5edb425eef3e'
            'b6c81eb091b5910226e0359768edd178680debee56b63ab0a3753c3429c28ab0')

prepare() {
    cd "$srcdir/texlive-source"

    # Synctex "make install" misses synctex_version.h
    patch -Np1 -i "${srcdir}/synctex-missing-header.patch"

    # Freetype2 2.9.1 package no longer has freetype-config
    patch -Np1 -i "${srcdir}/freetype-pkgconfig.patch"

    ./reautoconf

    # t4ht expects to be un /usr/share/texmf/bin/t4ht (FS#27251)
    sed -i s/SELFAUTOPARENT/TEXMFROOT/ texk/tex4htk/t4ht.c

    # luatex switched from poppler to pplib in newer versions so
    # upstream fixes aren't available; hopefully this is correct
    patch -Np1 -i "${srcdir}/luatex-poppler-fixes.patch"
    find texk/web2c/luatexdir -type f -exec sed -i \
      -e 's|gTrue|true|g' \
      -e 's|gFalse|false|g' \
      -e 's|GBool|bool|g' \
      -e 's|getCString|c_str|g' \
      -e 's|Guint|unsigned int|g' \
      -e 's|Guchar|unsigned char|g' \
      {} +
    # xetex poppler compatibility
    patch -Np1 -i "${srcdir}/xetex-poppler-fixes.patch"
    # pdftex poppler compatibility (upstream patches)
    patch -Np1 -i "${srcdir}/pdftex-poppler0.76.patch"
    cp -pv texk/web2c/pdftexdir/pdftoepdf{-poppler0.76.0,}.cc
    cp -pv texk/web2c/pdftexdir/pdftosrc{-poppler0.76.0,}.cc
}

build() {
   cd "$srcdir/texlive-source"

   if [ "${CARCH}" = "armv7h" ]; then
     local config_xindy="--disable-xindy"
   else
     local config_xindy="--enable-xindy"
   fi

   #############################################################
   ### configure
   mkdir -p Work
   cd Work
   echo "--> Initial configuration..."
   # we use temporary prefix to avoid messing the existing
   # $pkgdir/usr/share/texmf tree
   ../configure --prefix=/usr -C \
     --sysconfdir=/etc \
     --datarootdir=/usr/share \
     --datadir=/usr/share \
     --mandir=/usr/share/man \
     --disable-native-texlive-build \
     --with-banner-add="/Parabola GNU/Linux-libre" \
     --disable-multiplatform \
     --disable-dialog \
     --disable-psutils \
     --disable-t1utils \
     --disable-bibtexu \
     --disable-xz \
     --enable-shared \
     --disable-static \
     --with-system-zlib \
     --with-system-zziplib \
     --with-system-pnglib \
     --with-system-ncurses \
     --with-system-t1lib \
     --with-system-gd \
     --with-system-poppler \
     --with-system-xpdf \
     --with-system-freetype2 \
     --with-system-pixman \
     --with-system-cairo \
     --with-system-harfbuzz \
     --with-system-graphite \
     --with-system-icu \
     --with-system-gmp \
     --with-system-mpfr \
     --with-system-potrace \
     --with-system-libpaper \
     --with-freetype2-libdir=/usr/lib \
     --with-freetype2-include=/usr/include/freetype2 \
     --with-xdvi-x-toolkit=xaw \
     --disable-dump-share \
     --disable-aleph \
     --enable-luatex \
     --with-clisp-runtime=default \
     $config_xindy --disable-xindy-rules --disable-xindy-docs
   #############################################################
   ### make
   echo "-------------------------------------------------------"
   echo "--> Building the whole beast ..."
   echo "-------------------------------------------------------"
   make
}

package_libsynctex() {
    pkgdesc='Library for synchronization between TeX files and resulting file'
    depends=('glibc' 'zlib')

    cd "${srcdir}/texlive-source/Work"
    make -C texk/web2c DESTDIR="${pkgdir}" \
        install-data-am install-libLTLIBRARIES
}

package_texlive-bin() {
   pkgdesc="TeX Live binaries"
   pkgdesc+=" (Parabola rebranded)"
   depends=('cairo' 'pixman' 'graphite' 't1lib' 'gd' 'poppler'
            'libsigsegv' 'zziplib' 'libpng' 'libjpeg' 'freetype2'
            'icu' 'harfbuzz' 'harfbuzz-icu' 'gmp' 'mpfr' 'potrace' 'libpaper'
            'libsynctex')
   provides=('lcdf-typetools' 'kpathsea' 'xindy')
   optdepends=('ed: for texconfig'
               'biber: for bibliography processing')
   options=('!strip')

  local _icu_ver
  _icu_ver=$(pacman -S --print-format='%v' icu)
  depends+=("icu>=${_icu_ver}" "icu<$((${_icu_ver%%.*} + 1))")
  local _poppler_ver
  _poppler_ver=$(pacman -S --print-format='%v' poppler)
  depends+=("poppler=${_poppler_ver}")

   cd "$srcdir/texlive-source"

   #############################################################
   ### install
   # fixes for xindy
   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|" '{}' \;

   echo "-------------------------------------------------------"
   echo "--> Proceeding with make install ..."
   echo "-------------------------------------------------------"
   cd Work
   make DESTDIR="${pkgdir}" texmf="$pkgdir"/usr/share/texmf install
   rm -rf "${pkgdir}"/usr/{texmf,share/texmf-dist}

   ## symlink engines by hand. texlinks has moved to texlive-core...
   mkdir -p ${pkgdir}/usr/bin
   ln -s eptex ${pkgdir}/usr/bin/platex
   ln -s euptex ${pkgdir}/usr/bin/uplatex
   ln -s luatex ${pkgdir}/usr/bin/dvilualatex
   ln -s luatex ${pkgdir}/usr/bin/dviluatex
   ln -s luatex ${pkgdir}/usr/bin/lualatex
   ln -s pdftex ${pkgdir}/usr/bin/amstex
   ln -s pdftex ${pkgdir}/usr/bin/cslatex
   ln -s pdftex ${pkgdir}/usr/bin/csplain
   ln -s pdftex ${pkgdir}/usr/bin/eplain
   ln -s pdftex ${pkgdir}/usr/bin/etex
   ln -s pdftex ${pkgdir}/usr/bin/jadetex
   ln -s pdftex ${pkgdir}/usr/bin/latex
   ln -s tex ${pkgdir}/usr/bin/lollipop
   ln -s pdftex ${pkgdir}/usr/bin/mex
   ln -s pdftex ${pkgdir}/usr/bin/mllatex
   ln -s pdftex ${pkgdir}/usr/bin/mltex
   ln -s pdftex ${pkgdir}/usr/bin/pdfetex
   ln -s pdftex ${pkgdir}/usr/bin/pdfcslatex
   ln -s pdftex ${pkgdir}/usr/bin/pdfcsplain
   ln -s pdftex ${pkgdir}/usr/bin/pdfjadetex
   ln -s pdftex ${pkgdir}/usr/bin/pdflatex
   ln -s pdftex ${pkgdir}/usr/bin/pdfmex
   ln -s pdftex ${pkgdir}/usr/bin/pdfxmltex
   ln -s pdftex ${pkgdir}/usr/bin/texsis
   ln -s pdftex ${pkgdir}/usr/bin/utf8mex
   ln -s pdftex ${pkgdir}/usr/bin/xmltex
   ln -s xetex ${pkgdir}/usr/bin/xelatex

   #############################################################
   # remove dangling symlinks
   _bibtexextra_scripts="
bbl2bib
bib2gls
bibdoiadd
bibexport
bibmradd
biburl2doi
bibzbladd
convertgls2bib
listbib
ltx2crossrefxml
multibibliography
urlbst
"
   _core_scripts="
a2ping
a5toa4
adhocfilelist
afm2afm
allcm
allec
allneeded
arara
arlatex
autoinst
bundledoc
checkcites
checklistings
chkweb
cjk-gs-integrate
context
contextjit
ctanify
ctanupload
ctan-o-mat
de-macro
depythontex
deweb
dosepsbin
dtxgen
dvi2fax
dviasm
dviinfox
dvired
e2pall
epstopdf
findhyph
fmtutil
fmtutil-sys
fmtutil-user
fontinst
fragmaster
ht
htcontext
htlatex
htmex
httex
httexi
htxelatex
htxetex
installfont-tl
jfmutil
kpsepath
kpsetool
kpsewhere
kpsexpand
latex-git-log
latex-papersize
latex2man
latex2nemeth
latexdef
latexdiff
latexdiff-vc
latexfileversion
latexindent
latexmk
latexpand
latexrevise
listings-ext.sh
ltxfileinfo
ltximg
lua2dox_filter
luaotfload-tool
luatools
lwarpmk
make4ht
match_parens
mf2pt1
mk4ht
mkjobtexmf
mkt1font
mktexfmt
mptopdf
mtxrun
mtxrunjit
ot2kpx
pdf180
pdf270
pdf90
pdfatfi
pdfbook
pdfbook2
pdfcrop
pdfflip
pdfjam
pdfjam-pocketmod
pdfjam-slides3up
pdfjam-slides6up
pdfjoin
pdflatexpicscale
pdfnup
pdfpun
pdfxup
pfarrei
pkfix
pkfix-helper
ps2eps
ps2frag
pslatex
purifyeps
pythontex
repstopdf
rpdfcrop
rungs
simpdftex
srcredact
sty2dtx
tex4ebook
texconfig
texconfig-dialog
texconfig-sys
texcount
texdef
texdiff
texdirflatten
texdoc
texdoctk
texexec
texfot
texindy
texlinks
texliveonfly
texloganalyser
texmfstart
texosquery
texosquery-jre5
texosquery-jre8
thumbpdf
tlcockpit
tlshell
typeoutfileinfo
updmap
updmap-sys
updmap-user
vpl2ovp
vpl2vpl
xhlatex
xindy
"
   if [ "$CARCH" = "armv7h" ]; then
     _core_scripts="$(echo "$_core_scripts" | sed '/xindy$/d')"
   fi
   _games_scripts="rubikrotation"
   _humanities_scripts="diadia"
   _langcyrillic_scripts="rubibtex rumakeindex"
   _langextra_scripts="ebong"
   _langgreek_scripts="mkgrkindex"
   _langjapanese_scripts="convbkmk ptex2pdf
kanji-fontmap-creator
kanji-config-updmap
kanji-config-updmap-sys
kanji-config-updmap-user
"
   _langkorean_scripts="jamo-normalize komkindex ttf2kotexfont"
   _latexextra_scripts="
authorindex
exceltex
l3build
makedtx
makeglossaries
makeglossaries-lite
pdfannotextractor
perltex
ps4pdf
splitindex
svn-multi
vpe
wordcount
yplan"
   _music_scripts="lily-glyph-commands lily-image-commands lily-rebuild-pdfs
m-tx musixtex musixflx pmxchords"
   _pictures_scripts="
cachepic
epspdf
epspdftk
fig4latex
getmapdl
mathspic
mkpic
pn2pdf"
   _pstricks_scripts="pedigree pst2pdf"
   _science_scripts="pygmentex ulqda"
   for s in \
        ${_bibtexextra_scripts} \
        ${_core_scripts}        \
        ${_games_scripts}       \
        ${_htmlxml_scripts}     \
        ${_humanities_scripts}   \
        ${_langcyrillic_scripts} \
        ${_langextra_scripts}    \
        ${_langgreek_scripts}    \
        ${_langjapanese_scripts} \
        ${_langkorean_scripts} \
        ${_latexextra_scripts} \
        ${_music_scripts}      \
        ${_pictures_scripts}   \
        ${_pstricks_scripts}   \
        ${_science_scripts}    \
        tlmgr; do
       ! readlink -e "$pkgdir"/usr/bin/$s && rm "$pkgdir"/usr/bin/$s
   done
   ###################################################################

   # remove libsynctex
   rm -f "$pkgdir"/usr/include/synctex/*
   rm -f "$pkgdir"/usr/lib/libsynctex.*
   rm -f "$pkgdir"/usr/lib/pkgconfig/synctex.pc
   rm -f "$pkgdir"/usr/share/man/man*/synctex.*
}