Texlive: fix #1068, #1069 by upgrading to texlive 2017 (#1072)
[termux-packages] / packages / texlive / build.sh
CommitLineData
cb2a32e4 1TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/
2TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system."
e85171f5
HG
3TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
4_MAJOR_VERSION=20170524
5_MINOR_VERSION=
d415b125 6TERMUX_PKG_VERSION=${_MAJOR_VERSION}${_MINOR_VERSION}
7TERMUX_PKG_SRCURL=ftp://tug.org/historic/systems/texlive/${TERMUX_PKG_VERSION:0:4}/texlive-${TERMUX_PKG_VERSION}-source.tar.xz
e85171f5
HG
8TERMUX_PKG_SHA256="0161695304e941334dc0b3b5dabcf8edf46c09b7bc33eea8229b5ead7ccfb2aa"
9TERMUX_PKG_DEPENDS="freetype, libpng, libgd, libgmp, libmpfr, libicu, liblua, poppler, libgraphite, harfbuzz-icu, perl, xz-utils, wget, gnupg"
d415b125 10TERMUX_PKG_FOLDERNAME=texlive-${_MAJOR_VERSION}-source
11
e85171f5
HG
12TL_ROOT=$TERMUX_PREFIX/opt/texlive/${TERMUX_PKG_VERSION:0:4}
13
b6c7cb34 14TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
cb2a32e4 15AR=ar \
16RANLIB=ranlib \
17BUILDAR=ar \
18BUILDRANLIB=ranlib \
86aeac04 19ac_cv_c_bigendian=no \
e85171f5
HG
20--prefix=$TL_ROOT \
21--bindir=$TL_ROOT/bin/pkg \
22--datarootdir=$TL_ROOT \
23--datadir=$TERMUX_PREFIX/share \
24--mandir=$TERMUX_PREFIX/share/man \
25--docdir=$TERMUX_PREFIX/share/doc \
26--infodir=$TERMUX_PREFIX/share/info \
d415b125 27--libdir=$TERMUX_PREFIX/lib \
e85171f5 28--includedir=$TERMUX_PREFIX/include \
cb2a32e4 29--build=$TERMUX_BUILD_TUPLE \
290d898d 30--enable-ttfdump=no \
e85171f5 31--enable-makeindexk=yes \
290d898d
FF
32--enable-makejvf=no \
33--enable-mendexk=no \
34--enable-musixtnt=no \
35--enable-ps2pk=no \
36--enable-seetexk=no \
37--enable-gregorio=no \
cb2a32e4 38--disable-native-texlive-build \
290d898d
FF
39--disable-bibtexu \
40--disable-dvisvgm \
cb2a32e4 41--disable-dialog \
42--disable-psutils \
290d898d 43--disable-multiplatform \
cb2a32e4 44--disable-t1utils \
d415b125 45--enable-luatex \
290d898d
FF
46--disable-luajittex \
47--disable-mflua \
48--disable-mfluajit \
49--disable-xz \
d415b125 50--disable-pmx \
cb2a32e4 51--without-texinfo \
52--without-xdvipdfmx \
53--without-texi2html \
290d898d
FF
54--with-system-cairo \
55--with-system-graphite2 \
56--with-system-harfbuzz \
57--with-system-gd \
58--with-system-gmp \
cb2a32e4 59--with-system-icu \
290d898d
FF
60--with-system-lua \
61--with-system-mpfr \
cb2a32e4 62--with-system-poppler \
290d898d 63--with-system-zlib \
cb2a32e4 64--with-system-xpdf \
d415b125 65--with-system-lua \
290d898d
FF
66--without-x \
67--with-banner-add=/Termux"
cb2a32e4 68
86aeac04
FF
69termux_step_pre_configure() {
70 # When building against libicu 59.1 or later we need c++11:
71 CXXFLAGS+=" -std=c++11"
cb2a32e4 72}
73
74termux_step_post_make_install () {
d415b125 75 cp $TERMUX_PKG_BUILDER_DIR/termux-install-tl.sh $TERMUX_PREFIX/bin/termux-install-tl
e85171f5
HG
76 mkdir -p $TERMUX_PREFIX/etc/profile.d/
77 echo "export PATH=\$PATH:$TERMUX_PREFIX/opt/texlive/${TERMUX_PKG_VERSION:0:4}/bin/custom/" >> $TERMUX_PREFIX/etc/profile.d/texlive.sh
78 echo "export TMPDIR=$TERMUX_PREFIX/tmp/" >> $TERMUX_PREFIX/etc/profile.d/texlive.sh
79 chmod 0744 $TERMUX_PREFIX/etc/profile.d/texlive.sh
cb2a32e4 80}
81
82termux_step_create_debscripts () {
d415b125 83 echo 'echo "========================================================"' > postinst
84 echo 'echo "retrieving texlive..."' >> postinst
85 echo 'echo "you can start this manually by calling termux-install-tl"' >> postinst
86 echo 'echo "========================================================"' >> postinst
290d898d
FF
87 echo "termux-install-tl" >> postinst
88 echo "exit 0" >> postinst
89 chmod 0755 postinst
e85171f5
HG
90
91 # Clean texlive's folder if needed.
92 echo "if [ ! -f $TERMUX_PREFIX/opt/texlive/2016/install-tl ]; then exit 0; else echo 'Removing residual files from old version of TeX Live for Termux'; fi" > preinst
93 echo "rm -rf $TERMUX_PREFIX/{etc/profile.d/texlive.sh,opt/texlive}" >> preinst
94 echo "exit 0" >> preinst
95 chmod 0755 preinst
96
97 # Remove all files installed/downloaded through termux-install-tl
98 echo 'if [ $1 != "remove" ]; then exit 0; fi' > prerm
99 echo "echo Running texlinks --unlink" >> prerm
100 echo "texlinks --unlink" >> prerm
101 echo "echo Removing bin/custom and texmf-dist" >> prerm
102 echo "rm -rf $TL_ROOT/{bin/custom,texmf-dist}" >> prerm
103 echo "exit 0" >> prerm
104 chmod 0755 prerm
cb2a32e4 105}