## You can also install it like this, but my paranoia will not let me
## do that sort of thing without at least looking at the script first:
# curl -sSL https://get.haskellstack.org/ | sh
## or
# wget -qO- https://get.haskellstack.org/ | sh
## If you ever want to uninstall stack, run this as whatever user you've
## been running it as, to see where it is:
# stack path --stack-root
## and then to actually do it as that same user:
# stack uninstall
# Create ~/.local/bin which is where it will put binaries
mkdir -p -m 0700 ~/.local/bin
# Get the 64-bit binary release tarball
cd
test -f installed/stack-3.3.1-linux-x86_64.tar.gz &&
mv -f installed/stack-3.3.1-linux-x86_64.tar.gz .
test ! -f stack-3.3.1-linux-x86_64.tar.gz &&
wget https://github.com/commercialhaskell/stack/releases/download/v3.3.1/\
stack-3.3.1-linux-x86_64.tar.gz
# Verify tarball w/ sha256sum:
# (this came from my tarball, only proves yours is the same as mine)
echo "88d7e517342c125b0a098d9d578fe53e590618ae4b2427283a27408a1ebd06\
d8 stack-3.3.1-linux-x86_64.tar.gz" | sha256sum -c
# Extract it
mkdir -p -m 0700 ~/src
cd ~/src
tar xzvf ~/stack-3.3.1-linux-x86_64.tar.gz
cd stack-3.3.1-linux-x86_64
test $UID = 0 && chown -R root:root .
# See documentation in ./doc/
# Convert those files to other formats with pandoc
# Become root to install it
su
# Install the stack binary in /usr/local/bin
install -s -m 755 -o 0 -g 0 stack /usr/local/bin/
# Update your PATH to include ~/.local/bin
echo '#!/bin/sh' > /etc/profile.d/stack.sh
echo 'test -d "$HOME/.local/bin" && PATH=$HOME/.local/bin:$PATH' >> \
/etc/profile.d/stack.sh
chmod 755 /etc/profile.d/stack.sh
# Become your non-root user again
exit
# Save the binary tarball for later
cd
mkdir -p -m 0700 installed
rm -f installed/stack-*-linux-x86_64.tar.gz
mv -f stack-3.3.1-linux-x86_64.tar.gz installed/