ghcup-hs/.gitlab/script/ghcup_version.sh

62 lines
1.1 KiB
Bash
Raw Normal View History

2020-04-15 07:45:18 +00:00
#!/bin/sh
set -eux
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
mkdir -p "$CI_PROJECT_DIR"/.local/bin
ecabal() {
cabal --store-dir="$(pwd)"/.store "$@"
}
2020-04-15 13:07:37 +00:00
eghcup() {
ghcup -v -c -s file://$(pwd)/ghcup-${JSON_VERSION}.json "$@"
}
2020-04-15 07:45:18 +00:00
# build
ecabal update
if [ "${OS}" = "DARWIN" ] ; then
ecabal build -fcurl
else
ecabal build
fi
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup')" .
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" .
# testing
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
cp ./ghcup-gen "$CI_PROJECT_DIR"/.local/bin/ghcup-gen
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
ghcup-gen check -f ghcup-${JSON_VERSION}.json
2020-04-15 13:07:37 +00:00
eghcup numeric-version
2020-04-15 07:45:18 +00:00
2020-04-15 13:07:37 +00:00
eghcup install ${GHC_VERSION}
eghcup set ${GHC_VERSION}
eghcup install-cabal
2020-04-15 07:45:18 +00:00
cabal --version
2020-04-15 13:07:37 +00:00
eghcup debug-info
2020-04-15 07:45:18 +00:00
2020-04-15 13:07:37 +00:00
eghcup list
eghcup list -t ghc
eghcup list -t cabal
2020-04-15 07:45:18 +00:00
ghc --version
ghci --version
ghc-$(ghc --numeric-version) --version
ghci-$(ghc --numeric-version) --version
2020-04-15 13:36:03 +00:00
eghcup rm $(ghc --numeric-version)
2020-04-15 13:07:37 +00:00
eghcup upgrade
eghcup upgrade -f
2020-04-15 07:45:18 +00:00