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