Skip to content

Commit

Permalink
fixup: ghc and cabal install by ghcup
Browse files Browse the repository at this point in the history
  • Loading branch information
harendra-kumar committed Dec 15, 2023
1 parent 47fd3fe commit 3ee3596
Showing 1 changed file with 37 additions and 18 deletions.
55 changes: 37 additions & 18 deletions packcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -916,23 +916,31 @@ ensure_ghc() {
found=$?
if test "$found" -ne 0
then
find_binary "$COMPILER-$GHCVER" "$GHCVER"
found=$?
if test "$found" -eq 0
if test -n "$GHCVER"
then
find_binary "$COMPILER-$GHCVER" "$GHCVER"
found=$?
if test "$found" -eq 0
then
COMPILER="$COMPILER-$GHCVER"
fi
fi

if test "$found" -ne 0
then
COMPILER="$COMPILER-$GHCVER"
else
if test -n "$(need_stack)"
then
# Use stack supplied ghc
echo "$STACKCMD setup"
retry_cmd $STACKCMD setup || die "stack setup falied"
use_stack_paths
echo
elif test -n "$GHCUPVER"
then
else
ghcup_install ghc $GHCVER
COMPILER="$COMPILER-$GHCVER"
if test -n "$GHCVER"
then
COMPILER="$COMPILER-$GHCVER"
fi
fi
fi
fi
Expand Down Expand Up @@ -1071,18 +1079,29 @@ ensure_cabal() {
found=$?
if test "$found" -ne 0
then
find_binary "$CABAL_BINARY_NAME-$CABALVER" "$CABALVER"
found=$?
if test "$found" -eq 0
if test -n "$CABALVER"
then
CABAL_BINARY_NAME="$CABAL_BINARY_NAME-$CABALVER"
elif test -n "$(need_stack)"
then
stack_install_tool cabal-install
elif test -n "$GHCUPVER"
find_binary "$CABAL_BINARY_NAME-$CABALVER" "$CABALVER"
found=$?
if test "$found" -eq 0
then
CABAL_BINARY_NAME="$CABAL_BINARY_NAME-$CABALVER"
fi
fi

if test "$found" -ne 0
then
ghcup_install cabal $CABALVER
CABAL_BINARY_NAME="$CABAL_BINARY_NAME-$CABALVER"
if test -n "$(need_stack)"
then
stack_install_tool cabal-install
elif test -n "$GHCUPVER"
then
ghcup_install cabal $CABALVER
if test -n "$CABALVER"
then
CABAL_BINARY_NAME="$CABAL_BINARY_NAME-$CABALVER"
fi
fi
fi
fi

Expand Down

0 comments on commit 3ee3596

Please sign in to comment.