summaryrefslogtreecommitdiff
path: root/setup_texlive.sh
diff options
context:
space:
mode:
authorMatthew Sotoudeh <matthewsot@outlook.com>2020-04-13 08:40:01 -0700
committerMatthew Sotoudeh <matthewsot@outlook.com>2020-04-13 08:40:01 -0700
commit96e12c8a274ea3e08648116f3fb052e3de005560 (patch)
treecc419696e4e062fc7173876073598c98cae0aa63 /setup_texlive.sh
parent229b0f318e0160013c9c5700a22cc13da37fdcd8 (diff)
Initial code release
Diffstat (limited to 'setup_texlive.sh')
-rwxr-xr-xsetup_texlive.sh49
1 files changed, 49 insertions, 0 deletions
diff --git a/setup_texlive.sh b/setup_texlive.sh
new file mode 100755
index 0000000..5a553b0
--- /dev/null
+++ b/setup_texlive.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+
+if [ $# -ne 1 ] && [ $# -ne 2 ]; then
+ echo "This is $(basename $0). Usage:"
+ echo "$(basename $0) [/path/to/texlive2019-20190410-iso/mounted] [/path/to/install/directory]"
+ exit 1
+fi
+
+texlive_mount=$1
+install_dir=$2
+
+read -p "Installing TeX Live. This will *OVERWRITE* $install_dir. Continue? [y/N] " -r
+if [[ $REPLY =~ ^[Yy]$ ]]
+then
+ rm -rf $install_dir
+ mkdir -p $install_dir
+
+ infile=$(mktemp)
+ echo "I" > $infile
+
+ if which tlmgr
+ then
+ echo "I" >> $infile
+ fi
+
+ pushd $texlive_mount
+ cat $infile | \
+ TEXLIVE_INSTALL_PREFIX=$install_dir \
+ ./install-tl -no-gui -portable -scheme full
+ popd
+
+ rm $infile
+
+ # TeXLive will make different bin directories depending on the
+ # OS; this overrides that to be just x86_64.
+ tmpdir=$(mktemp -d)
+ mv $install_dir/bin/*/* $tmpdir
+ rm -rf $install_dir/bin/*
+ mkdir $install_dir/bin/x86_64
+ mv $tmpdir/* $install_dir/bin/x86_64
+ rm -rf $tmpdir
+
+ echo "Success!"
+ echo "Writing Installation Directory to $HOME/.bazelrc"
+ echo "build --define TEXLIVE_FULL_DIR=$install_dir" >> ~/.bazelrc
+ echo "run --define TEXLIVE_FULL_DIR=$install_dir" >> ~/.bazelrc
+else
+ echo "Aborting."
+fi
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback