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
=20180414
5 TERMUX_PKG_VERSION
=${_MAJOR_VERSION}
6 TERMUX_PKG_SRCURL
=("ftp://ftp.tug.org/texlive/historic/${TERMUX_PKG_VERSION:0:4}/"\
7 {"texlive-$_MAJOR_VERSION-texmf.tar.xz",\
8 "texlive-$_MAJOR_VERSION-extra.tar.xz",\
9 "install-tl-unx.tar.gz"})
10 TERMUX_PKG_SHA256
=("bae2fa05ea1858b489f8138bea855c6d65829cf595c1fb219c5d65f4fe8b1fad"
11 "5b4397854723405f20df7172e73a04cee2d3ab712f78b064a7f523d6ab9f0329"
12 "82c13110852af162c4c5ef1579fa2f4f51c2040850ec02fb7f97497da45eb446")
13 TERMUX_PKG_DEPENDS
="perl, texlive-bin (>= 20180414)"
14 TERMUX_PKG_CONFLICTS
="texlive (<< 20170524-5), texlive-bin (<< 20180414)"
15 TERMUX_PKG_RECOMMENDS
="texlive-tlmgr"
16 TERMUX_PKG_FOLDERNAME
=("texlive-$_MAJOR_VERSION-texmf"
17 "texlive-$_MAJOR_VERSION-extra"
18 "install-tl-$_MAJOR_VERSION")
19 TL_FILE_LISTS
=("texlive-texmf.list"
22 TERMUX_PKG_PLATFORM_INDEPENDENT
=yes
24 TL_ROOT
=$TERMUX_PREFIX/share
/texlive
25 TL_BINDIR
=$TERMUX_PREFIX/bin
27 termux_step_extract_package
() {
28 mkdir
-p
"$TERMUX_PKG_SRCDIR"
30 cd "$TERMUX_PKG_TMPDIR"
31 for index
in $
(seq 0 2); do
33 filename
=$
(basename "${TERMUX_PKG_SRCURL[$index]}")
34 local file="$TERMUX_PKG_CACHEDIR/$filename"
35 termux_download
"${TERMUX_PKG_SRCURL[$index]}" "$file" "${TERMUX_PKG_SHA256[$index]}"
37 folder
=${TERMUX_PKG_FOLDERNAME[$index]}
40 echo "Extracting files listed in ${TL_FILE_LISTS[$index]} from $folder"
41 tar xf
"$file" $
(paste -d
'\0' <(for i
in $
(seq 1 $
( wc -l
< $TERMUX_PKG_BUILDER_DIR/${TL_FILE_LISTS[$index]} )); do echo ${TERMUX_PKG_FOLDERNAME[$index]}/; done ) $TERMUX_PKG_BUILDER_DIR/${TL_FILE_LISTS[$index]} )
43 cp -r
${TERMUX_PKG_FOLDERNAME[@]} "$TERMUX_PKG_SRCDIR"
47 for index
in $
( seq 0 2 ); do
48 cp -r
$TERMUX_PKG_SRCDIR/${TERMUX_PKG_FOLDERNAME[$index]}/* $TL_ROOT/
51 mkdir
-p
$TL_ROOT/{tlpkg
/{backups
,tlpobj
},texmf-var
/web2c
}
52 cp $TERMUX_PKG_BUILDER_DIR/texlive.tlpdb
$TL_ROOT/tlpkg
/
54 perl
-I
$TL_ROOT/tlpkg
/ $TL_ROOT/texmf-dist
/scripts
/texlive
/mktexlsr.pl
$TL_ROOT/texmf-dist
56 # Replace tlmgr link with a small wrapper that prevents error on "tlmgr update --self"
57 rm -rf
$TL_BINDIR/tlmgr
58 ln -sf ..
/share
/texlive
/texmf-dist
/scripts
/texlive
/tlmgr.pl
$TL_BINDIR/tlmgr.
ln
59 echo "#!$TERMUX_PREFIX/bin/sh" > $TL_BINDIR/tlmgr
60 echo "termux-fix-shebang $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
61 echo "sed -i 's%\`kpsewhich -var-value=SELFAUTOPARENT\`);%\`kpsewhich -var-value=TEXMFROOT\`);%g' $TL_ROOT/texmf-dist/scripts/texlive/tlmgr.pl" >> $TL_BINDIR/tlmgr
62 echo "sed -i 's%TEXMFROOT = \$SELFAUTOPARENT%TEXMFROOT = \$SELFAUTODIR/share/texlive%gb' $TL_ROOT/texmf-dist/web2c/texmf.cnf" >> $TL_BINDIR/tlmgr
63 echo "sed -E -i '"'s@`/bin/sh@`'$TERMUX_PREFIX"/bin/sh@g' ${TL_ROOT}/tlpkg/TeXLive/TLUtils.pm" >> $TL_BINDIR/tlmgr
64 echo 'tlmgr.ln "$@"' >> $TL_BINDIR/tlmgr
65 chmod 0744 $TL_BINDIR/tlmgr
68 termux_step_create_debscripts
() {
69 # Clean texlive's folder if needed (run on upgrade)
70 echo "#!$TERMUX_PREFIX/bin/bash" > preinst
71 echo "if [ -d $TERMUX_PREFIX/opt/texlive ]; then echo 'Removing residual files from old version of TeX Live for Termux'; rm -rf $PREFIX/opt/texlive; fi" >> preinst
72 echo "exit 0" >> preinst
75 echo "#!$TERMUX_PREFIX/bin/bash" > postinst
76 echo "mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}}" >> postinst
77 echo "export TMPDIR=$TERMUX_PREFIX/tmp" >> postinst
78 echo "echo Updating tlmgr" >> postinst
79 echo "tlmgr update --self" >> postinst
80 echo "echo Generating language files and setting up symlinks" >> postinst
81 echo "tlmgr -q generate language" >> postinst
82 echo "mktexlsr $TL_ROOT/texmf-var" >> postinst
83 echo "texlinks" >> postinst
84 echo "echo ''" >> postinst
85 echo "echo Welcome to TeX Live!" >> postinst
86 echo "echo ''" >> postinst
87 echo "echo 'TeX Live is a joint project of the TeX user groups around the world;'" >> postinst
88 echo "echo 'please consider supporting it by joining the group best for you.'" >> postinst
89 echo "echo 'The list of groups is available on the web at http://tug.org/usergroups.html.'" >> postinst
90 echo "exit 0" >> postinst
93 # Remove all files installed through tlmgr on removal
94 echo "#!$TERMUX_PREFIX/bin/bash" > prerm
95 echo 'if [ $1 != "remove" ]; then exit 0; fi' >> prerm
96 echo "echo Running texlinks --unlink" >> prerm
97 echo "texlinks --unlink" >> prerm
98 echo "echo Removing texmf-dist" >> prerm
99 echo "rm -rf $TL_ROOT/texmf-dist" >> prerm
100 echo "echo Removing texmf-var and tlpkg" >> prerm
101 echo "rm -rf $TL_ROOT/{texmf-var,tlpkg/{texlive.tlpdb.*,tlpobj,backups}}" >> prerm
102 echo "exit 0" >> prerm
106 # Files to rm, first from texlive-$_MAJOR_VERSION-extra and then from install-tl-unx
107 TERMUX_PKG_RM_AFTER_INSTALL
="
109 share/texlive/README.usergroups
110 share/texlive/autorun.inf
111 share/texlive/doc.html
112 share/texlive/index.html
113 share/texlive/install-tl
114 share/texlive/install-tl-advanced.bat
115 share/texlive/install-tl-windows.bat
116 share/texlive/readme-html.dir/readme.ja.html
117 share/texlive/readme-html.dir/readme.ru.html
118 share/texlive/readme-html.dir/readme.zh-cn.html
119 share/texlive/readme-html.dir/readme.it.html
120 share/texlive/readme-html.dir/readme.es.html
121 share/texlive/readme-html.dir/readme.pl.html
122 share/texlive/readme-html.dir/readme.de.html
123 share/texlive/readme-html.dir/readme.fr.html
124 share/texlive/readme-html.dir/readme.sr.html
125 share/texlive/readme-html.dir/readme.pt-br.html
126 share/texlive/readme-html.dir/readme.en.html
127 share/texlive/readme-html.dir/readme.cs.html
128 share/texlive/readme-txt.dir/README.RU-koi8
129 share/texlive/readme-txt.dir/README.EN
130 share/texlive/readme-txt.dir/README.FR
131 share/texlive/readme-txt.dir/README.SK-il2
132 share/texlive/readme-txt.dir/README.SK-ascii
133 share/texlive/readme-txt.dir/README.RU
134 share/texlive/readme-txt.dir/README.IT
135 share/texlive/readme-txt.dir/README.CS
136 share/texlive/readme-txt.dir/README.JA
137 share/texlive/readme-txt.dir/README.ES
138 share/texlive/readme-txt.dir/README.ZH-CN
139 share/texlive/readme-txt.dir/README.DE
140 share/texlive/readme-txt.dir/README.PL
141 share/texlive/readme-txt.dir/README.SK-cp1250
142 share/texlive/readme-txt.dir/README.SR
143 share/texlive/readme-txt.dir/README.PT-BR
144 share/texlive/readme-txt.dir/README.RU-cp1251
145 share/texlive/tl-tray-menu.exe
146 share/texlive/tlpkg/tlpostcode/xetex.pl
147 share/texlive/tlpkg/tlpostcode/xetex/conf/fonts.conf
148 share/texlive/tlpkg/tlpostcode/xetex/conf/fonts.dtd
149 share/texlive/tlpkg/tlpostcode/xetex/conf/conf.d/51-local.conf
150 share/texlive/tlpkg/tlpostcode/xetex/cache/readme.txt
151 share/texlive/tlpkg/tlpostcode/ptex2pdf-tlpost.pl
152 share/texlive/texmf-dist/web2c/texmf.cnf
153 share/texlive/texmf-dist/scripts/texlive/fmtutil-user.sh
154 share/texlive/texmf-dist/scripts/texlive/rungs.tlu
155 share/texlive/texmf-dist/scripts/texlive/updmap-user.sh"