ghcup-hs/scripts/dev/refreeze.sh

42 lines
1.0 KiB
Bash
Raw Permalink Normal View History

2021-07-13 13:17:12 +00:00
#!/bin/sh
set -xue
rm -f cabal.*.project
rm -f cabal.*.project.freeze
for ghc_ver in "$@" ; do
# shellcheck disable=SC3060
project_file=cabal.ghc${ghc_ver//./}.project
case "$(uname -s)" in
MSYS*|MINGW*)
2024-03-16 09:56:01 +00:00
# shellcheck disable=SC3060
project_file_os=cabal.ghc${ghc_ver//./}.Win32.project
cp cabal.project "${project_file_os}"
cabal freeze --project-file="${project_file_os}" -w "ghc-${ghc_ver}" -ftui
2021-07-13 13:17:12 +00:00
;;
*)
2024-03-16 09:56:01 +00:00
# shellcheck disable=SC3060
project_file_os=cabal.ghc${ghc_ver//./}.Unix.project
cp cabal.project "${project_file_os}"
cabal freeze --project-file="${project_file_os}" -w "ghc-${ghc_ver}" -ftui -finternal-downloader
2021-07-13 13:17:12 +00:00
;;
esac
2024-03-16 09:56:01 +00:00
sed -i -e '/ghcup/d' "${project_file_os}".freeze
2021-07-13 13:17:12 +00:00
2024-03-16 09:56:01 +00:00
cat <<EOF > "${project_file}" || die
if os(mingw32)
import: cabal.ghc${ghc_ver//./}.Win32.project
import: cabal.ghc${ghc_ver//./}.Win32.project.freeze
else
import: cabal.ghc${ghc_ver//./}.Unix.project
import: cabal.ghc${ghc_ver//./}.Unix.project.freeze
with-compiler: ghc-${ghc_ver}
EOF
2021-07-13 13:17:12 +00:00
done
2024-03-16 09:32:38 +00:00