texlive: fix installation issues and reported shebang issue (#957)
[termux-packages] / packages / texlive / termux-install-tl.sh
CommitLineData
d415b125 1
2TL_VERSION=2016
3TL_ROOT=$PREFIX/opt/texlive
4
5export TMPDIR=$PREFIX/tmp/
6mkdir -p $TMPDIR/termux-tl-installer
7cd $TMPDIR/termux-tl-installer
8
099d4d49 9wget http://mirror.ctan.org/systems/texlive/Source/install-tl-unx.tar.gz -O install-tl-unx.tar.gz
d415b125 10tar xzfv install-tl-unx.tar.gz > flist
11
12cd $(head -1 flist)
13
14#patch install-tl
15sed -E -i "s@/bin/sh@$PREFIX/bin/sh@" tlpkg/TeXLive/TLUtils.pm
d8a7fd1e 16
d415b125 17cat > texlive_inst.profile << XXHEREXX
18
19selected_scheme scheme-custom
20TEXDIR ${TL_ROOT}/${TL_VERSION}
21TEXMFCONFIG ~/.texlive${TL_VERSION}/texmf-config
22TEXMFHOME ~/texmf
23TEXMFLOCAL ${TL_ROOT}/texmf-local
24TEXMFSYSCONFIG ${TL_ROOT}/${TL_VERSION}/texmf-config
25TEXMFSYSVAR ${TL_ROOT}/${TL_VERSION}/texmf-var
26TEXMFVAR ~/.texlive${TL_VERSION}/texmf-var
27collection-basic 1
28collection-latex 1
29collection-luatex 1
30in_place 0
31option_adjustrepo 1
32option_autobackup 1
33option_backupdir tlpkg/backups
34option_desktop_integration 0
35option_doc 0
36option_file_assocs 0
37option_fmt 1
38option_letter 0
39option_menu_integration 1
40option_path 0
41option_post_code 1
42option_src 0
43option_sys_bin $PREFIX/bin
44option_sys_info $PREFIX/local/share/info
45option_sys_man $PREFIX/local/share/man
46option_w32_multi_user 0
47option_write18_restricted 1
48portable 0
49
50XXHEREXX
51
52#start installer with a profile and premade binaries
53perl ./install-tl --custom-bin=$TL_ROOT/${TL_VERSION}/bin/pkg --profile texlive_inst.profile
54
55mkdir -p $PREFIX/etc/profile.d/
56
57cat > $PREFIX/etc/profile.d/texlive.sh << XXHEREXX
58export PATH=\$PATH:$TL_ROOT/${TL_VERSION}/bin/custom
59export TMPDIR=$PREFIX/tmp/
60XXHEREXX
61
62#fix tlpkg
63sed -E -i "s@/bin/sh@$PREFIX/bin/sh@" ${TL_ROOT}/${TL_VERSION}/tlpkg/TeXLive/TLUtils.pm
64
29b48a56
HG
65#fix shebangs
66sed -i -E "1 s@^#\!(.*)/[sx]?bin/(.*)@#\!$PREFIX/bin/\2@" ${TL_ROOT}/${TL_VERSION}/texmf-dist/web2c/*
67sed -i -E "1 s@^#\!(.*)/[sx]?bin/(.*)@#\!$PREFIX/bin/\2@" ${TL_ROOT}/${TL_VERSION}/bin/custom/*
68
d415b125 69#source the environment
70. $PREFIX/etc/profile.d/texlive.sh
71
72#setup links
73texlinks
74
29b48a56 75rm -rf $TMPDIR/termux-tl-installer