Skip to content

Instantly share code, notes, and snippets.

@SpotlightKid
Last active July 9, 2020 00:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SpotlightKid/565d20de72641dbbe1d332b57df3d7af to your computer and use it in GitHub Desktop.
Save SpotlightKid/565d20de72641dbbe1d332b57df3d7af to your computer and use it in GitHub Desktop.
Install script for Vital Linux binaries archive
#!/bin/bash -e
#
# Install script for Vital Linux binaries archive
#
# Installs everything under the user's home directory by default.
# Set the environment variables LV2_DIR, BIN_DIR and DATA_DIR
# to change install locations. e.g.:
#
# $ LV2_DIR=/usr/local/lib/lv2 ./vital-install.sh
#
LV2_DIR="${LV2_DIR:-$HOME/.lv2}"
BIN_DIR="${BIN_DIR:-$HOME/bin}"
DATA_DIR="${DATA_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/vital}"
if [[ ! -e "./VitalInstaller.zip" ]]; then
echo "There's no VitalInstaller.zip in the current directory! Exiting"
exit 1
fi
EXTRACT_DIR="$(mktemp --directory --tmpdir vital-install-XXXXXX)"
unzip -q VitalInstaller.zip -d "${EXTRACT_DIR}"
echo "Installing stand-alone binary as ${BIN_DIR}/vital ..."
install -Dm755 "${EXTRACT_DIR}"/VitalBinaries/vital -t "${BIN_DIR}"
echo "Installing plugin LV2 bundles to ${LV2_DIR} ..."
for plugin in Vital VitalFX; do
echo "Installing ${plugin}.lv2 ..."
install -Dm644 "${EXTRACT_DIR}"/VitalBinaries/${plugin}.lv2/*.ttl -t "${LV2_DIR}"/${plugin}.lv2
install -Dm755 "${EXTRACT_DIR}"/VitalBinaries/${plugin}.lv2/*.so -t "${LV2_DIR}"/${plugin}.lv2
done
echo "Installing data to ${DATA_DIR} ..."
install -dm755 "${DATA_DIR}"
rsync -qav --update "${EXTRACT_DIR}"/VitalBinaries/content/* "${DATA_DIR}"
# remove extracted archive contents
rm -rf "${EXTRACT_DIR}"
echo
echo "All done!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment