From 96e12c8a274ea3e08648116f3fb052e3de005560 Mon Sep 17 00:00:00 2001 From: Matthew Sotoudeh Date: Mon, 13 Apr 2020 08:40:01 -0700 Subject: Initial code release --- setup_texlive.sh | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 setup_texlive.sh (limited to 'setup_texlive.sh') 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 -- cgit v1.2.3