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