ecj: Switch to working src url
[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"
4_MAJOR_VERSION=20170524
5_MINOR_VERSION=
93372882 6TERMUX_PKG_REVISION=1
dce832a2
HG
7TERMUX_PKG_VERSION=${_MAJOR_VERSION}${_MINOR_VERSION}
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"
1ec6c4b8 11TERMUX_PKG_BUILD_DEPENDS="icu-devtools"
dce832a2
HG
12TERMUX_PKG_FOLDERNAME=texlive-${_MAJOR_VERSION}-source
13TERMUX_PKG_BREAKS="texlive (<< 20170524-3)"
14TERMUX_PKG_REPLACES="texlive (<< 20170524-3)"
93372882 15TERMUX_PKG_RECOMMENDS="texlive"
dce832a2
HG
16TERMUX_PKG_NO_DEVELSPLIT=yes
17
18TL_ROOT=$TERMUX_PREFIX/opt/texlive/${TERMUX_PKG_VERSION:0:4}
19TL_BINDIR=$TL_ROOT/bin/custom
20
21TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
22AR=ar \
23RANLIB=ranlib \
24BUILDAR=ar \
25BUILDRANLIB=ranlib \
26ac_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
93372882
HG
76# These files are provided by texlive-base:
77TERMUX_PKG_RM_AFTER_INSTALL="
78opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/texconfig/tcfmgr.map
79opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/texconfig/tcfmgr
80opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/texmf.cnf
81opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/mktex.opt
82opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/mktexdir.opt
83opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/mktexnam.opt
84opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/fmtutil.cnf
85opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/mktexdir
86opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/mktexnam
87opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/web2c/mktexupd
88opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvipdfmx/dvipdfmx.cfg
89opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/color.pro
90opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/crop.pro
91opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/finclude.pro
92opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/hps.pro
93opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/special.pro
94opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/tex.pro
95opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/texps.pro
96opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/base/texc.pro
97opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/dvips/gsftopk/render.ps
98opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/allcm.sh
99opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/allneeded.sh
100opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/dvi2fax.sh
101opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/dvired.sh
102opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/kpsetool.sh
103opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/kpsewhere.sh
104opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/texconfig-dialog.sh
105opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/texconfig-sys.sh
106opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/texconfig.sh
107opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/texlinks.sh
108opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/fmtutil-sys.sh
109opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/fmtutil.pl
110opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/tlmgr.pl
111opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/updmap-sys.sh
112opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/texlive/updmap.pl
113opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/simpdftex/simpdftex
114opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/fonts/cmap/dvipdfmx/EUC-UCS2
115opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/fonts/map/glyphlist/pdfglyphlist.txt
116opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/fonts/map/glyphlist/glyphlist.txt
117opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/fonts/map/glyphlist/texglyphlist.txt
118opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/fonts/map/dvipdfmx/cid-x.map
119opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/fonts/enc/dvips/base/7t.enc
120opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/luaotfload/luaotfload-tool.lua
121opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/oberdiek/pdfatfi.pl
122opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/lua2dox/lua2dox_filter
123opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/context/perl/mptopdf.pl
124opt/texlive/${TERMUX_PKG_VERSION:0:4}/texmf-dist/scripts/checkcites/checkcites.lua"
dce832a2
HG
125
126termux_step_pre_configure() {
127 # When building against libicu 59.1 or later we need c++11:
128 CXXFLAGS+=" -std=c++11"
129}
130
131termux_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
144termux_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}