summaryrefslogtreecommitdiff
path: root/libre/texlive-core/PKGBUILD
blob: 04b033025cf12ff16a35b0f4ff6531247229fe36 (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
# Maintainer (Arch): Rémy Oudompheng <remy@archlinux.org>
# Contributor (Hyperbola): André Silva <emulatorman@hyperbola.info>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: Michał Masłowski <mtjm@mtjm.eu>
# Contributor: Isaac David <isacdaavid@at@isacdaavid@dot@info>

_pkgname=texlive-core-libre
pkgname=texlive-core
pkgver=2020.55416
_revnr=${pkgver#2020.}
pkgrel=1
pkgrel+=.par1
pkgdesc="TeX Live core distribution"
pkgdesc+=", without nonfree add-on packages (Parabola rebranded)"
license=('GPL')
arch=(any)
depends=('texlive-bin' 'perl')
optdepends=(
  'dialog:      for texconfig'
  'ghostscript: for epstopdf, epspdf and other ConTeXt tools' 
  'java-runtime: for utilities like arara, texplate'
  'perl-tk:     for texdoctk'
  'psutils:     to manipulate the output of dvips'
  'python:      for pythontex'
  'python2:     for dviasm'
  'ruby:        for old ConTeXT MkII and epspdf'
  't1utils:     can be useful when installing Type1 fonts'
)
groups=('texlive-most')
conflicts=('tetex' 'texlive-latex3' 'pdfjam'
           'texlive-genericextra'
           'texlive-plainextra')
provides=('tetex' 'texlive-latex3' 'pdfjam'
          'texlive-genericextra'
          'texlive-plainextra')
replaces=('tetex' 'texlive-latex3' 'pdfjam'
          'texlive-genericextra'
          'texlive-plainextra')
url='http://tug.org/texlive/'
mksource=("https://sources.archlinux.org/other/texlive/$pkgname-$pkgver-src.zip")
mksha256sums=('8e025c2dfa4e19dcb6aa5e661874d2c2a158aa2e1a078c11a4ddd6347bd9db45')
noextract=("$pkgname-$pkgver-src.zip")
source=("https://repo.parabola.nu/other/$_pkgname/$_pkgname-$pkgver-src.tar.xz"{,.sig}
        "$pkgname.maps"
        "$pkgname.fmts"
        "mktexlsr.hook"
        "mktexlsr.script"
        "texlive-updmap.hook"
        "texlive-updmap.script"
        "texlive-fmtutil.hook"
        "texlive-fmtutil.script"
        "texmf.cnf"
        "texmfcnf.lua"
        "09-texlive-fonts.conf")
install=texlive.install
backup=(etc/texmf/web2c/texmf.cnf \
        etc/texmf/chktex/chktexrc \
	etc/texmf/dvipdfmx/dvipdfmx.cfg \
	etc/texmf/dvips/config/config.ps \
	etc/texmf/tex/generic/config/language.dat \
	etc/texmf/tex/generic/config/language.def \
	etc/texmf/tex/generic/tex-ini-files/pdftexconfig.tex \
	etc/texmf/ttf2pk/ttf2pk.cfg \
	etc/texmf/web2c/fmtutil.cnf \
	etc/texmf/web2c/mktex.cnf \
	etc/texmf/xdvi/XDvi)
sha256sums=('fd5c0d7a604ba0a0dbf06203f9ec68ae2d2e5cfdd43b1faeb6eb29960c593393'
            'SKIP'
            '275253728d884b2b75e01840b0824c1fe5afbdda91fafeacd33deb6cd92341a3'
            '09cbe0717c53078d30bdc378322f82e673dafbe7cf76a11e0a3c6dd54dcdfea3'
            'c76f01fe2a42e5860f7d0b2f16a4fc09101e1a14ea7488985e914cda749f1a21'
            '05afeae62a5d4c9de79c838c9636e2aefe9ad1d6b787fed4e5930c13baf60eba'
            '2141c0842668fb937fd21ca2fae39b642c9665656e404a0d4ee7bdc477bf51fe'
            'ee6e76192a5ad880a2152cd7900b86c8465239fb228045a2f8360b0d7a449f4a'
            'b641550fe7727422b6964d505db7dbc35b3680a9d47b8d97ac550828bdb9bac7'
            'f96e9f815fa0a4b85e677f2a9215d9106b8abe46eceb3f3e36a6c76eda3e4a85'
            'df669d731c0cb14d7702c0bd9228d35a2da2c941a684313ec11c9ed00ae1fb25'
            '0b6c3ee516608ce04d7133db52cadfa1be5d885b3f82bb39dc5897b213847e0d'
            '5e79c40cf3ab93348fc89e97890198601767ea2c8fea89ea76088c17a2b35962')
validpgpkeys=('1B8C5E87702444D3D825CC8086ED62396D5DBA58'  # Omar Vega Ramos
              '38D33EF29A7691134357648733466E12EC7BA943'  # Isaac David
              '3954A7AB837D0EA9CFA9798925DB7D9B5A8D4B40') # bill-auger


mksource() {
   mkdir $pkgname-$pkgver
   pushd $pkgname-$pkgver
   bsdtar xfv ../$pkgname-$pkgver-src.zip

   # remove nonfree packages
   # MeX licensed packages
   rm -v {cc-pl,cs,ec,mex,pl}.tar.xz
   # public domain, will be relicensed
   rm -v context-{account,algorithmic,letter,ruby}.tar.xz
   # no specific free license
   rm -v euro-ce.tar.xz

   popd
}

prepare() {
   cd "$srcdir/$pkgname-$pkgver"
   echo -n "   --> extracting all packages... "
   for p in *.tar.xz; do 
     bsdtar -xf $p
   done
   echo "done"
   rm -rf source doc

   # remove nonfree packages references from updmap.cfg
   sed -i '/ccpl.map/d'       texmf-dist/web2c/updmap.cfg
   sed -i '/cs-charter.map/d' texmf-dist/web2c/updmap.cfg
   sed -i '/csfonts.map/d'    texmf-dist/web2c/updmap.cfg
   sed -i '/plother.map/d'    texmf-dist/web2c/updmap.cfg
   sed -i '/pltext.map/d'     texmf-dist/web2c/updmap.cfg

   # remove nonfree packages references from texlive-core.maps
   sed -i '/ccpl.map/d'       $srcdir/$pkgname.maps
   sed -i '/cs-charter.map/d' $srcdir/$pkgname.maps
   sed -i '/csfonts.map/d'    $srcdir/$pkgname.maps
   sed -i '/plother.map/d'    $srcdir/$pkgname.maps
   sed -i '/pltext.map/d'     $srcdir/$pkgname.maps

   # remove nonfree packages references from fmtutil.cnf
   sed -i '/cslatex/d'     texmf-dist/web2c/fmtutil.cnf
   sed -i '/csplain/d'     texmf-dist/web2c/fmtutil.cnf
   sed -i '/from mex/d'    texmf-dist/web2c/fmtutil.cnf
   sed -i '/mexconf.tex/d' texmf-dist/web2c/fmtutil.cnf

   # remove nonfree packages references from package list
   sed -ri '/^(cc-pl|cs|ec|mex|pl|context-(account|algorithmic|fixme|games|letter|ruby)|euro-ce) /d' CONTENTS
}

package() {
   cd "$srcdir/$pkgname-$pkgver"

   # Install packages.
   install -m755 -d "$pkgdir"/var/lib/texmf/arch/installedpkgs
   sed -i '/^#/d' CONTENTS
   install -m644 CONTENTS "$pkgdir"/var/lib/texmf/arch/installedpkgs/${pkgname}_${_revnr}.pkgs
   install -m644 "$srcdir"/$pkgname.maps "$pkgdir"/var/lib/texmf/arch/installedpkgs/
   install -m644 "$srcdir"/$pkgname.fmts "$pkgdir"/var/lib/texmf/arch/installedpkgs/
   install -m755 -d "$pkgdir"/usr/share
   wanteddirs=$(for d in *; do test -d $d && [[ $d != texmf* ]] && echo $d; done) || true
   for dir in $wanteddirs; do
     find $dir -type d -exec install -d -m755 "$pkgdir"/usr/share/texmf-dist/'{}' \;
     find $dir -type f -exec install -m644 '{}' "$pkgdir"/usr/share/texmf-dist/'{}' \;
   done
   find texmf-dist -type d -exec install -d -m755 "$pkgdir"/usr/share/'{}' \;
   find texmf-dist -type f -exec install -m644 '{}' "$pkgdir"/usr/share/'{}' \;
   find texmf-dist -type f -executable -exec chmod 755 "$pkgdir"/usr/share/'{}' \;
 
   #############################################################
   ### install texmf tree
   echo "--> installing the /etc/texmf tree"
   install -d -m755 "$pkgdir"/etc/texmf/web2c
   install -d -m755 "$pkgdir"/etc/texmf/chktex
   install -d -m755 "$pkgdir"/etc/texmf/dvips/config
   install -d -m755 "$pkgdir"/etc/texmf/dvipdfmx
   install -d -m755 "$pkgdir"/etc/texmf/tex/generic/config
   install -d -m755 "$pkgdir"/etc/texmf/tex/generic/tex-ini-files
   install -d -m755 "$pkgdir"/etc/texmf/ttf2pk
   install -d -m755 "$pkgdir"/etc/texmf/xdvi
   install -d -m755 "$pkgdir"/etc/fonts/conf.avail
   install -m644 "$srcdir"/09-texlive-fonts.conf "$pkgdir"/etc/fonts/conf.avail/

   # Remove manpages (already in texlive-bin).
   rm -rf "$pkgdir"/usr/share/texmf-dist/doc/man

   # copy config files to $TEXMFCONFIG tree
   cp -a "$pkgdir"/usr/share/texmf-dist/chktex/chktexrc \
     	"$pkgdir"/etc/texmf/chktex/
   cp -a "$pkgdir"/usr/share/texmf-dist/web2c/mktex.cnf \
   	  "$pkgdir"/etc/texmf/web2c/
   cp -a "$pkgdir"/usr/share/texmf-dist/web2c/updmap-hdr.cfg \
   	  "$pkgdir"/etc/texmf/web2c/
   cp -a "$pkgdir"/usr/share/texmf-dist/web2c/fmtutil-hdr.cnf \
   	  "$pkgdir"/etc/texmf/web2c/fmtutil.cnf
   cp -a "$pkgdir"/usr/share/texmf-dist/dvips/config/config.ps \
   	  "$pkgdir"/etc/texmf/dvips/config/
   cp -a "$pkgdir"/usr/share/texmf-dist/dvipdfmx/dvipdfmx.cfg \
   	  "$pkgdir"/etc/texmf/dvipdfmx/
   cp -a "$pkgdir"/usr/share/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex \
   	  "$pkgdir"/etc/texmf/tex/generic/tex-ini-files/
   cp -a "$pkgdir"/usr/share/texmf-dist/tex/generic/config/language.dat \
   	  "$pkgdir"/etc/texmf/tex/generic/config/
   cp -a "$pkgdir"/usr/share/texmf-dist/tex/generic/config/language.def \
   	  "$pkgdir"/etc/texmf/tex/generic/config/
   cp -a "$pkgdir"/usr/share/texmf-dist/ttf2pk/ttf2pk.cfg \
   	  "$pkgdir"/etc/texmf/ttf2pk/
   cp -a "$pkgdir"/usr/share/texmf-dist/xdvi/XDvi \
   	  "$pkgdir"/etc/texmf/xdvi/
   # remove TL specific warnings in the language.{dat,def} files:
   sed -i -e '/DO NOT EDIT/,+3 d' "$pkgdir"/etc/texmf/tex/generic/config/language.*

   # replace upstream texmf.cnf with ours
   rm -f "$pkgdir"/usr/share/texmf-dist/web2c/texmf.cnf
   install -m644 "$srcdir"/texmf.cnf "$pkgdir"/etc/texmf/web2c/texmf.cnf
   # since the location of texmf.cnf is hard-wired to be under /usr/share/texmf/web2c
   # we make a symlink from /etc/texmf/web2c/texmf.cnf to the latter
   ln -sf /etc/texmf/web2c/texmf.cnf "$pkgdir"/usr/share/texmf-dist/web2c/texmf.cnf
   # replace upstream texmfcnf.lua with ours
   install -m644 "$srcdir"/texmfcnf.lua "$pkgdir"/usr/share/texmf-dist/web2c/texmfcnf.lua

   # use python2 instead of python for scripts.
   sed -i '1s/python/python2/' "$pkgdir"/usr/share/texmf-dist/scripts/de-macro/de-macro

   # install Perl libraries
   mv "$pkgdir"/usr/share/texmf-dist/tlpkg "$pkgdir"/usr/share
   rm -rf "$pkgdir"/usr/share/tlpkg/tlpobj

   ## install pacman hooks
   install -D -m644 ${srcdir}/mktexlsr.hook "$pkgdir/usr/share/libalpm/hooks/mktexlsr.hook"
   install -D -m644 ${srcdir}/texlive-updmap.hook "$pkgdir/usr/share/libalpm/hooks/texlive-updmap.hook"
   install -D -m644 ${srcdir}/texlive-fmtutil.hook "$pkgdir/usr/share/libalpm/hooks/texlive-fmtutil.hook"
   install -D -m755 ${srcdir}/mktexlsr.script "$pkgdir/usr/share/libalpm/scripts/mktexlsr"
   install -D -m755 ${srcdir}/texlive-updmap.script "$pkgdir/usr/share/libalpm/scripts/texlive-updmap"
   install -D -m755 ${srcdir}/texlive-fmtutil.script "$pkgdir/usr/share/libalpm/scripts/texlive-fmtutil"
  
   # remove upstream updmap.cfg: it contains too many maps.
   rm "${pkgdir}/usr/share/texmf-dist/web2c/updmap.cfg"
   # remove upstream fmtutil.cnf: it will be autogenerated
   rm "${pkgdir}/usr/share/texmf-dist/web2c/fmtutil.cnf"
 
   # more cleanup
   rm -rf "$pkgdir/usr/share/texmf-dist/scripts/context/stubs/mswin/"

    # link programs from /usr/share/texmf-dist/scripts
    _linked_scripts="
a2ping/a2ping.pl
accfonts/mkt1font
accfonts/vpl2ovp
accfonts/vpl2vpl
adhocfilelist/adhocfilelist.sh
arara/arara.sh
attachfile2/pdfatfi.pl
bundledoc/arlatex
bundledoc/bundledoc
checkcites/checkcites.lua
checklistings/checklistings.sh
chklref/chklref.pl
chktex/chkweb.sh
chktex/deweb.pl
cjk-gs-integrate/cjk-gs-integrate.pl
clojure-pamphlet/pamphletangler
cluttex/cluttex.lua
context/perl/mptopdf.pl
context/stubs/unix/context
context/stubs/unix/contextjit
context/stubs/unix/luatools
context/stubs/unix/mtxrun
context/stubs/unix/mtxrunjit
context/stubs/unix/texexec
context/stubs/unix/texmfstart
ctan-o-mat/ctan-o-mat.pl
ctanbib/ctanbib
ctanify/ctanify
ctanupload/ctanupload.pl
de-macro/de-macro
dosepsbin/dosepsbin.pl
dtxgen/dtxgen
dviasm/dviasm.py
dviinfox/dviinfox.pl
epstopdf/epstopdf.pl
findhyph/findhyph
fontools/afm2afm
fontools/autoinst
fontools/ot2kpx
fragmaster/fragmaster.pl
installfont/installfont-tl
jfmutil/jfmutil.pl
ketcindy/ketcindy.sh
latex-git-log/latex-git-log
latex-papersize/latex-papersize.py
latex2man/latex2man
latex2nemeth/latex2nemeth
latexdiff/latexdiff-vc.pl
latexdiff/latexdiff.pl
latexdiff/latexrevise.pl
latexfileversion/latexfileversion
latexindent/latexindent.pl
latexmk/latexmk.pl
latexpand/latexpand
ltxfileinfo/ltxfileinfo
ltximg/ltximg.pl
luaotfload/luaotfload-tool.lua
lwarp/lwarpmk.lua
make4ht/make4ht
match_parens/match_parens
mf2pt1/mf2pt1.pl
mkjobtexmf/mkjobtexmf.pl
pdfbook2/pdfbook2
pdfcrop/pdfcrop.pl
pdfjam/pdfjam
pdflatexpicscale/pdflatexpicscale.pl
pdftex-quiet/pdftex-quiet
pdfxup/pdfxup
pfarrei/a5toa4.tlu
pfarrei/pfarrei.tlu
pkfix-helper/pkfix-helper
pkfix/pkfix.pl
ps2eps/ps2eps.pl
purifyeps/purifyeps
pythontex/depythontex.py
pythontex/pythontex.py
simpdftex/simpdftex
srcredact/srcredact.pl
sty2dtx/sty2dtx.pl
tex4ebook/tex4ebook
tex4ht/ht.sh
tex4ht/htcontext.sh
tex4ht/htlatex.sh
tex4ht/htmex.sh
tex4ht/httex.sh
tex4ht/httexi.sh
tex4ht/htxelatex.sh
tex4ht/htxetex.sh
tex4ht/mk4ht.pl
tex4ht/xhlatex.sh
texcount/texcount.pl
texdef/texdef.pl
texdiff/texdiff
texdirflatten/texdirflatten
texdoc/texdoc.tlu
texdoctk/texdoctk.pl
texfot/texfot.pl
texlive-extra/allcm.sh
texlive-extra/allneeded.sh
texlive-extra/dvi2fax.sh
texlive-extra/dvired.sh
texlive-extra/e2pall.pl
texlive-extra/fontinst.sh
texlive-extra/kpsetool.sh
texlive-extra/kpsewhere.sh
texlive-extra/ps2frag.sh
texlive-extra/pslatex.sh
texlive-extra/texconfig-dialog.sh
texlive-extra/texconfig-sys.sh
texlive-extra/texconfig.sh
texlive-extra/texlinks.sh
texlive/fmtutil-sys.sh
texlive/fmtutil-user.sh
texlive/fmtutil.pl
texlive/mktexlsr
texlive/mktexmf
texlive/mktexpk
texlive/mktextfm
texlive/rungs.tlu
texlive/updmap-sys.sh
texlive/updmap-user.sh
texlive/updmap.pl
texliveonfly/texliveonfly.py
texloganalyser/texloganalyser
texplate/texplate.sh
thumbpdf/thumbpdf.pl
typeoutfileinfo/typeoutfileinfo.sh
xindex/xindex.lua
xindy/texindy.pl
xindy/xindy.pl
"
    install -m755 -d "$pkgdir/usr/bin"
    for _script in ${_linked_scripts}; do
        _scriptbase=$(basename $_script)
        _scriptbase=${_scriptbase%.*}
        ln -s /usr/share/texmf-dist/scripts/${_script} "${pkgdir}/usr/bin/${_scriptbase}"
    done
    ln -s /usr/share/texmf-dist/scripts/listings-ext/listings-ext.sh "${pkgdir}/usr/bin/listings-ext.sh"

    # additional symlinks
    ln -s allcm "${pkgdir}"/usr/bin/allec
    ln -s cluttex "${pkgdir}"/usr/bin/cllualatex
    ln -s cluttex "${pkgdir}"/usr/bin/clxelatex
    ln -s epstopdf "${pkgdir}"/usr/bin/repstopdf
    ln -s fmtutil "${pkgdir}"/usr/bin/mktexfmt
    ln -s kpsetool "${pkgdir}"/usr/bin/kpsepath
    ln -s kpsetool "${pkgdir}"/usr/bin/kpsexpand
    ln -s luaotfload-tool "${pkgdir}"/usr/bin/mkluatexfontdb
    ln -s mktexlsr "${pkgdir}"/usr/bin/texhash
    ln -s pdfcrop "${pkgdir}"/usr/bin/rpdfcrop
    ln -s texdef "${pkgdir}"/usr/bin/latexdef
}