chiark / gitweb /
texlive-bin: remove perl as dependency as it is only required for a few optional...
[termux-packages] / packages / texlive-bin / build.sh
1 TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/
2 TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system. This package contains architecture dependent binaries."
3 TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
4 TERMUX_PKG_VERSION=20170524
5 TERMUX_PKG_REVISION=8
6 TERMUX_PKG_SRCURL=ftp://tug.org/historic/systems/texlive/${TERMUX_PKG_VERSION:0:4}/texlive-${TERMUX_PKG_VERSION}-source.tar.xz
7 TERMUX_PKG_SHA256="0161695304e941334dc0b3b5dabcf8edf46c09b7bc33eea8229b5ead7ccfb2aa"
8 TERMUX_PKG_DEPENDS="freetype, libpng, libgd, libgmp, libmpfr, libicu, liblua, poppler, libgraphite, harfbuzz-icu, teckit"
9 TERMUX_PKG_BUILD_DEPENDS="icu-devtools"
10 TERMUX_PKG_BREAKS="texlive (<< 20170524-3)"
11 TERMUX_PKG_REPLACES="texlive (<< 20170524-3)"
12 TERMUX_PKG_RECOMMENDS="texlive"
13 TERMUX_PKG_NO_DEVELSPLIT=yes
14
15 TL_ROOT=$TERMUX_PREFIX/share/texlive
16 TL_BINDIR=$TERMUX_PREFIX/bin
17
18 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
19 AR=ar \
20 RANLIB=ranlib \
21 BUILDAR=ar \
22 BUILDRANLIB=ranlib \
23 ac_cv_c_bigendian=no \
24 --prefix=$TL_ROOT \
25 --bindir=$TL_BINDIR \
26 --datarootdir=$TL_ROOT \
27 --datadir=$TERMUX_PREFIX/share \
28 --mandir=$TERMUX_PREFIX/share/man \
29 --docdir=$TERMUX_PREFIX/share/doc \
30 --infodir=$TERMUX_PREFIX/share/info \
31 --libdir=$TERMUX_PREFIX/lib \
32 --includedir=$TERMUX_PREFIX/include \
33 --build=$TERMUX_BUILD_TUPLE \
34 --enable-ttfdump=no \
35 --enable-makeindexk=yes \
36 --enable-makejvf=no \
37 --enable-mendexk=no \
38 --enable-musixtnt=no \
39 --enable-ps2pk=no \
40 --enable-seetexk=no \
41 --enable-gregorio=no \
42 --disable-native-texlive-build \
43 --disable-bibtexu \
44 --disable-dvisvgm \
45 --disable-dialog \
46 --disable-psutils \
47 --disable-multiplatform \
48 --disable-t1utils \
49 --enable-luatex \
50 --disable-luajittex \
51 --disable-mflua \
52 --disable-mfluajit \
53 --disable-xz \
54 --disable-pmx \
55 --without-texinfo \
56 --without-xdvipdfmx \
57 --without-texi2html \
58 --with-system-cairo \
59 --with-system-graphite2 \
60 --with-system-harfbuzz \
61 --with-system-gd \
62 --with-system-gmp \
63 --with-system-icu \
64 --with-system-lua \
65 --with-system-mpfr \
66 --with-system-poppler \
67 --with-system-zlib \
68 --with-system-xpdf \
69 --with-system-lua \
70 --with-system-teckit \
71 --without-x \
72 --with-banner-add=/Termux"
73
74 # These files are provided by texlive:
75 TERMUX_PKG_RM_AFTER_INSTALL="
76 share/texlive/texmf-dist/texconfig/tcfmgr.map
77 share/texlive/texmf-dist/texconfig/tcfmgr
78 share/texlive/texmf-dist/web2c/mktex.opt
79 share/texlive/texmf-dist/web2c/mktexdir.opt
80 share/texlive/texmf-dist/web2c/mktexnam.opt
81 share/texlive/texmf-dist/web2c/fmtutil.cnf
82 share/texlive/texmf-dist/web2c/mktexdir
83 share/texlive/texmf-dist/web2c/mktexnam
84 share/texlive/texmf-dist/web2c/mktexupd
85 share/texlive/texmf-dist/dvipdfmx/dvipdfmx.cfg
86 share/texlive/texmf-dist/dvips/base/color.pro
87 share/texlive/texmf-dist/dvips/base/crop.pro
88 share/texlive/texmf-dist/dvips/base/finclude.pro
89 share/texlive/texmf-dist/dvips/base/hps.pro
90 share/texlive/texmf-dist/dvips/base/special.pro
91 share/texlive/texmf-dist/dvips/base/tex.pro
92 share/texlive/texmf-dist/dvips/base/texps.pro
93 share/texlive/texmf-dist/dvips/base/texc.pro
94 share/texlive/texmf-dist/dvips/gsftopk/render.ps
95 share/texlive/texmf-dist/scripts/texlive/allcm.sh
96 share/texlive/texmf-dist/scripts/texlive/allneeded.sh
97 share/texlive/texmf-dist/scripts/texlive/dvi2fax.sh
98 share/texlive/texmf-dist/scripts/texlive/dvired.sh
99 share/texlive/texmf-dist/scripts/texlive/kpsetool.sh
100 share/texlive/texmf-dist/scripts/texlive/kpsewhere.sh
101 share/texlive/texmf-dist/scripts/texlive/texconfig-dialog.sh
102 share/texlive/texmf-dist/scripts/texlive/texconfig-sys.sh
103 share/texlive/texmf-dist/scripts/texlive/texconfig.sh
104 share/texlive/texmf-dist/scripts/texlive/texlinks.sh
105 share/texlive/texmf-dist/scripts/texlive/fmtutil-sys.sh
106 share/texlive/texmf-dist/scripts/texlive/fmtutil.pl
107 share/texlive/texmf-dist/scripts/texlive/tlmgr.pl
108 share/texlive/texmf-dist/scripts/texlive/updmap-sys.sh
109 share/texlive/texmf-dist/scripts/texlive/updmap.pl
110 share/texlive/texmf-dist/scripts/simpdftex/simpdftex
111 share/texlive/texmf-dist/fonts/cmap/dvipdfmx/EUC-UCS2
112 share/texlive/texmf-dist/fonts/map/glyphlist/pdfglyphlist.txt
113 share/texlive/texmf-dist/fonts/map/glyphlist/glyphlist.txt
114 share/texlive/texmf-dist/fonts/map/glyphlist/texglyphlist.txt
115 share/texlive/texmf-dist/fonts/map/dvipdfmx/cid-x.map
116 share/texlive/texmf-dist/fonts/enc/dvips/base/7t.enc
117 share/texlive/texmf-dist/scripts/luaotfload/luaotfload-tool.lua
118 share/texlive/texmf-dist/scripts/oberdiek/pdfatfi.pl
119 share/texlive/texmf-dist/scripts/lua2dox/lua2dox_filter
120 share/texlive/texmf-dist/scripts/context/perl/mptopdf.pl
121 share/texlive/texmf-dist/scripts/checkcites/checkcites.lua"
122
123 termux_step_pre_configure() {
124         # When building against libicu 59.1 or later we need c++11:
125         CXXFLAGS+=" -std=c++11"
126 }
127
128 termux_step_post_make_install () {
129         # Replace tlmgr link with a small wrapper that prevents common break on "tlmgr update --self"
130         mv $TL_BINDIR/tlmgr $TL_BINDIR/tlmgr.ln
131         echo "#!$TERMUX_PREFIX/bin/sh" > $TL_BINDIR/tlmgr
132         echo "termux-fix-shebang $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
133         echo "sed -E -i '"'s@`/bin/sh@`'$TERMUX_PREFIX"/bin/sh@g' ${TL_ROOT}/tlpkg/TeXLive/TLUtils.pm" >> $TL_BINDIR/tlmgr
134         echo 'tlmgr.ln "$@"' >> $TL_BINDIR/tlmgr
135         chmod 0744 $TL_BINDIR/tlmgr
136 }
137
138 termux_step_create_debscripts () {
139         # Clean texlive's folder if needed (run on fresh install)
140         echo "#!$TERMUX_PREFIX/bin/bash" > preinst
141         echo "if [ ! -f $TERMUX_PREFIX/opt/texlive/2016/install-tl -a ! -f $TERMUX_PREFIX/opt/texlive/2017/install-tl ]; then exit 0; else echo 'Removing residual files from old version of TeX Live for Termux'; fi" >> preinst
142         echo "rm -rf $TERMUX_PREFIX/etc/profile.d/texlive.sh" >> preinst
143         echo "rm -rf $TERMUX_PREFIX/opt/texlive/2016" >> preinst
144         # Let's not delete the previous texmf-dist so that people who have installed a full distribution won't need to download everything again
145         echo "shopt -s extglob" >> preinst # !(texmf-dist) is an extended glob which is turned off in scripts
146         echo "rm -rf $TERMUX_PREFIX/opt/texlive/2017/!(texmf-dist)" >> preinst
147         echo "shopt -u extglob" >> preinst # disable extglob again just in case
148         echo "exit 0" >> preinst
149         chmod 0755 preinst
150 }