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