summaryrefslogtreecommitdiff
path: root/testing/texlive-bin/PKGBUILD
blob: 442882ad94f2355d5578e301ca5d9a7a02ab6b34 (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
# Maintainer: Rémy Oudompheng <remy@archlinux.org>
# Contributor: francois <francois.archlinux.org>

pkgname=texlive-bin
pkgver=2011.0
_luatex_ver=0.70.1
pkgrel=1
pkgdesc="TeX Live binaries"
license=('GPL')
arch=('i686' 'x86_64')
depends=('t1lib' 'gd' 'libgraphite' 'poppler' 'libsigsegv' 'zziplib')
makedepends=('perl' 'clisp' 'ffcall')
optdepends=('ed: for texconfig')
provides=('lcdf-typetools' 'kpathsea' 'xindy' 'pdfjam')
conflicts=('pdfjam')
options=('!libtool')
url='http://tug.org/texlive/'
install="texlive.install"
source=('texmf.cnf'
        'fix-fontforge-encoding.patch'
        '09-texlive-fonts.conf'
        'archlinux-build.patch'
        'http://mirrors.kernel.org/archlinux/other/texlive/texlive-bin-source-20110531.tar.xz'
        'http://mirrors.kernel.org/archlinux/other/texlive/texlive-bin-texmf-20110531.tar.xz'
        "http://foundry.supelec.fr/gf/download/frsrelease/392/1730/luatex-beta-${_luatex_ver}.tar.bz2"
)
backup=(etc/texmf/web2c/texmf.cnf \
  etc/texmf/chktex/chktexrc \
	etc/texmf/web2c/mktex.cnf \
	etc/texmf/web2c/updmap.cfg \
	etc/texmf/web2c/fmtutil.cnf \
	etc/texmf/tex/generic/config/language.dat \
	etc/texmf/tex/generic/config/language.def \
	etc/texmf/tex/generic/config/pdftexconfig.tex \
	etc/texmf/ttf2pk/ttf2pk.cfg \
	etc/texmf/dvips/config/config.ps \
	etc/texmf/dvipdfmx/dvipdfmx.cfg \
	etc/texmf/dvipdfm/config/config \
	etc/texmf/xdvi/XDvi)

md5sums=('ff30d6813babd2e41c414365eea9c147'
         'bfb9716aa00c86c08cd31e5b32edeb98'
         '393a4bf67adc7ca5df2b386759d1a637'
         '94ef5571a54262790ab64d6d044dd10c'
         'cd31edd460cdc3224281ccb30a4ea38d'
         'd6338f70c6b8acde6509076ead4b9f13'
         'c9348d4381170204b1a1b0440d8b6918')

build() {
   if [ "${CARCH}" = "x86_64" ]; then
     export CFLAGS="${CFLAGS} -fPIC"
     export CXXFLAGS="${CXXFLAGS} -fPIC"
   fi

   cd $srcdir
   # Building LuaTeX
   cd luatex-beta-${_luatex_ver}
   patch -p0 -i ../fix-fontforge-encoding.patch
  (cd source && ./texk/web2c/luatexdir/getluatexsvnversion.sh)
   mkdir build
   cd build
   ../source/configure --prefix=/usr -C \
     --disable-native-texlive-build \
     --with-banner-add="/Arch Linux" \
    --enable-cxx-runtime-hack \
    --disable-all-pkgs \
    --disable-dump-share \
    --disable-ptex \
    --enable-luatex  \
    --without-system-ptexenc \
    --with-system-graphite \
    --without-system-icu \
    --without-system-kpathsea \
    --with-system-freetype2 \
    --with-system-poppler \
    --with-freetype2-libdir=/usr/lib \
    --with-freetype2-include=/usr/include/freetype2 \
    --with-system-gd \
    --with-system-libpng \
    --without-system-teckit \
    --with-system-zlib \
    --with-system-zziplib \
    --with-system-t1lib \
    --disable-shared \
    --disable-largefile \
    --disable-ipc \
    --without-mf-x-toolkit \
    --without-x
   make
   make -C libs/obsdcompat
   make -C texk/kpathsea
   make -C texk/web2c luatex

   cd "$srcdir"
   # this patch removes spurious error message with locale "xx_YY.utf8"
   patch -p0 -i fix-fontforge-encoding.patch
   #############################################################
   ### configure
   cd source
   patch -Np1 -i ${srcdir}/archlinux-build.patch
   for _dir in texk/tetex texk/texlive texk/tex4htk \
       utils/ps2eps utils/chktex utils/psutils utils/xindy; do
       (cd ${_dir} && automake) || true
   done
   ## prevent compiling Xdvi with libXp
   sed -i~ 's|-lXp ||' texk/xdvik/configure
   test ! -d Work && mkdir Work
   cd Work
   echo "--> Initial configuration..."
   # we use temporary prefix to avoid messing the existing $pkgdir/usr/share/texmf tree
   ../configure --prefix=/usr -C \
     --datarootdir=/usr/share \
     --datadir=/usr/share \
     --mandir=/usr/share/man \
     --disable-native-texlive-build \
     --with-banner-add="/Arch Linux" \
     --disable-multiplatform \
     --disable-dialog \
     --disable-psutils \
     --disable-t1utils \
     --disable-bibtexu \
     --disable-xz \
     --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-graphite \
     --with-freetype2-libdir=/usr/lib \
     --with-freetype2-include=/usr/include/freetype2 \
     --with-xdvi-x-toolkit=xaw \
     --disable-dump-share \
     --disable-aleph \
     --disable-luatex \
     --with-clisp-runtime=default \
     --enable-xindy --disable-xindy-rules --disable-xindy-docs
   #############################################################
   ### make
   echo "-------------------------------------------------------"
   echo "--> Building the whole beast ..."
   echo "-------------------------------------------------------"
   make
}

package() {
   cd $srcdir
   #############################################################
   ### install texmf tree
   echo "-------------------------------------------------------"
   echo "--> installing the texmf tree"
   echo "-------------------------------------------------------"
   install -m755 -d $pkgdir/usr/share
   cp -r texmf $pkgdir/usr/share/
   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/dvipdfm/config
   install -d -m755 $pkgdir/etc/texmf/dvipdfmx
   install -d -m755 $pkgdir/etc/texmf/tex/generic/config
   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/
   # replace upstream texmf.cnf with ours
   rm -f $pkgdir/usr/share/texmf/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 -s /etc/texmf/web2c/texmf.cnf $pkgdir/usr/share/texmf/web2c/texmf.cnf
   # fix location of TEXMFCACHE for luatools
   sed -i 's#texlive2010#texlive#' $pkgdir/usr/share/texmf/web2c/texmfcnf.lua
   ## remove aleph from fmtutil.cnf
   sed -i -e '/aleph/d' $pkgdir/usr/share/texmf/web2c/fmtutil.cnf
   # move man files to /usr/share/man
   for i in 1 5; do
     install -d -m755 $pkgdir/usr/share/man/man$i
     mv $pkgdir/usr/share/texmf/doc/man/man$i/*.$i $pkgdir/usr/share/man/man$i/
   done
   # move info files to /usr/share/info
   install -d -m755 $pkgdir/usr/share/info
   mv $pkgdir/usr/share/texmf/doc/info/*.info $pkgdir/usr/share/info/
   rm -rf $pkgdir/usr/share/texmf/doc/{man,info}
   # copy config files to $TEXMFCONFIG tree
   cp -a $pkgdir/usr/share/texmf/chktex/chktexrc \
     	$pkgdir/etc/texmf/chktex/
   cp -a $pkgdir/usr/share/texmf/web2c/mktex.cnf \
   	  $pkgdir/etc/texmf/web2c/
   cp -a $pkgdir/usr/share/texmf/web2c/updmap.cfg \
   	  $pkgdir/etc/texmf/web2c/
   cp -a $pkgdir/usr/share/texmf/web2c/fmtutil.cnf \
   	  $pkgdir/etc/texmf/web2c/
   cp -a $pkgdir/usr/share/texmf/dvips/config/config.ps \
   	  $pkgdir/etc/texmf/dvips/config/
   cp -a $pkgdir/usr/share/texmf/dvipdfm/config/config \
   	  $pkgdir/etc/texmf/dvipdfm/config/
   cp -a $pkgdir/usr/share/texmf/dvipdfmx/dvipdfmx.cfg \
   	  $pkgdir/etc/texmf/dvipdfmx/
   cp -a $pkgdir/usr/share/texmf/tex/generic/config/pdftexconfig.tex \
   	  $pkgdir/etc/texmf/tex/generic/config/
   cp -a $pkgdir/usr/share/texmf/tex/generic/config/language.dat \
   	  $pkgdir/etc/texmf/tex/generic/config/
   cp -a $pkgdir/usr/share/texmf/tex/generic/config/language.def \
   	  $pkgdir/etc/texmf/tex/generic/config/
   cp -a $pkgdir/usr/share/texmf/ttf2pk/ttf2pk.cfg \
   	  $pkgdir/etc/texmf/ttf2pk/
   cp -a $pkgdir/usr/share/texmf/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.*
   # clean updmap.cfg
   sed -i '/^\(Map\|MixedMap\)/d' $pkgdir/etc/texmf/web2c/updmap.cfg
   sed -i '/^#! \(Map\|MixedMap\)/d' $pkgdir/etc/texmf/web2c/updmap.cfg

   #############################################################
   ### install
   cd source
   # 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,texmf-dist}

   ## install luatex binary
   install -m755 $srcdir/luatex-beta-${_luatex_ver}/build/texk/web2c/luatex $pkgdir/usr/bin/
   cd $pkgdir/usr/bin
   /bin/ln -s luatex texlua
   /bin/ln -s luatex texluac

   ## install Perl libraries
   mkdir -p $pkgdir/usr/share/tlpkg/TeXLive
   install -m644 ${srcdir}/source/utils/biber/TeXLive/*.pm $pkgdir/usr/share/tlpkg/TeXLive

   # create symlinks for formats 
   echo "--> Create symlinks for TeX formats ..."
   PATH="$PATH:${pkgdir}/usr/bin" texlinks -f $pkgdir/usr/share/texmf/web2c/fmtutil.cnf $pkgdir/usr/bin/
   #############################################################
   # remove dangling symlinks
   _bibtexextra_scripts="bibexport"
   _core_scripts="
afm2afm
arlatex
autoinst
bundledoc
cmap2enc
de-macro
dviasm
epstopdf
findhyph
font2afm
fragmaster
installfont-tl
latex2man
latexdiff
latexdiff-vc
latexmk
latexrevise
listings-ext.sh
mkjobtexmf
mkluatexfontdb
mkt1font
mptopdf
ot2kpx
pdf180
pdf270
pdf90
pdfatfi
pdfbook
pdfcrop
pdfflip
pdfjam
pdfjam-pocketmod
pdfjam-slides3up
pdfjam-slides6up
pdfjoin
pdfnup
pdfpun
pfm2kpx
pkfix
pkfix-helper
purifyeps
repstopdf
rpdfcrop
showglyphs
sty2dtx
texcount
texdef
texdiff
texdirflatten
texloganalyser
thumbpdf
vpl2ovp
vpl2vpl
"
   _htmlxml_scripts="ht htcontext htlatex htmex httex httexi htxelatex htxetex mk4ht"
   _langextra_scripts="ebong"
   _langgreek_scripts="mkgrkindex"
   _latexextra_scripts="authorindex \
makeglossaries \
pdfannotextractor \
pdfthumb \
perltex \
ppower4 \
ps4pdf \
splitindex \
svn-multi \
vpe"
   _music_scripts="musixtex musixflx"
   _pictures_scripts="cachepic epspdf epspdftk fig4latex mathspic"
   _pstricks_scripts="pst2pdf"
   _science_scripts="ulqda"
   for s in \
        ${_bibtexextra_scripts} \
        ${_core_scripts}       \
        ${_htmlxml_scripts}    \
        ${_langextra_scripts}  \
        ${_langgreek_scripts}  \
        ${_latexextra_scripts} \
        ${_music_scripts}      \
        ${_pictures_scripts}   \
        ${_pstricks_scripts}   \
        ${_science_scripts}    \
        tlmgr; do
     rm -f $pkgdir/usr/bin/$s
   done
   ###################################################################
}