Skip to content

Instantly share code, notes, and snippets.

@pmolodo
Last active June 6, 2024 18:26
Show Gist options
  • Save pmolodo/ebbcda4b775c931c0fc3e56040cfabed to your computer and use it in GitHub Desktop.
Save pmolodo/ebbcda4b775c931c0fc3e56040cfabed to your computer and use it in GitHub Desktop.
Installing stgit / stg / stackedgit from source (because ubuntu package is way out of date - 0.19)
#!/bin/bash
set -e
set -u
# install rust
if ! which cargo >/dev/null 2>&1 ; then
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
fi
# install other build pre-reqs
# ...if you don't want to build/install docmentation, you can omit `xmlto`
sudo apt-get install libssl-dev xmlto
# if you don't want to install documentation, you can skip this - may not be
# needed if you're using the system python
if ! python -m "import asciidoc" > /dev/null 2>&1 ; then
pip install asciidoc
fi
# where you want to clone the stgit source repo to
repo_parent=/src/_external
# where you want to install to
stgit_install_prefix=~/.local
if ! [ -d "${repo_parent}/stgit" ]; then
mkdir -p "${repo_parent}"
cd ${repo_parent}
git clone https://github.com/stacked-git/stgit.git
fi
cd "${repo_parent}/stgit"
# if you don't want to install everything, you can instead use these targets:
# - install
# - install-man
# - install-completion
# - install-html
make "prefix=${stgit_install_prefix}" install-all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment