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