Created
January 7, 2022 09:57
-
-
Save juhp/a9c49281a8e478eb9af30a78a87ab0d7 to your computer and use it in GitHub Desktop.
script to setup stack symlinks to fedora ghcX.Y
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
VERSION=$1 | |
#FIXME lib | |
if [ -z "$VERSION" ]; then | |
echo "Usage: $0 X.Y.Z" | |
exit 1 | |
fi | |
LIBDIR=/usr/lib64/ghc-$VERSION | |
if [ ! -d "$LIBDIR" ]; then | |
echo "$LIBDIR does not exist: please install ghcX.Y first" | |
exit 1 | |
fi | |
# FIXME arch | |
STACK_PROGRAMS=$HOME/.stack/programs/$(arch)-linux | |
STACK_GHCDIR=${STACK_PROGRAMS}/ghc-tinfo6-$VERSION | |
if [ -e "$STACK_GHCDIR" ]; then | |
echo "$STACK_GHCDIR exists: please remove first" | |
exit 1 | |
fi | |
mkdir -p $STACK_GHCDIR/bin | |
for i in ghc ghc-pkg ghci hp2ps hpc hsc2hs runghc runhaskell; do | |
if [ -x /usr/bin/$i-$VERSION ]; then | |
ln -s /usr/bin/$i-$VERSION $STACK_GHCDIR/bin/$i | |
else | |
ln -s /usr/bin/$i $STACK_GHCDIR/bin/$i | |
fi | |
done | |
ln -s /usr/bin/haddock-ghc-$VERSION $STACK_GHCDIR/bin/haddock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment