squid: Some configure arguments
[termux-packages] / packages / texlive / 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_VERSION=${_MAJOR_VERSION}${_MINOR_VERSION}
7 TERMUX_PKG_SRCURL=ftp://tug.org/historic/systems/texlive/${TERMUX_PKG_VERSION:0:4}/texlive-${TERMUX_PKG_VERSION}-source.tar.xz
8 TERMUX_PKG_SHA256="0161695304e941334dc0b3b5dabcf8edf46c09b7bc33eea8229b5ead7ccfb2aa"
9 TERMUX_PKG_DEPENDS="freetype, libpng, libgd, libgmp, libmpfr, libicu, liblua, poppler, libgraphite, harfbuzz-icu, perl, xz-utils, wget, gnupg"
10 TERMUX_PKG_FOLDERNAME=texlive-${_MAJOR_VERSION}-source
11
12 TL_ROOT=$TERMUX_PREFIX/opt/texlive/${TERMUX_PKG_VERSION:0:4}
13
14 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
15 AR=ar \
16 RANLIB=ranlib \
17 BUILDAR=ar \
18 BUILDRANLIB=ranlib \
19 ac_cv_c_bigendian=no \
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 \
27 --libdir=$TERMUX_PREFIX/lib \
28 --includedir=$TERMUX_PREFIX/include \
29 --build=$TERMUX_BUILD_TUPLE \
30 --enable-ttfdump=no \
31 --enable-makeindexk=yes \
32 --enable-makejvf=no \
33 --enable-mendexk=no \
34 --enable-musixtnt=no \
35 --enable-ps2pk=no \
36 --enable-seetexk=no \
37 --enable-gregorio=no \
38 --disable-native-texlive-build \
39 --disable-bibtexu \
40 --disable-dvisvgm \
41 --disable-dialog \
42 --disable-psutils \
43 --disable-multiplatform \
44 --disable-t1utils \
45 --enable-luatex \
46 --disable-luajittex \
47 --disable-mflua \
48 --disable-mfluajit \
49 --disable-xz \
50 --disable-pmx \
51 --without-texinfo \
52 --without-xdvipdfmx \
53 --without-texi2html \
54 --with-system-cairo \
55 --with-system-graphite2 \
56 --with-system-harfbuzz \
57 --with-system-gd \
58 --with-system-gmp \
59 --with-system-icu \
60 --with-system-lua \
61 --with-system-mpfr \
62 --with-system-poppler \
63 --with-system-zlib \
64 --with-system-xpdf \
65 --with-system-lua \
66 --without-x \
67 --with-banner-add=/Termux"
68
69 termux_step_pre_configure() {
70 # When building against libicu 59.1 or later we need c++11:
71 CXXFLAGS+=" -std=c++11"
72 }
73
74 termux_step_post_make_install () {
75 cp $TERMUX_PKG_BUILDER_DIR/termux-install-tl.sh $TERMUX_PREFIX/bin/termux-install-tl
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
80 }
81
82 termux_step_create_debscripts () {
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
87 echo "termux-install-tl" >> postinst
88 echo "exit 0" >> postinst
89 chmod 0755 postinst
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
105 }