Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • haskell/ghcup
  • Araneidae/ghcup
  • leif/ghcup
  • trac-gershomb/ghcup
  • glguy/ghcup
  • fommil/ghcup
  • josephcsible/ghcup
  • NickSeagull/ghcup
  • toonn/ghcup
  • yaxu/ghcup
  • liftM/ghcup
  • twitchard/ghcup
  • Janfel/ghcup
  • Olius/ghcup
  • polyrand/ghcup
  • trac-bpfoley/ghcup
  • jlombera/ghcup
  • ArturGajowy/ghcup
18 results
Show changes
Commits on Source (112)
Showing
with 881 additions and 195 deletions
...@@ -9,16 +9,24 @@ ...@@ -9,16 +9,24 @@
# #
# tool | version | tag | # tool | version | tag |
ghc 7.10.3 7.10
ghc 8.0.2 8.0 ghc 8.0.2 8.0
ghc 8.2.2 8.2 ghc 8.2.2 8.2
ghc 8.4.1
ghc 8.4.2
ghc 8.4.3 ghc 8.4.3
ghc 8.4.4 8.4 ghc 8.4.4 8.4
ghc 8.6.1 bad ghc 8.6.1 bad
ghc 8.6.2 ghc 8.6.2
ghc 8.6.3 ghc 8.6.3
ghc 8.6.4 ghc 8.6.4
ghc 8.6.5 latest,recommended,8.6 ghc 8.6.5 8.6
ghc 8.8.1
ghc 8.8.2
ghc 8.8.3 recommended,8.8
ghc 8.10.1 latest,8.10
cabal-install 2.2.0.0 cabal-install 2.2.0.0
cabal-install 2.4.0.0 cabal-install 2.4.0.0
cabal-install 2.4.1.0 latest,recommended cabal-install 2.4.1.0
cabal-install 3.0.0.0
cabal-install 3.2.0.0 latest,recommended
...@@ -13,6 +13,15 @@ ...@@ -13,6 +13,15 @@
# #
# tool | version | arch | supported-distros for given url | url | # tool | version | arch | supported-distros for given url | url |
ghc 7.10.3 x86_64 centos=6,centos,amazonlinux https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-x86_64-centos67-linux.tar.bz2
ghc 7.10.3 i386 centos=6,centos,amazonlinux https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-i386-centos67-linux.tar.bz2
ghc 7.10.3 x86_64 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-x86_64-deb8-linux.tar.bz2
ghc 7.10.3 i386 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-i386-deb8-linux.tar.bz2
ghc 7.10.3 x86_64 darwin https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-x86_64-apple-darwin.tar.bz2
ghc 7.10.3 x86_64 freebsd=9,freebsd=10,freebsd=11 https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-x86_64-portbld-freebsd.tar.bz2
ghc 7.10.3 i386 freebsd=9,freebsd=10,freebsd=11 https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-i386-portbld-freebsd.tar.bz2
ghc 7.10.3 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-7.10.3-musl/ghc-7.10.3-x86_64-unknown-linux-musl.tar.xz
ghc 8.0.2 x86_64 debian=7 https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-deb7-linux.tar.xz ghc 8.0.2 x86_64 debian=7 https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-deb7-linux.tar.xz
ghc 8.0.2 i386 debian=7 https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-i386-deb7-linux.tar.xz ghc 8.0.2 i386 debian=7 https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-i386-deb7-linux.tar.xz
ghc 8.0.2 x86_64 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-deb8-linux.tar.xz ghc 8.0.2 x86_64 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-x86_64-deb8-linux.tar.xz
...@@ -31,6 +40,23 @@ ghc 8.2.2 x86_64 darwin https://downl ...@@ -31,6 +40,23 @@ ghc 8.2.2 x86_64 darwin https://downl
ghc 8.2.2 x86_64 freebsd=10 https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-x86_64-portbld10_3-freebsd.tar.xz ghc 8.2.2 x86_64 freebsd=10 https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-x86_64-portbld10_3-freebsd.tar.xz
ghc 8.2.2 x86_64 freebsd=11 https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-x86_64-portbld11-freebsd.tar.xz ghc 8.2.2 x86_64 freebsd=11 https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-x86_64-portbld11-freebsd.tar.xz
ghc 8.4.1 i386 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-i386-deb8-linux.tar.xz
ghc 8.4.1 x86_64 debian=8,debian https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-x86_64-deb8-linux.tar.xz
ghc 8.4.1 x86_64 fedora=27,fedora,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-x86_64-fedora27-linux.tar.xz
ghc 8.4.1 x86_64 darwin https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-x86_64-apple-darwin.tar.xz
ghc 8.4.1 x86_64 freebsd=11,freebsd https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-x86_64-portbld11-freebsd.tar.xz
ghc 8.4.1 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.4.1-musl/ghc-8.4.1-i386-unknown-linux-musl.tar.xz
ghc 8.4.1 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.4.1-musl/ghc-8.4.1-x86_64-unknown-linux-musl.tar.xz
ghc 8.4.2 i386 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-i386-deb8-linux.tar.xz
ghc 8.4.2 x86_64 debian=8 https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-x86_64-deb8-linux.tar.xz
ghc 8.4.2 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04,mint https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-x86_64-deb9-linux.tar.xz
ghc 8.4.2 x86_64 fedora=27,fedora,ubuntu,unknown https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-x86_64-fedora27-linux.tar.xz
ghc 8.4.2 x86_64 darwin https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-x86_64-apple-darwin.tar.xz
ghc 8.4.2 x86_64 freebsd https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-x86_64-portbld-freebsd.tar.xz
ghc 8.4.2 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.4.2-musl/ghc-8.4.2-i386-unknown-linux-musl.tar.xz
ghc 8.4.2 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.4.2-musl/ghc-8.4.2-x86_64-unknown-linux-musl.tar.xz
ghc 8.4.3 i386 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-i386-deb8-linux.tar.xz ghc 8.4.3 i386 debian=8,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-i386-deb8-linux.tar.xz
ghc 8.4.3 x86_64 debian=8 https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-x86_64-deb8-linux.tar.xz ghc 8.4.3 x86_64 debian=8 https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-x86_64-deb8-linux.tar.xz
ghc 8.4.3 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04,mint https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-x86_64-deb9-linux.tar.xz ghc 8.4.3 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04,mint https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-x86_64-deb9-linux.tar.xz
...@@ -92,6 +118,41 @@ ghc 8.6.5 x86_64 darwin https://downl ...@@ -92,6 +118,41 @@ ghc 8.6.5 x86_64 darwin https://downl
ghc 8.6.5 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.6.5-musl/ghc-8.6.5-i386-unknown-linux-musl.tar.xz ghc 8.6.5 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.6.5-musl/ghc-8.6.5-i386-unknown-linux-musl.tar.xz
ghc 8.6.5 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.6.5-musl/ghc-8.6.5-x86_64-unknown-linux-musl.tar.xz ghc 8.6.5 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.6.5-musl/ghc-8.6.5-x86_64-unknown-linux-musl.tar.xz
ghc 8.8.1 i386 debian=9,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-i386-deb9-linux.tar.xz
ghc 8.8.1 x86_64 debian=8 https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-deb8-linux.tar.xz
ghc 8.8.1 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04,mint https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-deb9-linux.tar.xz
ghc 8.8.1 x86_64 fedora=27,fedora,ubuntu,unknown https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-fedora27-linux.tar.xz
ghc 8.8.1 x86_64 centos=7,centos,amazonlinux https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-centos7-linux.tar.xz
ghc 8.8.1 x86_64 darwin https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-x86_64-apple-darwin.tar.xz
ghc 8.8.1 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.1-musl/ghc-8.8.1-i386-unknown-linux-musl.tar.xz
ghc 8.8.1 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.1-musl/ghc-8.8.1-x86_64-unknown-linux-musl.tar.xz
ghc 8.8.2 i386 debian=9,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-i386-deb9-linux.tar.xz
ghc 8.8.2 x86_64 debian=8 https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-deb8-linux.tar.xz
ghc 8.8.2 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04,mint https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-deb9-linux.tar.xz
ghc 8.8.2 x86_64 fedora=27,fedora,ubuntu,unknown https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-fedora27-linux.tar.xz
ghc 8.8.2 x86_64 centos=7,centos,amazonlinux https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-centos7-linux.tar.xz
ghc 8.8.2 x86_64 darwin https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-x86_64-apple-darwin.tar.xz
ghc 8.8.2 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.2-musl/ghc-8.8.2-i386-unknown-linux-musl.tar.xz
ghc 8.8.2 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.2-musl/ghc-8.8.2-x86_64-unknown-linux-musl.tar.xz
ghc 8.8.3 i386 debian=9,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-i386-deb9-linux.tar.xz
ghc 8.8.3 x86_64 debian=8 https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-deb8-linux.tar.xz
ghc 8.8.3 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04,mint https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-deb9-linux.tar.xz
ghc 8.8.3 x86_64 fedora=27,fedora,ubuntu,unknown https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-fedora27-linux.tar.xz
ghc 8.8.3 x86_64 centos=7,centos,amazonlinux https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-centos7-linux.tar.xz
ghc 8.8.3 x86_64 darwin https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-x86_64-apple-darwin.tar.xz
ghc 8.8.3 i386 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.3-musl/ghc-8.8.3-i386-unknown-linux-musl.tar.xz
ghc 8.8.3 x86_64 alpine https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.3-musl/ghc-8.8.3-x86_64-unknown-linux-musl.tar.xz
ghc 8.10.1 i386 debian=9,debian,ubuntu,mint,unknown https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-i386-deb9-linux.tar.xz
ghc 8.10.1 x86_64 debian=9,debian,ubuntu=16.04,ubuntu=18.04 https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-deb9-linux.tar.xz
ghc 8.10.1 x86_64 debian=10,mint https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-deb10-linux.tar.xz
ghc 8.10.1 x86_64 fedora=27,fedora,ubuntu,unknown https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-fedora27-linux.tar.xz
ghc 8.10.1 x86_64 centos=7,centos,amazonlinux https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-centos7-linux.tar.xz
ghc 8.10.1 x86_64 darwin https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-apple-darwin.tar.xz
ghc 8.10.1 x86_64 alpine https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-x86_64-alpine3.10-linux-integer-simple.tar.xz
cabal-install 2.2.0.0 i386 unknown https://downloads.haskell.org/~cabal/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-linux.tar.gz cabal-install 2.2.0.0 i386 unknown https://downloads.haskell.org/~cabal/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-linux.tar.gz
cabal-install 2.2.0.0 x86_64 darwin https://downloads.haskell.org/~cabal/cabal-install-2.2.0.0/cabal-install-2.2.0.0-x86_64-apple-darwin-sierra.tar.gz cabal-install 2.2.0.0 x86_64 darwin https://downloads.haskell.org/~cabal/cabal-install-2.2.0.0/cabal-install-2.2.0.0-x86_64-apple-darwin-sierra.tar.gz
cabal-install 2.2.0.0 x86_64 unknown https://downloads.haskell.org/~cabal/cabal-install-2.2.0.0/cabal-install-2.2.0.0-x86_64-unknown-linux.tar.gz cabal-install 2.2.0.0 x86_64 unknown https://downloads.haskell.org/~cabal/cabal-install-2.2.0.0/cabal-install-2.2.0.0-x86_64-unknown-linux.tar.gz
...@@ -105,3 +166,11 @@ cabal-install 2.4.1.0 x86_64 darwin https://downl ...@@ -105,3 +166,11 @@ cabal-install 2.4.1.0 x86_64 darwin https://downl
cabal-install 2.4.1.0 x86_64 alpine https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-alpine-linux-musl.tar.xz cabal-install 2.4.1.0 x86_64 alpine https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-alpine-linux-musl.tar.xz
cabal-install 2.4.1.0 i386 unknown https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz cabal-install 2.4.1.0 i386 unknown https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-i386-unknown-linux.tar.xz
cabal-install 2.4.1.0 x86_64 unknown https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz cabal-install 2.4.1.0 x86_64 unknown https://downloads.haskell.org/cabal/cabal-install-2.4.1.0/cabal-install-2.4.1.0-x86_64-unknown-linux.tar.xz
cabal-install 3.0.0.0 x86_64 darwin https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-apple-darwin17.7.0.tar.xz
cabal-install 3.0.0.0 i386 unknown https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-i386-unknown-linux.tar.xz
cabal-install 3.0.0.0 x86_64 unknown https://downloads.haskell.org/cabal/cabal-install-3.0.0.0/cabal-install-3.0.0.0-x86_64-unknown-linux.tar.xz
cabal-install 3.2.0.0 x86_64 darwin https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-apple-darwin17.7.0.tar.xz
cabal-install 3.2.0.0 i386 unknown https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-i386-unknown-linux.tar.xz
cabal-install 3.2.0.0 x86_64 unknown https://downloads.haskell.org/cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz
#!/bin/sh
edo()
{
printf "\\033[0;34m%s\\033[0m\\n" "$*" 1>&2
"$@" || exit 2
}
GHCUP_META_DOWNLOAD_URL="file://$(pwd)/.download-urls"
export GHCUP_META_DOWNLOAD_URL
GHCUP_META_VERSION_URL="file://$(pwd)/.available-versions"
export GHCUP_META_VERSION_URL
# dependencies
edo sudo apt-get update -y
edo sudo apt-get install -y libnuma-dev
# install GHCs
edo ./ghcup -v install 8.2.2
edo ./ghcup -v install 8.4.3
edo ./ghcup -v -c install 8.6.1
# set GHC
edo ./ghcup -v set 8.6.1
edo ./ghcup -v set 8.4.3
# rm GHC
edo ./ghcup -v rm -f 8.6.1
edo ./ghcup -v rm -f 8.4.3
# reinstall from cached tarball
edo ./ghcup -v -c install 8.6.1
edo ./ghcup -v rm -f 8.6.1
# set GHC
edo ./ghcup -v set 8.2.2
edo ./ghcup -v rm -f 8.2.2
# install default GHC
edo ./ghcup -v install
edo ./ghcup -v set
# install latest GHC
edo ./ghcup -v install latest
export PATH="$HOME/.cabal/bin:$HOME/.ghcup/bin:$HOME/.local/bin:$PATH"
edo mkdir -p "$HOME"/.local/bin
edo cp ./ghcup "$HOME"/.local/bin/ghcup
# TODO: exceeds maximum time limit of travis
# compile GHC from source
#./ghcup -v compile 8.4.3 ghc-8.2.2
# install cabal-install
edo ghcup -v install-cabal
edo cabal --version
# install shellcheck
edo wget https://storage.googleapis.com/shellcheck/shellcheck-latest.linux.x86_64.tar.xz
edo tar -xJf shellcheck-latest.linux.x86_64.tar.xz
edo mv shellcheck-latest/shellcheck "$HOME"/.local/bin/shellcheck
# check our script for errors
edo shellcheck ghcup
edo ghcup -v debug-info
edo ghcup -v list
edo ghcup -v list -t ghc
edo ghcup -v list -t cabal-install
edo ghc --version
# self update destructively
edo ghcup -v upgrade
...@@ -8,10 +8,227 @@ variables: ...@@ -8,10 +8,227 @@ variables:
# CI Step # CI Step
############################################################ ############################################################
test: .debian:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV" image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
script:
- ./.github-ci.sh
dependencies: []
tags: tags:
- x86_64-linux - x86_64-linux
.darwin:
tags:
- x86_64-darwin
.test_ghcup_version:
script:
- ./.gitlab/script/ghcup_version.sh
.test_ghcup_version:linux:
extends:
- .test_ghcup_version
- .debian
before_script:
- ./.gitlab/before_script/linux/install_deps.sh
.test_ghcup_version:darwin:
extends:
- .test_ghcup_version
- .darwin
before_script:
- ./.gitlab/before_script/darwin/install_deps.sh
######## shellcheck ########
test:shellcheck:
extends: .debian
before_script:
- ./.gitlab/before_script/linux/install_shellcheck.sh
script: ./.gitlab/script/shellcheck.sh
######## tarball caching ########
test:tarball_cache:
extends: .debian
variables:
GHC_VERSION: "8.6.5"
script:
- ./.gitlab/script/ghcup_cached_tarball.sh
######## linux ########
test:linux:recommended:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "recommended"
test:linux:latest:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "latest"
test:linux:8.0.2:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.0.2"
test:linux:8.2.2:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.2.2"
test:linux:8.4.1:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.4.1"
test:linux:8.4.2:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.4.2"
test:linux:8.4.3:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.4.3"
test:linux:8.4.4:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.4.4"
test:linux:8.6.1:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.6.1"
test:linux:8.6.2:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.6.2"
test:linux:8.6.3:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.6.3"
test:linux:8.6.4:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.6.4"
test:linux:8.6.5:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.6.5"
test:linux:8.8.1:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.8.1"
test:linux:8.8.2:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.8.2"
test:linux:8.8.3:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.8.3"
test:linux:8.10.1:
extends: .test_ghcup_version:linux
variables:
GHC_VERSION: "8.10.1"
######## darwin ########
test:mac:recommended:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "recommended"
test:mac:latest:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "latest"
test:mac:8.0.2:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.0.2"
test:mac:8.2.2:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.2.2"
test:mac:8.4.1:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.4.1"
test:mac:8.4.2:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.4.2"
test:mac:8.4.3:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.4.3"
test:mac:8.4.4:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.4.4"
test:mac:8.6.1:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.6.1"
# TODO: dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
allow_failure: true
test:mac:8.6.2:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.6.2"
# TODO: dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
allow_failure: true
test:mac:8.6.3:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.6.3"
test:mac:8.6.4:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.6.4"
test:mac:8.6.5:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.6.5"
test:mac:8.8.1:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.8.1"
test:mac:8.8.2:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.8.2"
test:mac:8.8.3:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.8.3"
test:mac:8.10.1:
extends: .test_ghcup_version:darwin
variables:
GHC_VERSION: "8.10.1"
#!/bin/sh
set -eux
#sudo brew reinstall gmp
exit 0
#!/bin/sh
set -eux
sudo apt-get update -y
sudo apt-get install -y libnuma-dev
#!/bin/sh
set -eux
# install shellcheck
wget https://github.com/koalaman/shellcheck/releases/download/latest/shellcheck-latest.linux.x86_64.tar.xz
tar -xJf shellcheck-latest.linux.x86_64.tar.xz
mkdir -p "$CI_PROJECT_DIR"/.local/bin/
mv shellcheck-latest/shellcheck "$CI_PROJECT_DIR"/.local/bin/shellcheck
GHCUP_META_DOWNLOAD_URL="file://${CI_PROJECT_DIR}/.download-urls"
export GHCUP_META_DOWNLOAD_URL
GHCUP_META_VERSION_URL="file://${CI_PROJECT_DIR}/.available-versions"
export GHCUP_META_VERSION_URL
export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR"
export PATH="$CI_PROJECT_DIR/.ghcup/bin:$CI_PROJECT_DIR/.local/bin:$PATH"
#!/bin/sh
set -eux
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
mkdir -p "$CI_PROJECT_DIR"/.local/bin
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
ghcup -v -c install 8.6.5
test -f "$CI_PROJECT_DIR/.ghcup/cache/ghc-8.6.5-x86_64-deb9-linux.tar.xz"
ghcup -v -c install 8.6.5
#!/bin/sh
set -eux
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
mkdir -p "$CI_PROJECT_DIR"/.local/bin
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
ghcup --version
ghcup -v install ${GHC_VERSION}
ghcup -v set ${GHC_VERSION}
ghcup -v install-cabal
cabal --version
ghcup -v debug-info
ghcup -v list
ghcup -v list -t ghc
ghcup -v list -t cabal-install
ghc --version
ghci --version
ghc-$(ghc --numeric-version) --version
ghci-$(ghc --numeric-version) --version
ghcup -v upgrade
ghcup -v rm -f ${GHC_VERSION}
#!/bin/sh
set -eux
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
shellcheck ghcup
(Note: on OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.) (Note: on OS X, in the course of running ghcup you will be given a dialog box to install the command line tools. Accept and the requirements will be installed for you. You will then need to run the command again.)
\ No newline at end of file
build-essential curl libgmp-dev libffi-dev libncurses-dev build-essential curl libgmp-dev libffi-dev libncurses-dev libtinfo5
# ChangeLog
## [0.0.8](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.8) (2020-01-09)
Release 0.0.8
Distro support:
* add some FreeBSD support
* add linux mint support
* add some redhat support
* add some alpine support
New tool versions:
* GHC: 8.4.1, 8.4.2, 8.6.4, 8.6.5, 8.8.1
* cabal: 3.0.0.0
Commands and API:
* new 'changelog' subcommand added
* 'uprade' subcommand is tweaked':
- add --inplace flag
- by default install into BIN_LOCATION
* new subcommand 'print-system-reqs'
* 'compile' subcommand is now hidden from help menu (since it's only for power-users, use 'ghcup -v --help' to show all commands)
* 'list' subcommand is overhauled and 'show' removed
* allow to overwrite the distro detection system (see 'ghcup -v --help')
* allow to overwrite meta download and meta version files via GHCUP_META_DOWNLOAD_URL and GHCUP_META_VERSION_URL
Fixes:
* clean up interrupted download cache properly
* send debug output to stderr only
* fix bug in bootstrap-haskell causing odd errors
Other:
* introduce major version symlinks (e.g. 8.6 -> 8.6.5) and add x.y tags
* use GHCUP_INSTALL_BASE_PREFIX in bootstrap-haskell
* don't reinstall cabal-install from source in bootstrap-haskell
* various usability improvements in bootstrap-haskell
* add bash-completion script
* add manpage support when using man-db
## [0.0.7](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.7) (2019-01-07)
Release 0.0.7
This release introduces a new way of installing ghcup (and GHC and cabal in the process)
with the infamous `curl .. | sh` pattern. See #36 for discussion. This
is completely optional.
Features:
- Add a bootstrap-haskell script, fixes #36
- Allow to specify tags for `ghcup install`, `ghcup install-cabal` and `ghcup set`
- `ghcup list` also shows tags
- support installing on macOS aka Darwin
- Improve detection logic for CentOS/Alpine/AIX/FreeBSD
- Introduce a GHCUP_INSTALL_BASE_PREFIX env variable to control where `.ghcup` directory will be created
- Add rudimentary support for Amazon Linux
Bugfixes:
- Create missing haddock -> haddock-ghc symlink
- Emit distro-alias inferred in `debug-info` output
- Tweak exit code for `ghcup install` (If a GHC is already installed, we shouldn't treat it as an error)
Cleanups:
- Simplify mkdir calls
- Documentation improvements
- Error handling improvements
API changes:
- `self-update` was renamed to `upgrade`
## [0.0.6](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.6) (2018-10-30)
Release 0.0.6
## [0.0.5](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.5) (2018-10-16)
Release 0.0.5
## [0.0.4](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.4) (2018-10-09)
Release 0.0.4
## [0.0.3](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.3) (2018-09-30)
Release 0.0.3
## [0.0.2](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.2) (2018-09-30)
Release 0.0.2
## [0.0.1](https://gitlab.haskell.org/haskell/ghcup/-/tags/0.0.1) (2018-09-29)
Release 0.0.1
**THIS PROJECT IS NOW DEPRECATED IN FAVOR OF [ghcup-hs](https://gitlab.haskell.org/haskell/ghcup-hs)**
--
`ghcup` makes it easy to install specific versions of `ghc` on GNU/Linux as well as macOS (aka Darwin), and can also bootstrap a fresh Haskell developer environment from scratch. `ghcup` makes it easy to install specific versions of `ghc` on GNU/Linux as well as macOS (aka Darwin), and can also bootstrap a fresh Haskell developer environment from scratch.
It follows the unix UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well). It follows the unix UNIX philosophy of [do one thing and do it well](https://en.wikipedia.org/wiki/Unix_philosophy#Do_One_Thing_and_Do_It_Well).
...@@ -11,6 +15,7 @@ Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [p ...@@ -11,6 +15,7 @@ Similar in scope to [rustup](https://github.com/rust-lang-nursery/rustup.rs), [p
* [Installation](#installation) * [Installation](#installation)
* [Usage](#usage) * [Usage](#usage)
* [Manpages](#manpages)
* [Design goals](#design-goals) * [Design goals](#design-goals)
* [How](#how) * [How](#how)
* [Known users](#known-users) * [Known users](#known-users)
...@@ -78,6 +83,11 @@ cabal new-install cabal-install ...@@ -78,6 +83,11 @@ cabal new-install cabal-install
Generally this is meant to be used with [`cabal-install`](https://hackage.haskell.org/package/cabal-install), which Generally this is meant to be used with [`cabal-install`](https://hackage.haskell.org/package/cabal-install), which
handles your haskell packages and can demand that [a specific version](https://cabal.readthedocs.io/en/latest/nix-local-build.html#cfg-flag---with-compiler) of `ghc` is available, which `ghcup` can do. handles your haskell packages and can demand that [a specific version](https://cabal.readthedocs.io/en/latest/nix-local-build.html#cfg-flag---with-compiler) of `ghc` is available, which `ghcup` can do.
### Manpages
For man pages to work you need [man-db](http://man-db.nongnu.org/) as your `man` provider, then issue `man ghc`. Manpages only work for the currently set ghc.
`MANPATH` may be required to be unset.
## Design goals ## Design goals
1. simplicity 1. simplicity
...@@ -162,4 +172,4 @@ Mainly because the implementation is fairly straight-forward and the script is h ...@@ -162,4 +172,4 @@ Mainly because the implementation is fairly straight-forward and the script is h
5. Why not support windows? 5. Why not support windows?
Portability between linux and windows is difficult. However ghcup doesn't have to be only POSIX based, so a separate windows-specific PowerShell script might be the way to go. Contributions are welcome. Consider using [Chocolatey](https://chocolatey.org/search?q=ghc) or [ghcups](https://github.com/kakkun61/ghcups).
...@@ -15,6 +15,14 @@ edo() ...@@ -15,6 +15,14 @@ edo()
"$@" || die "\"$*\" failed!" "$@" || die "\"$*\" failed!"
} }
eghcup() {
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
edo ghcup "$@"
else
edo ghcup --verbose "$@"
fi
}
echo echo
echo "Welcome to Haskell!" echo "Welcome to Haskell!"
echo echo
...@@ -32,61 +40,116 @@ echo "PATH components." ...@@ -32,61 +40,116 @@ echo "PATH components."
echo echo
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo "To proceed with the ghcup installation press enter, to cancel press ctrl-c." printf "\\033[0;35m%s\\033[0m\\n" "To proceed with the ghcup installation press ENTER, to cancel press ctrl-c."
echo "Note that this script can be re-run at any given time." printf "\\033[0;35m%s\\033[0m\\n" "Note that this script can be re-run at any given time."
echo echo
# Wait for user input to continue. # Wait for user input to continue.
# shellcheck disable=SC2034 # shellcheck disable=SC2034
read -r answer </dev/tty read -r answer </dev/tty
fi fi
edo mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin edo mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
if command -V "ghcup" >/dev/null 2>&1 ; then if command -V "ghcup" >/dev/null 2>&1 ; then
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
edo ghcup upgrade eghcup upgrade
fi fi
else else
edo curl --silent https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup > "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/ghcup edo curl --silent https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup > "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/ghcup
edo chmod +x "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/ghcup edo chmod +x "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin/ghcup
cat <<-EOF > "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env || die "Failed to create env file" cat <<-EOF > "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env || die "Failed to create env file"
export PATH="\$HOME/.cabal/bin:\${GHCUP_INSTALL_BASE_PREFIX:=\$HOME}/.ghcup/bin:\$PATH" export PATH="\$HOME/.cabal/bin:\${GHCUP_INSTALL_BASE_PREFIX:=\$HOME}/.ghcup/bin:\$PATH"
EOF EOF
# shellcheck disable=SC1090 # shellcheck disable=SC1090
edo . "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env edo . "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env
fi fi
echo echo
echo "To install and run GHC you need the following dependencies:" printf "\\033[0;35m%s\\033[0m\\n" "To install and run GHC you need the following dependencies:"
echo " $(ghcup print-system-reqs)" echo " $(ghcup print-system-reqs)"
echo echo
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo "You may want to install these now, then press enter to proceed" printf "\\033[0;35m%s\\033[0m\\n" "You may want to install these now, then press ENTER to proceed"
echo "or press ctrl-c to abort." printf "\\033[0;35m%s\\033[0m\\n" "or press ctrl-c to abort. Installation may take a while."
echo "Installation may take a while." echo
echo
# Wait for user input to continue.
# Wait for user input to continue. # shellcheck disable=SC2034
# shellcheck disable=SC2034 read -r answer </dev/tty
read -r answer </dev/tty
fi fi
edo ghcup --cache install eghcup --cache install
edo ghcup set eghcup set
edo ghcup --cache install-cabal eghcup --cache install-cabal
edo cabal new-update edo cabal new-update
printf "\\033[0;35m%s\\033[0m\\n" "" printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Installation done!" printf "\\033[0;35m%s\\033[0m\\n" "Installation done!"
printf "\\033[0;35m%s\\033[0m\\n" "" printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Don't forget to source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env in your ~/.bashrc or similar."
printf "\\033[0;35m%s\\033[0m\\n" ""
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
echo "In order to run ghc and cabal, you need to adjust your PATH variable."
echo "You may want to source '$GHCUP_INSTALL_BASE_PREFIX/.ghcup/env' in your shell"
echo "configuration to do so (e.g. ~/.bashrc)."
case $SHELL in
*/zsh) # login shell is zsh
GHCUP_PROFILE_FILE="$HOME/.zshrc"
MY_SHELL="zsh" ;;
*/bash) # login shell is bash
if [ -f "$HOME/.bashrc" ] ; then # bashrc is not sourced by default, so assume it isn't if file does not exist
GHCUP_PROFILE_FILE="$HOME/.bashrc"
else
GHCUP_PROFILE_FILE="$HOME/.bash_profile"
fi
MY_SHELL="bash" ;;
*/sh) # login shell is sh, but might be a symlink to bash or zsh
if [ -n "${BASH}" ] ; then
if [ -f "$HOME/.bashrc" ] ; then # bashrc is not sourced by default, so assume it isn't if file does not exist
GHCUP_PROFILE_FILE="$HOME/.bashrc"
else
GHCUP_PROFILE_FILE="$HOME/.bash_profile"
fi
MY_SHELL="bash"
elif [ -n "${ZSH_VERSION}" ] ; then
GHCUP_PROFILE_FILE="$HOME/.zshrc"
MY_SHELL="zsh"
else
exit 0
fi
;;
*) exit 0 ;;
esac
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected ${MY_SHELL} shell on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically add the required PATH variable to \"${GHCUP_PROFILE_FILE}\""
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES, otherwise with NO and press ENTER."
printf "\\033[0;35m%s\\033[0m\\n" ""
while true; do
read -r next_answer </dev/tty
case $next_answer in
[Yy]*)
echo "[ -f \"\${GHCUP_INSTALL_BASE_PREFIX:=\$HOME}/.ghcup/env\" ] && source \"\${GHCUP_INSTALL_BASE_PREFIX:=\$HOME}/.ghcup/env\"" >> "${GHCUP_PROFILE_FILE}"
printf "\\033[0;35m%s\\033[0m\\n" "OK! ${GHCUP_PROFILE_FILE} has been modified. Restart your terminal for the changes to take effect,"
printf "\\033[0;35m%s\\033[0m\\n" "or type \"source ${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/env\" to apply them in your current terminal session."
exit 0;;
[Nn]*)
exit 0;;
*)
echo "Please type YES or NO and press enter.";;
esac
done
fi
) )
# vim: tabstop=4 shiftwidth=4 expandtab # vim: tabstop=4 shiftwidth=4 expandtab
......
#!/bin/sh
printf "# ChangeLog\n\n"
for current_tag in $(git tag --sort=-creatordate) ; do
tag_date=$(git log -1 --pretty=format:'%ad' --date=short ${current_tag})
printf "## [${current_tag}](https://gitlab.haskell.org/haskell/ghcup/-/tags/${current_tag}) (${tag_date})\n\n"
git --no-pager tag -l --format='%(contents)' ${current_tag} | sed -e '/BEGIN PGP/,$d'
printf "\n\n"
done
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
# @VARIABLE: VERSION # @VARIABLE: VERSION
# @DESCRIPTION: # @DESCRIPTION:
# Version of this script. # Version of this script.
VERSION=0.0.7 VERSION=0.0.8
# @VARIABLE: SCRIPT # @VARIABLE: SCRIPT
# @DESCRIPTION: # @DESCRIPTION:
...@@ -191,7 +191,7 @@ FLAGS: ...@@ -191,7 +191,7 @@ FLAGS:
-V, --version Prints version information -V, --version Prints version information
-w, --wget Use wget instead of curl -w, --wget Use wget instead of curl
-c, --cache Use \"${CACHE_LOCATION}\" for caching tarballs -c, --cache Use \"${CACHE_LOCATION}\" for caching tarballs
(these will not be removed by ghcup) (these will not be removed by ghcup)$(${VERBOSE} && printf "\n -o, --os Overwrite OS detection with the given string (must be a correct OS alias, e.g. 'alpine')")
SUBCOMMANDS: SUBCOMMANDS:
install Install GHC$(${VERBOSE} && printf "\n compile Compile and install GHC from source (UNSTABLE!!!)") install Install GHC$(${VERBOSE} && printf "\n compile Compile and install GHC from source (UNSTABLE!!!)")
...@@ -589,20 +589,28 @@ command_exists() { ...@@ -589,20 +589,28 @@ command_exists() {
# @RETURNS: 0 if all command exists, non-zero otherwise # @RETURNS: 0 if all command exists, non-zero otherwise
check_required_commands() { check_required_commands() {
_missing_commands= _missing_commands=
mydistro=$(get_distro_alias "$(get_distro_name)")
for com in "$@" awk uname basename tar xz gzip mktemp dirname ; do for com in "$@" awk uname basename tar gzip mktemp dirname ; do
command_exists "${com}" || { command_exists "${com}" || {
_missing_commands="${_missing_commands} ${com}" _missing_commands="${_missing_commands} ${com}"
} }
done done
unset com unset com
# darwin uses tar's built-in xz decompression
if test "${mydistro}" != "darwin"; then
command_exists xz || {
_missing_commands="${_missing_commands} xz"
}
fi
if [ -n "${_missing_commands}" ] ; then if [ -n "${_missing_commands}" ] ; then
printf "%s" "${_missing_commands}" printf "%s" "${_missing_commands}"
unset _missing_commands unset _missing_commands mydistro
return 1 return 1
else else
unset _missing_commands unset _missing_commands mydistro
return 0 return 0
fi fi
} }
...@@ -799,7 +807,7 @@ check_meta_file_version() { ...@@ -799,7 +807,7 @@ check_meta_file_version() {
} }
# @FUNCTION: get_download_url # @FUNCTION: get_download_url
# @USAGE: <tool> <version> # @USAGE: <tool> <version> [os-overwrite]
# @DESCRIPTION: # @DESCRIPTION:
# Gets the download url for the given tool and version # Gets the download url for the given tool and version
# and the current distro and architecture (which it tries to discover). # and the current distro and architecture (which it tries to discover).
...@@ -812,7 +820,11 @@ get_download_url() { ...@@ -812,7 +820,11 @@ get_download_url() {
myver=$2 myver=$2
myarch=$(get_arch) myarch=$(get_arch)
[ -z "${myarch}" ] && die "failed to get architecture" [ -z "${myarch}" ] && die "failed to get architecture"
mydistro=$(get_distro_alias "$(get_distro_name)") if [ -n "$3" ] ; then
mydistro=$(get_distro_alias "$3")
else
mydistro=$(get_distro_alias "$(get_distro_name)")
fi
mydistrover=$(get_distro_ver) mydistrover=$(get_distro_ver)
meta_file="$(get_meta_download_file)" meta_file="$(get_meta_download_file)"
[ -z "${meta_file}" ] && die "failed to get meta file" [ -z "${meta_file}" ] && die "failed to get meta file"
...@@ -966,7 +978,7 @@ download_to_cache() { ...@@ -966,7 +978,7 @@ download_to_cache() {
_dtc_download_tarball_name=$(basename "${_dtc_download_url}") _dtc_download_tarball_name=$(basename "${_dtc_download_url}")
rm_tarball() { rm_tarball() {
if [ -e "${CACHE_LOCATION}/${_dtc_download_tarball_name}" ] ; then if [ -f "${CACHE_LOCATION}/${_dtc_download_tarball_name}" ] ; then
rm "${CACHE_LOCATION}/${_dtc_download_tarball_name}" rm "${CACHE_LOCATION}/${_dtc_download_tarball_name}"
fi fi
} }
...@@ -1012,6 +1024,36 @@ download_to_stdout() { ...@@ -1012,6 +1024,36 @@ download_to_stdout() {
edo ${DOWNLOADER} ${DOWNLOADER_STDOUT_OPTS} "$1" 2> /dev/null edo ${DOWNLOADER} ${DOWNLOADER_STDOUT_OPTS} "$1" 2> /dev/null
} }
# @FUNCTION: mktempdir
# @DESCRIPTION:
# Makes a temporary directory.
mktempdir() {
mktemp_mydistro=$(get_distro_alias "$(get_distro_name)")
if test "${mktemp_mydistro}" = "darwin"; then
debug_message "mktemp -d -t ghcup.XXXXXXX"
mktemp -d -t ghcup.XXXXXXX
else
debug_message "mktemp -d"
mktemp -d
fi
unset mktemp_mydistro
}
# @FUNCTION: darwin_notarization
# @USAGE: <path>
# @DESCRIPTION:
# https://gitlab.haskell.org/ghc/ghc/issues/17418
# Can safely be invoked without distro check.
darwin_notarization() {
[ -z "$1" ] && die "Internal error: no argument given to darwin_notarization"
if [ "$(get_distro_alias "$(get_distro_name)")" = "darwin" ] ; then
edo xattr -r -d com.apple.quarantine "$1"
fi
}
# @FUNCTION: unpack # @FUNCTION: unpack
# @USAGE: <tarball> # @USAGE: <tarball>
# @DESCRIPTION: # @DESCRIPTION:
...@@ -1030,19 +1072,23 @@ unpack() { ...@@ -1030,19 +1072,23 @@ unpack() {
case "${file_ext}" in case "${file_ext}" in
xz) xz)
if test "${mydistro}" = "darwin"; then if test "${mydistro}" = "darwin"; then
debug_message "tar -xzf \"${filename}\"" debug_message "tar xf \"${filename}\""
( tar -xzf "${filename}" ) || die "unpacking failed!" ( tar xf "${filename}" ) || die "unpacking failed!"
else else
debug_message "xz -cd \"${filename}\" | tar -xf -" debug_message "xz -cd \"${filename}\" | tar -xf -"
( xz -cd "${filename}" | tar -xf - ; ) || die "unpacking failed!" ( xz -cd "${filename}" | tar xf - ; ) || die "unpacking failed!"
fi fi
;; ;;
gz) gz)
debug_message "gzip -cd \"${filename}\" | tar -xf -" debug_message "gzip -cd \"${filename}\" | tar -xf -"
( gzip -cd "${filename}" | tar -xf - ; ) || die "unpacking failed!" ( gzip -cd "${filename}" | tar xf - ; ) || die "unpacking failed!"
;;
bz2)
debug_message "bzip2 -cd \"${filename}\" | tar -xf -"
( bzip2 -cd "${filename}" | tar xf - ; ) || die "unpacking failed!"
;; ;;
tar) tar)
edo tar -xf "${filename}" edo tar xf "${filename}"
;; ;;
*) *)
die "Unknown file extension: \"${file_ext}\"" die "Unknown file extension: \"${file_ext}\""
...@@ -1102,22 +1148,22 @@ get_distro_alias() { ...@@ -1102,22 +1148,22 @@ get_distro_alias() {
"CentOS Linux"|"CentOS"|"centos"|"Red Hat Enterprise Linux"*) "CentOS Linux"|"CentOS"|"centos"|"Red Hat Enterprise Linux"*)
distro_alias=centos distro_alias=centos
;; ;;
"Alpine Linux"|"Alpine") "Alpine Linux"|"Alpine"|"alpine")
distro_alias=alpine distro_alias=alpine
;; ;;
"Linux Mint"|"LinuxMint") "Linux Mint"|"LinuxMint"|"linuxmint")
distro_alias=mint distro_alias=mint
;; ;;
"Amazon Linux AMI") "Amazon Linux AMI"|"amazonlinux")
distro_alias=amazonlinux distro_alias=amazonlinux
;; ;;
"AIX") "AIX"|"aix")
distro_alias=aix distro_alias=aix
;; ;;
"FreeBSD") "FreeBSD"|"freebsd")
distro_alias=freebsd distro_alias=freebsd
;; ;;
"Darwin") "Darwin"|"darwin")
distro_alias=darwin distro_alias=darwin
;; ;;
esac esac
...@@ -1180,7 +1226,7 @@ get_meta_version_file() { ...@@ -1180,7 +1226,7 @@ get_meta_version_file() {
meta_file_name="$(basename "${META_VERSION_URL}")" meta_file_name="$(basename "${META_VERSION_URL}")"
meta_filepath="${CACHE_LOCATION}/${meta_file_name}" meta_filepath="${CACHE_LOCATION}/${meta_file_name}"
if [ ! -e "${meta_filepath}" ] ; then if [ ! -f "${meta_filepath}" ] ; then
( (
edo cd "${CACHE_LOCATION}" edo cd "${CACHE_LOCATION}"
download_silent "${META_VERSION_URL}" download_silent "${META_VERSION_URL}"
...@@ -1207,7 +1253,7 @@ get_meta_download_file() { ...@@ -1207,7 +1253,7 @@ get_meta_download_file() {
meta_file_name="$(basename "${META_DOWNLOAD_URL}")" meta_file_name="$(basename "${META_DOWNLOAD_URL}")"
meta_filepath="${CACHE_LOCATION}/${meta_file_name}" meta_filepath="${CACHE_LOCATION}/${meta_file_name}"
if [ ! -e "${meta_filepath}" ] ; then if [ ! -f "${meta_filepath}" ] ; then
( (
edo cd "${CACHE_LOCATION}" edo cd "${CACHE_LOCATION}"
download_silent "${META_DOWNLOAD_URL}" download_silent "${META_DOWNLOAD_URL}"
...@@ -1303,7 +1349,7 @@ show_ghc_installed() { ...@@ -1303,7 +1349,7 @@ show_ghc_installed() {
real_ghc=$(posix_realpath "${current_ghc}") real_ghc=$(posix_realpath "${current_ghc}")
if [ -L "${current_ghc}" ] ; then # is symlink if [ -L "${current_ghc}" ] ; then # is symlink
if [ -e "${real_ghc}" ] ; then # exists (posix_realpath was called) if [ -f "${real_ghc}" ] ; then # exists (posix_realpath was called)
real_ghc="$(basename "${real_ghc}" | sed 's#ghc-##')" real_ghc="$(basename "${real_ghc}" | sed 's#ghc-##')"
printf "%s" "${real_ghc}" printf "%s" "${real_ghc}"
else # is a broken symlink else # is a broken symlink
...@@ -1336,7 +1382,7 @@ get_full_ghc_ver() { ...@@ -1336,7 +1382,7 @@ get_full_ghc_ver() {
latest_ghc=0 latest_ghc=0
for current_ghc in "${BIN_LOCATION}/ghc-${mymajorghcver}."* ; do for current_ghc in "${BIN_LOCATION}/ghc-${mymajorghcver}."* ; do
[ -e "${current_ghc}" ] || break [ -f "${current_ghc}" ] || break
real_ghc=$(posix_realpath "${current_ghc}") real_ghc=$(posix_realpath "${current_ghc}")
real_ghc="$(basename "${real_ghc}" | sed 's#ghc-##')" real_ghc="$(basename "${real_ghc}" | sed 's#ghc-##')"
if [ "$(expr "${real_ghc}" \> "${latest_ghc}")" = 1 ] ; then if [ "$(expr "${real_ghc}" \> "${latest_ghc}")" = 1 ] ; then
...@@ -1377,7 +1423,7 @@ set_ghc_major() { ...@@ -1377,7 +1423,7 @@ set_ghc_major() {
# @FUNCTION: install_ghc # @FUNCTION: install_ghc
# @USAGE: <ghcversion> # @USAGE: <ghcversion> [os-overwrite]
# @DESCRIPTION: # @DESCRIPTION:
# Installs the given ghc version with a lot of side effects. # Installs the given ghc version with a lot of side effects.
install_ghc() { install_ghc() {
...@@ -1386,7 +1432,7 @@ install_ghc() { ...@@ -1386,7 +1432,7 @@ install_ghc() {
myghcver=$1 myghcver=$1
inst_location=$(get_ghc_location "$1") inst_location=$(get_ghc_location "$1")
[ -z "${inst_location}" ] && die "failed to get install location" [ -z "${inst_location}" ] && die "failed to get install location"
download_url=$(get_download_url "ghc" "${myghcver}") download_url=$(get_download_url "ghc" "${myghcver}" "$2")
if [ -z "${download_url}" ] ; then if [ -z "${download_url}" ] ; then
die "Could not find an appropriate download for the requested GHC-${myghcver} on your system! Please report a bug at ${BUG_URL}" die "Could not find an appropriate download for the requested GHC-${myghcver} on your system! Please report a bug at ${BUG_URL}"
fi fi
...@@ -1394,7 +1440,7 @@ install_ghc() { ...@@ -1394,7 +1440,7 @@ install_ghc() {
first_install=true first_install=true
status_message "Installing GHC-${myghcver} for $(get_distro_name) on architecture $(get_arch)" status_message "Installing GHC-${myghcver} for $(if [ -n "$2" ] ; then echo "$2" ; else get_distro_name ; fi) on architecture $(get_arch)"
if ghc_already_installed "${myghcver}" ; then if ghc_already_installed "${myghcver}" ; then
if ${FORCE} ; then if ${FORCE} ; then
...@@ -1406,11 +1452,11 @@ install_ghc() { ...@@ -1406,11 +1452,11 @@ install_ghc() {
first_install=false first_install=false
fi fi
tmp_dir=$(mktemp -d) tmp_dir=$(mktempdir)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory" { [ -z "${tmp_dir}" ] || ! [ -d "${tmp_dir}" ] ; } && die "Failed to create temporary directory"
( (
if ${CACHING} ; then if ${CACHING} ; then
if [ ! -e "${CACHE_LOCATION}/${download_tarball_name}" ] ; then if [ ! -f "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
download_to_cache "${download_url}" download_to_cache "${download_url}"
fi fi
edo cd "${tmp_dir}" edo cd "${tmp_dir}"
...@@ -1423,6 +1469,8 @@ install_ghc() { ...@@ -1423,6 +1469,8 @@ install_ghc() {
edo cd "./ghc-${myghcver}" edo cd "./ghc-${myghcver}"
darwin_notarization .
debug_message "Installing GHC into ${inst_location}" debug_message "Installing GHC into ${inst_location}"
edo ./configure --prefix="${inst_location}" edo ./configure --prefix="${inst_location}"
...@@ -1430,10 +1478,10 @@ install_ghc() { ...@@ -1430,10 +1478,10 @@ install_ghc() {
# clean up # clean up
edo cd .. edo cd ..
[ -e "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}" [ -f "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}"
[ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}" [ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}"
) || { ) || {
[ -e "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}" [ -f "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}"
[ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}" [ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}"
if ${first_install} ; then if ${first_install} ; then
...@@ -1447,7 +1495,7 @@ install_ghc() { ...@@ -1447,7 +1495,7 @@ install_ghc() {
} }
for f in "${inst_location}"/bin/*-"${myghcver}" ; do for f in "${inst_location}"/bin/*-"${myghcver}" ; do
[ -e "${f}" ] || die "Something went wrong, ${f} does not exist!" [ -f "${f}" ] || die "Something went wrong, ${f} does not exist!"
fn=$(basename "${f}") fn=$(basename "${f}")
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}/bin/${fn}" "${BIN_LOCATION}/${fn}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}/bin/${fn}" "${BIN_LOCATION}/${fn}"
...@@ -1461,7 +1509,7 @@ install_ghc() { ...@@ -1461,7 +1509,7 @@ install_ghc() {
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hp2ps "${BIN_LOCATION}/hp2ps-${myghcver}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hp2ps "${BIN_LOCATION}/hp2ps-${myghcver}"
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hpc "${BIN_LOCATION}/hpc-${myghcver}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hpc "${BIN_LOCATION}/hpc-${myghcver}"
if [ -e "${inst_location}/bin/haddock" ] ; then if [ -f "${inst_location}/bin/haddock" ] ; then
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/haddock "${BIN_LOCATION}/haddock-${myghcver}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/haddock "${BIN_LOCATION}/haddock-${myghcver}"
fi fi
...@@ -1496,10 +1544,10 @@ set_ghc() { ...@@ -1496,10 +1544,10 @@ set_ghc() {
[ -e "${inst_location}" ] || die "GHC ${myghcver} not installed yet, use: ${SCRIPT} install ${myghcver}" [ -e "${inst_location}" ] || die "GHC ${myghcver} not installed yet, use: ${SCRIPT} install ${myghcver}"
status_message "Setting GHC to ${myghcver}" status_message "Setting GHC${target_suffix} to ${myghcver}"
for f in "${inst_location}"/bin/*-"${myghcver}" ; do for f in "${inst_location}"/bin/*-"${myghcver}" ; do
[ -e "${f}" ] || die "Something went wrong, ${f} does not exist!" [ -f "${f}" ] || die "Something went wrong, ${f} does not exist!"
source_fn=$(basename "${f}") source_fn=$(basename "${f}")
target_fn="$(echo "${source_fn}" | sed "s#-${myghcver}##")${target_suffix}" target_fn="$(echo "${source_fn}" | sed "s#-${myghcver}##")${target_suffix}"
# shellcheck disable=SC2046 # shellcheck disable=SC2046
...@@ -1515,12 +1563,21 @@ set_ghc() { ...@@ -1515,12 +1563,21 @@ set_ghc() {
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf "hpc-${myghcver}" "${BIN_LOCATION}/hpc${target_suffix}" edo ln $(optionv "-v") -sf "hpc-${myghcver}" "${BIN_LOCATION}/hpc${target_suffix}"
# not all bindists install haddock... # not all bindists install haddock...
if [ -e "${inst_location}/bin/haddock" ] ; then if [ -f "${inst_location}/bin/haddock" ] ; then
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf "haddock-ghc${target_suffix}" "${BIN_LOCATION}/haddock${target_suffix}" edo ln $(optionv "-v") -sf "haddock-ghc${target_suffix}" "${BIN_LOCATION}/haddock${target_suffix}"
fi fi
if [ -z "${target_suffix}" ] && [ -d "${inst_location}/share" ] ; then
# Make sure we don't link "${BIN_LOCATION}/../share/share".
# POSIX doesn't allow '-T' for 'ln'.
if [ -e "${BIN_LOCATION}/../share" ] ; then
edo rm "${BIN_LOCATION}/../share"
fi
# shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ghc/"${myghcver}"/share "${BIN_LOCATION}/../share"
fi
status_message "Done, make sure \"${BIN_LOCATION}\" is in your PATH!" status_message "Done"
unset myghcver inst_location f target_suffix unset myghcver inst_location f target_suffix
} }
...@@ -1546,14 +1603,60 @@ upgrade() { ...@@ -1546,14 +1603,60 @@ upgrade() {
status_message "Updating ${SCRIPT}" status_message "Updating ${SCRIPT}"
( (
edo cd "$(mktemp -d)" _plat="$(uname -s)"
download "${SCRIPT_UPDATE_URL}" _arch=$(uname -m)
case "${_plat}" in
"linux"|"Linux")
case "${_arch}" in
x86_64|amd64)
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4
;;
i*86)
_url=https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
;;
"FreeBSD"|"freebsd")
case "${_arch}" in
x86_64|amd64)
;;
i*86)
die "i386 currently not supported!"
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4
;;
"Darwin"|"darwin")
case "${_arch}" in
x86_64|amd64)
;;
i*86)
die "i386 currently not supported!"
;;
*) die "Unknown architecture: ${_arch}"
;;
esac
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4 ;;
*) die "Unknown platform: ${_plat}"
;;
esac
edo cd "$(mktempdir)"
download_to_stdout "${_url}" > ghcup
edo chmod +x ghcup edo chmod +x ghcup
edo mv -f ghcup "${target_location}"/ghcup edo mv -f ghcup "${target_location}"/ghcup
unset _plat _arch _url
) || die "failed to install" ) || die "failed to install"
status_message "Done, make sure \"${target_location}\" is in your PATH!" status_message "Done"
unset target_location unset target_location
} }
...@@ -1632,6 +1735,10 @@ rm_ghc() { ...@@ -1632,6 +1735,10 @@ rm_ghc() {
fi fi
done done
unset t known_tools unset t known_tools
# remove dangling symlink to share directory
if [ -h "${BIN_LOCATION}/../share" ] && [ ! -e "${BIN_LOCATION}/../share" ] ; then
edo rm "${BIN_LOCATION}/../share"
fi
warning_message "Done." warning_message "Done."
warning_message "You may now want to set currently active GHC to a different version via:" warning_message "You may now want to set currently active GHC to a different version via:"
...@@ -1650,7 +1757,7 @@ rm_ghc() { ...@@ -1650,7 +1757,7 @@ rm_ghc() {
# @FUNCTION: install_cabal # @FUNCTION: install_cabal
# @USAGE: <cabalversion> # @USAGE: <cabalversion> [os-overwrite]
# @DESCRIPTION: # @DESCRIPTION:
# Installs the given cabal version. # Installs the given cabal version.
install_cabal() { install_cabal() {
...@@ -1660,22 +1767,22 @@ install_cabal() { ...@@ -1660,22 +1767,22 @@ install_cabal() {
myarch=$(get_arch) myarch=$(get_arch)
[ -z "${myarch}" ] && die "failed to get architecture" [ -z "${myarch}" ] && die "failed to get architecture"
inst_location=$BIN_LOCATION inst_location=$BIN_LOCATION
download_url=$(get_download_url "cabal-install" "${mycabalver}") download_url=$(get_download_url "cabal-install" "${mycabalver}" "$2")
download_tarball_name=$(basename "${download_url}") download_tarball_name=$(basename "${download_url}")
if [ -z "${download_url}" ] ; then if [ -z "${download_url}" ] ; then
die "Could not find an appropriate download for the requested cabal-install-${mycabalver} on your system! Please report a bug at ${BUG_URL}" die "Could not find an appropriate download for the requested cabal-install-${mycabalver} on your system! Please report a bug at ${BUG_URL}"
fi fi
status_message "Installing cabal-install-${mycabalver} into \"${inst_location}\"" status_message "Installing cabal-install-${mycabalver} for $(if [ -n "$2" ] ; then echo "$2" ; else get_distro_name ; fi) on architecture $(get_arch)"
edo mkdir -p "${inst_location}" edo mkdir -p "${inst_location}"
tmp_dir=$(mktemp -d) tmp_dir=$(mktempdir)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory" { [ -z "${tmp_dir}" ] || ! [ -d "${tmp_dir}" ] ; } && die "Failed to create temporary directory"
( (
if ${CACHING} ; then if ${CACHING} ; then
if [ ! -e "${CACHE_LOCATION}/${download_tarball_name}" ] ; then if [ ! -f "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
download_to_cache "${download_url}" download_to_cache "${download_url}"
fi fi
edo cd "${tmp_dir}" edo cd "${tmp_dir}"
...@@ -1686,8 +1793,10 @@ install_cabal() { ...@@ -1686,8 +1793,10 @@ install_cabal() {
unpack "${download_tarball_name}" unpack "${download_tarball_name}"
fi fi
darwin_notarization .
edo mv -f cabal "${inst_location}"/cabal edo mv -f cabal "${inst_location}"/cabal
if [ -e "${tmp_dir}/${download_tarball_name}" ] ; then if [ -f "${tmp_dir}/${download_tarball_name}" ] ; then
rm "${tmp_dir}/${download_tarball_name}" rm "${tmp_dir}/${download_tarball_name}"
fi fi
) || die "Failed to install cabal-install" ) || die "Failed to install cabal-install"
...@@ -1695,11 +1804,6 @@ install_cabal() { ...@@ -1695,11 +1804,6 @@ install_cabal() {
status_message "Successfully installed cabal-install into" status_message "Successfully installed cabal-install into"
status_message " ${BIN_LOCATION}" status_message " ${BIN_LOCATION}"
status_message "" status_message ""
status_message "You may want to run the following to get the really latest version:"
status_message " cabal new-install cabal-install"
status_message ""
status_message "And make sure that \"~/.cabal/bin\" comes *before* \"${BIN_LOCATION}\""
status_message "in your PATH!"
unset mycabalver myarch inst_location download_url download_tarball_name tmp_dir unset mycabalver myarch inst_location download_url download_tarball_name tmp_dir
} }
...@@ -1726,7 +1830,7 @@ compile_ghc() { ...@@ -1726,7 +1830,7 @@ compile_ghc() {
/*) build_config=$3 ;; /*) build_config=$3 ;;
*) build_config="$(pwd)/$3" ;; *) build_config="$(pwd)/$3" ;;
esac esac
[ -e "${build_config}" ] || die "specified build config \"${build_config}\" file does not exist!" [ -f "${build_config}" ] || die "specified build config \"${build_config}\" file does not exist!"
fi fi
if ghc_already_installed "${myghcver}" ; then if ghc_already_installed "${myghcver}" ; then
...@@ -1738,11 +1842,11 @@ compile_ghc() { ...@@ -1738,11 +1842,11 @@ compile_ghc() {
fi fi
status_message "Compiling GHC for version ${myghcver} from source" status_message "Compiling GHC for version ${myghcver} from source"
tmp_dir=$(mktemp -d) tmp_dir=$(mktempdir)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory" { [ -z "${tmp_dir}" ] || ! [ -d "${tmp_dir}" ] ; } && die "Failed to create temporary directory"
( (
if ${CACHING} ; then if ${CACHING} ; then
if [ ! -e "${CACHE_LOCATION}/${download_tarball_name}" ] ; then if [ ! -f "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
download_to_cache "${download_url}" download_to_cache "${download_url}"
fi fi
edo cd "${tmp_dir}" edo cd "${tmp_dir}"
...@@ -1755,6 +1859,8 @@ compile_ghc() { ...@@ -1755,6 +1859,8 @@ compile_ghc() {
edo cd "./ghc-${myghcver}" edo cd "./ghc-${myghcver}"
darwin_notarization .
if [ -n "${build_config}" ] ; then if [ -n "${build_config}" ] ; then
edo cat "${build_config}" > mk/build.mk edo cat "${build_config}" > mk/build.mk
else else
...@@ -1770,16 +1876,20 @@ compile_ghc() { ...@@ -1770,16 +1876,20 @@ compile_ghc() {
edo ./boot edo ./boot
edo ./configure --prefix="${inst_location}" --with-ghc="${bootstrap_ghc}" if [ "$(echo "${myghcver}" | awk -F. '{printf"%d%03d",$1,$2;}')" -ge 8008 ]; then
GHC=$(command -v "${bootstrap_ghc}") edo ./configure --prefix="${inst_location}"
else
edo ./configure --prefix="${inst_location}" --with-ghc="${bootstrap_ghc}"
fi
emake -j${JOBS} emake -j${JOBS}
emake install emake install
# clean up # clean up
edo cd .. edo cd ..
[ -e "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}" [ -f "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}"
[ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}" [ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}"
) || { ) || {
[ -e "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}" [ -f "${tmp_dir}/${download_tarball_name}" ] && rm "${tmp_dir}/${download_tarball_name}"
[ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}" [ -e "${tmp_dir}/ghc-${myghcver}" ] && rm -r "${tmp_dir}/ghc-${myghcver}"
die "Failed to install, consider updating this script via: die "Failed to install, consider updating this script via:
${SCRIPT} upgrade ${SCRIPT} upgrade
...@@ -1787,7 +1897,7 @@ Also check https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux for ...@@ -1787,7 +1897,7 @@ Also check https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux for
} }
for f in "${inst_location}"/bin/*-"${myghcver}" ; do for f in "${inst_location}"/bin/*-"${myghcver}" ; do
[ -e "${f}" ] || die "Something went wrong, ${f} does not exist!" [ -f "${f}" ] || die "Something went wrong, ${f} does not exist!"
fn=$(basename "${f}") fn=$(basename "${f}")
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}/bin/${fn}" "${BIN_LOCATION}/${fn}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}/bin/${fn}" "${BIN_LOCATION}/${fn}"
...@@ -1801,7 +1911,7 @@ Also check https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux for ...@@ -1801,7 +1911,7 @@ Also check https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux for
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hp2ps "${BIN_LOCATION}/hp2ps-${myghcver}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hp2ps "${BIN_LOCATION}/hp2ps-${myghcver}"
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hpc "${BIN_LOCATION}/hpc-${myghcver}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hpc "${BIN_LOCATION}/hpc-${myghcver}"
if [ -e "${inst_location}/bin/haddock" ] ; then if [ -f "${inst_location}/bin/haddock" ] ; then
# shellcheck disable=SC2046 # shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/haddock "${BIN_LOCATION}/haddock-${myghcver}" edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/haddock "${BIN_LOCATION}/haddock-${myghcver}"
fi fi
...@@ -2012,9 +2122,6 @@ print_system_reqs() { ...@@ -2012,9 +2122,6 @@ print_system_reqs() {
unset mydistro reqs_url unset mydistro reqs_url
} }
####################### #######################
#--[ Sanity checks ]--# #--[ Sanity checks ]--#
####################### #######################
...@@ -2030,6 +2137,10 @@ fi ...@@ -2030,6 +2137,10 @@ fi
>&2 warning_message "ghcup has been rewritten in haskell. Please upgrade again via 'ghcup upgrade'"
############################################## ##############################################
#--[ Command line parsing and entry point ]--# #--[ Command line parsing and entry point ]--#
...@@ -2079,6 +2190,9 @@ upgrade" ...@@ -2079,6 +2190,9 @@ upgrade"
usage usage
fi fi
;; ;;
-o|--os) MY_OS=$2
shift 2;;
*) ## startup tasks ## *) ## startup tasks ##
edo mkdir -p "${INSTALL_BASE}" edo mkdir -p "${INSTALL_BASE}"
...@@ -2086,10 +2200,10 @@ upgrade" ...@@ -2086,10 +2200,10 @@ upgrade"
edo mkdir -p "${CACHE_LOCATION}" edo mkdir -p "${CACHE_LOCATION}"
# clean up old meta files # clean up old meta files
if [ -e "${CACHE_LOCATION}/$(basename "${META_VERSION_URL}")" ] ; then if [ -f "${CACHE_LOCATION}/$(basename "${META_VERSION_URL}")" ] ; then
edo rm "${CACHE_LOCATION}/$(basename "${META_VERSION_URL}")" edo rm "${CACHE_LOCATION}/$(basename "${META_VERSION_URL}")"
fi fi
if [ -e "${CACHE_LOCATION}/$(basename "${META_DOWNLOAD_URL}")" ] ; then if [ -f "${CACHE_LOCATION}/$(basename "${META_DOWNLOAD_URL}")" ] ; then
edo rm "${CACHE_LOCATION}/$(basename "${META_DOWNLOAD_URL}")" edo rm "${CACHE_LOCATION}/$(basename "${META_DOWNLOAD_URL}")"
fi fi
...@@ -2116,13 +2230,13 @@ upgrade" ...@@ -2116,13 +2230,13 @@ upgrade"
if [ -z "${_tool_ver}" ] ; then if [ -z "${_tool_ver}" ] ; then
die "Could not find a recommended GHC version, please report a bug at ${BUG_URL}!" die "Could not find a recommended GHC version, please report a bug at ${BUG_URL}!"
fi fi
install_ghc "${_tool_ver}" install_ghc "${_tool_ver}" "${MY_OS}"
else else
# could be a version or a tag, let's check # could be a version or a tag, let's check
if array_contains "${GHC_VER}" "$(known_tool_versions "ghc")" ; then if array_contains "${GHC_VER}" "$(known_tool_versions "ghc")" ; then
install_ghc "${GHC_VER}" install_ghc "${GHC_VER}" "${MY_OS}"
elif array_contains "${GHC_VER}" "$(known_tool_tags "ghc")" ; then elif array_contains "${GHC_VER}" "$(known_tool_tags "ghc")" ; then
install_ghc "$(get_tool_ver_from_tag "ghc" "${GHC_VER}")" install_ghc "$(get_tool_ver_from_tag "ghc" "${GHC_VER}")" "${MY_OS}"
else else
die "\"${GHC_VER}\" is not a known version or tag!" die "\"${GHC_VER}\" is not a known version or tag!"
fi fi
...@@ -2204,9 +2318,9 @@ upgrade" ...@@ -2204,9 +2318,9 @@ upgrade"
if [ -n "${CABAL_VER}" ] ; then if [ -n "${CABAL_VER}" ] ; then
# could be a version or a tag, let's check # could be a version or a tag, let's check
if array_contains "${CABAL_VER}" "$(known_tool_versions "cabal-install")" ; then if array_contains "${CABAL_VER}" "$(known_tool_versions "cabal-install")" ; then
install_cabal "${CABAL_VER}" install_cabal "${CABAL_VER}" "${MY_OS}"
elif array_contains "${CABAL_VER}" "$(known_tool_tags "cabal-install")" ; then elif array_contains "${CABAL_VER}" "$(known_tool_tags "cabal-install")" ; then
install_cabal "$(get_tool_ver_from_tag "cabal-install" "${CABAL_VER}")" install_cabal "$(get_tool_ver_from_tag "cabal-install" "${CABAL_VER}")" "${MY_OS}"
else else
die "\"${CABAL_VER}\" is not a known version or tag!" die "\"${CABAL_VER}\" is not a known version or tag!"
fi fi
...@@ -2215,7 +2329,7 @@ upgrade" ...@@ -2215,7 +2329,7 @@ upgrade"
if [ -z "${_cabal_ver}" ] ; then if [ -z "${_cabal_ver}" ] ; then
die "Could not find a recommended cabal-install version, please report a bug at ${BUG_URL}!" die "Could not find a recommended cabal-install version, please report a bug at ${BUG_URL}!"
fi fi
install_cabal "${_cabal_ver}" install_cabal "${_cabal_ver}" "${MY_OS}"
fi fi
break;; break;;
compile) compile)
......
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" focusable="false" width="1.66em" height="2em" style="-ms-transform: rotate(360deg); -webkit-transform: rotate(360deg); transform: rotate(360deg);" preserveAspectRatio="xMidYMid meet" viewBox="0 0 14 16"><path fill-rule="evenodd" d="M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3l3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7c-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2c1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1s-1 .45-1 1s-.45 1-1 1H3c-.55 0-1 .45-1 1z" fill="#626262"/></svg>
...@@ -63,7 +63,7 @@ body#idx > * { ...@@ -63,7 +63,7 @@ body#idx > * {
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
text-align: center; text-align: center;
width: 31em; width: 37em;
} }
body#idx > #pitch { body#idx > #pitch {
...@@ -88,37 +88,63 @@ body#idx p.other-help { ...@@ -88,37 +88,63 @@ body#idx p.other-help {
background-color: rgb(250, 250, 250); background-color: rgb(250, 250, 250);
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
width: 45rem;
text-align: center;
border-radius: 3px; border-radius: 3px;
border: 1px solid rgb(204, 204, 204); border: 1px solid rgb(204, 204, 204);
box-shadow: 0px 1px 4px 0px rgb(204, 204, 204); box-shadow: 0px 1px 4px 0px rgb(204, 204, 204);
} }
.instructions > * { .instructions > * {
width: 45rem; width: 55rem;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
} }
.instructions div.command-button {
display: flex;
}
.instructions div.command-button button {
color: white;
/* border: none; */
background-color: rgb(242, 242, 242);
border-width: 2px;
border-style: solid;
border-radius: 3px;
margin-left: 1rem;
margin-right: auto;
margin-top: 25px;
margin-bottom: 25px;
text-align: center;
}
.instructions div.command-button button:hover {
background: rgb(232, 232, 232);
}
.instructions div.command-button button:focus {
background: rgb(222, 222, 222);
}
hr { hr {
margin-top: 2em; margin-top: 2em;
margin-bottom: 2em; margin-bottom: 2em;
} }
#platform-instructions-linux > pre, #platform-instructions-linux > div > pre,
#platform-instructions-mac > pre, #platform-instructions-mac > div > pre,
#platform-instructions-freebsd > pre, #platform-instructions-freebsd > div > pre,
#platform-instructions-win32 > pre, #platform-instructions-win32 > pre,
#platform-instructions-win64 > pre, #platform-instructions-win64 > pre,
#platform-instructions-default > div > pre, #platform-instructions-default > div > div > pre,
#platform-instructions-unknown > div > pre { #platform-instructions-unknown > div > div > pre {
background-color: #515151; background-color: #515151;
color: white; color: white;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding-top: 1rem; padding-top: 1rem;
padding-bottom: 1rem; padding-bottom: 1rem;
padding-right: 1rem;
text-align: center; text-align: center;
border-radius: 3px; border-radius: 3px;
box-shadow: inset 0px 0px 20px 0px #333333; box-shadow: inset 0px 0px 20px 0px #333333;
...@@ -160,3 +186,55 @@ hr { ...@@ -160,3 +186,55 @@ hr {
margin-right: auto; margin-right: auto;
padding: 1em; padding: 1em;
} }
.ghcup-command:before {
color: #999;
content: " $ ";
}
/* Tooltip container */
.tooltip {
position: relative;
display: inline-block;
/* border-bottom: 1px dotted black; [> If you want dots under the hoverable text <] */
}
/* Tooltip text */
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: #555;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;
/* Position the tooltip text */
position: absolute;
z-index: 1;
bottom: 125%;
left: 50%;
margin-left: -60px;
/* Fade in tooltip */
opacity: 0;
transition: opacity 0.3s;
}
/* Tooltip arrow */
.tooltip .tooltiptext::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: #555 transparent transparent transparent;
}
/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
opacity: 1;
}