Commit | Line | Data |
---|---|---|
cb2a32e4 | 1 | TERMUX_PKG_HOMEPAGE=https://www.tug.org/texlive/ |
2 | TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system." | |
e85171f5 | 3 | TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91" |
f547c930 | 4 | _MAJOR_VERSION=20180414 |
43c3e5fc | 5 | TERMUX_PKG_VERSION=${_MAJOR_VERSION} |
dce832a2 HG |
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"}) | |
f547c930 HG |
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" | |
dce832a2 HG |
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" | |
20 | "texlive-extra.list" | |
21 | "install-tl.list") | |
22 | TERMUX_PKG_PLATFORM_INDEPENDENT=yes | |
d415b125 | 23 | |
43c3e5fc | 24 | TL_ROOT=$TERMUX_PREFIX/share/texlive |
aeba89b4 | 25 | TL_BINDIR=$TERMUX_PREFIX/bin |
e85171f5 | 26 | |
dce832a2 HG |
27 | termux_step_extract_package() { |
28 | mkdir -p "$TERMUX_PKG_SRCDIR" | |
29 | ||
30 | cd "$TERMUX_PKG_TMPDIR" | |
31 | for index in $(seq 0 2); do | |
32 | local filename | |
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]}" | |
36 | ||
37 | folder=${TERMUX_PKG_FOLDERNAME[$index]} | |
38 | ||
39 | rm -Rf $folder | |
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]} ) | |
42 | done | |
43 | cp -r ${TERMUX_PKG_FOLDERNAME[@]} "$TERMUX_PKG_SRCDIR" | |
cb2a32e4 | 44 | } |
45 | ||
dce832a2 HG |
46 | termux_step_make() { |
47 | for index in $( seq 0 2 ); do | |
48 | cp -r $TERMUX_PKG_SRCDIR/${TERMUX_PKG_FOLDERNAME[$index]}/* $TL_ROOT/ | |
49 | done | |
aeba89b4 | 50 | |
dce832a2 HG |
51 | mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/web2c} |
52 | cp $TERMUX_PKG_BUILDER_DIR/texlive.tlpdb $TL_ROOT/tlpkg/ | |
aeba89b4 | 53 | |
dce832a2 | 54 | perl -I$TL_ROOT/tlpkg/ $TL_ROOT/texmf-dist/scripts/texlive/mktexlsr.pl $TL_ROOT/texmf-dist |
f547c930 HG |
55 | |
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 | |
cb2a32e4 | 66 | } |
67 | ||
68 | termux_step_create_debscripts () { | |
dce832a2 | 69 | # Clean texlive's folder if needed (run on upgrade) |
5ceb2e0e | 70 | echo "#!$TERMUX_PREFIX/bin/bash" > preinst |
cc68f4fa | 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 |
e85171f5 HG |
72 | echo "exit 0" >> preinst |
73 | chmod 0755 preinst | |
aa605e89 | 74 | |
5ceb2e0e | 75 | echo "#!$TERMUX_PREFIX/bin/bash" > postinst |
aa605e89 | 76 | echo "mkdir -p $TL_ROOT/{tlpkg/{backups,tlpobj},texmf-var/{web2c,tex/generic/config}}" >> postinst |
5ceb2e0e | 77 | echo "export TMPDIR=$TERMUX_PREFIX/tmp" >> postinst |
dce832a2 HG |
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 | |
dce832a2 HG |
90 | echo "exit 0" >> postinst |
91 | chmod 0755 postinst | |
92 | ||
93 | # Remove all files installed through tlmgr on removal | |
5ceb2e0e | 94 | echo "#!$TERMUX_PREFIX/bin/bash" > prerm |
aa605e89 | 95 | echo 'if [ $1 != "remove" ]; then exit 0; fi' >> prerm |
e85171f5 HG |
96 | echo "echo Running texlinks --unlink" >> prerm |
97 | echo "texlinks --unlink" >> prerm | |
dce832a2 HG |
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 | |
e85171f5 HG |
102 | echo "exit 0" >> prerm |
103 | chmod 0755 prerm | |
cb2a32e4 | 104 | } |
a3e89a2e HG |
105 | |
106 | # Files to rm, first from texlive-$_MAJOR_VERSION-extra and then from install-tl-unx | |
107 | TERMUX_PKG_RM_AFTER_INSTALL=" | |
108 | share/texlive/README | |
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 | |
de4d50a7 | 151 | share/texlive/tlpkg/tlpostcode/ptex2pdf-tlpost.pl |
f547c930 HG |
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" |