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 (88)
Showing
with 850 additions and 212 deletions
......@@ -9,17 +9,24 @@
#
# tool | version | tag |
ghc 7.10.3 7.10
ghc 8.0.2 8.0
ghc 8.2.2 8.2
ghc 8.4.1
ghc 8.4.2
ghc 8.4.3
ghc 8.4.4 8.4
ghc 8.6.1 bad
ghc 8.6.2
ghc 8.6.3
ghc 8.6.4
ghc 8.6.5 recommended,8.6
ghc 8.8.1 latest,8.8
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.4.0.0
cabal-install 2.4.1.0
cabal-install 3.0.0.0 latest,recommended
\ No newline at end of file
cabal-install 3.0.0.0
cabal-install 3.2.0.0 latest,recommended
......@@ -13,6 +13,15 @@
#
# 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 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
......@@ -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=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 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
......@@ -101,6 +127,32 @@ ghc 8.8.1 x86_64 darwin https://downl
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 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
......@@ -118,3 +170,7 @@ cabal-install 2.4.1.0 x86_64 unknown https://downl
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:
# CI Step
############################################################
test:
.debian:
image: "registry.gitlab.haskell.org/ghc/ci-images/x86_64-linux-deb9:$DOCKER_REV"
script:
- ./.github-ci.sh
dependencies: []
tags:
- 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.)
\ No newline at end of file
(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.)
# 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.
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
* [Installation](#installation)
* [Usage](#usage)
* [Manpages](#manpages)
* [Design goals](#design-goals)
* [How](#how)
* [Known users](#known-users)
......@@ -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
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
1. simplicity
......@@ -162,4 +172,4 @@ Mainly because the implementation is fairly straight-forward and the script is h
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()
"$@" || die "\"$*\" failed!"
}
eghcup() {
if [ -z "${BOOTSTRAP_HASKELL_VERBOSE}" ] ; then
edo ghcup "$@"
else
edo ghcup --verbose "$@"
fi
}
echo
echo "Welcome to Haskell!"
echo
......@@ -32,29 +40,29 @@ echo "PATH components."
echo
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" "To proceed with the ghcup installation press ENTER, to cancel press ctrl-c."
printf "\\033[0;35m%s\\033[0m\\n" "Note that this script can be re-run at any given time."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read -r answer </dev/tty
printf "\\033[0;35m%s\\033[0m\\n" "To proceed with the ghcup installation press ENTER, to cancel press ctrl-c."
printf "\\033[0;35m%s\\033[0m\\n" "Note that this script can be re-run at any given time."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read -r answer </dev/tty
fi
edo mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
if command -V "ghcup" >/dev/null 2>&1 ; then
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
edo ghcup upgrade
fi
if [ -z "${BOOTSTRAP_HASKELL_NO_UPGRADE}" ] ; then
eghcup upgrade
fi
else
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 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
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"
EOF
# shellcheck disable=SC1090
edo . "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env
edo . "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env
fi
echo
......@@ -63,65 +71,85 @@ echo " $(ghcup print-system-reqs)"
echo
if [ -z "${BOOTSTRAP_HASKELL_NONINTERACTIVE}" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" "You may want to install these now, then press ENTER to proceed"
printf "\\033[0;35m%s\\033[0m\\n" "or press ctrl-c to abort. Installation may take a while."
echo
printf "\\033[0;35m%s\\033[0m\\n" "You may want to install these now, then press ENTER to proceed"
printf "\\033[0;35m%s\\033[0m\\n" "or press ctrl-c to abort. Installation may take a while."
echo
# Wait for user input to continue.
# shellcheck disable=SC2034
read -r answer </dev/tty
# Wait for user input to continue.
# shellcheck disable=SC2034
read -r answer </dev/tty
fi
edo ghcup --cache install
eghcup --cache install
edo ghcup set
edo ghcup --cache install-cabal
eghcup set
eghcup --cache install-cabal
edo cabal new-update
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" ""
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)."
if [ -e "$HOME/.bashrc" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bashrc on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bashrc to include the required PATH variable"
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES and press ENTER (at your own risk)."
printf "\\033[0;35m%s\\033[0m\\n" "Otherwise press ctrl-c to abort."
printf "\\033[0;35m%s\\033[0m\\n" ""
read -r next_answer </dev/tty
case $next_answer in
[Yy]*)
echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bashrc"
;;
*)
exit 0;;
esac
elif [ -e "$HOME/.bash_profile" ] ; then
printf "\\033[0;35m%s\\033[0m\\n" ""
printf "\\033[0;35m%s\\033[0m\\n" "Detected ~/.bash_profile on your system..."
printf "\\033[0;35m%s\\033[0m\\n" "If you want ghcup to automatically fix your ~/.bash_profile to include the required PATH variable"
printf "\\033[0;35m%s\\033[0m\\n" "answer with YES and press ENTER (at your own risk)."
printf "\\033[0;35m%s\\033[0m\\n" "Otherwise press ctrl-c to abort."
printf "\\033[0;35m%s\\033[0m\\n" ""
read -r next_answer </dev/tty
case $next_answer in
[Yy]*)
echo "source $GHCUP_INSTALL_BASE_PREFIX/.ghcup/env" >> "${HOME}/.bash_profile"
;;
*)
exit 0;;
esac
fi
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
......
#!/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 @@
# @VARIABLE: VERSION
# @DESCRIPTION:
# Version of this script.
VERSION=0.0.7
VERSION=0.0.8
# @VARIABLE: SCRIPT
# @DESCRIPTION:
......@@ -191,7 +191,7 @@ FLAGS:
-V, --version Prints version information
-w, --wget Use wget instead of curl
-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:
install Install GHC$(${VERBOSE} && printf "\n compile Compile and install GHC from source (UNSTABLE!!!)")
......@@ -807,7 +807,7 @@ check_meta_file_version() {
}
# @FUNCTION: get_download_url
# @USAGE: <tool> <version>
# @USAGE: <tool> <version> [os-overwrite]
# @DESCRIPTION:
# Gets the download url for the given tool and version
# and the current distro and architecture (which it tries to discover).
......@@ -820,7 +820,11 @@ get_download_url() {
myver=$2
myarch=$(get_arch)
[ -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)
meta_file="$(get_meta_download_file)"
[ -z "${meta_file}" ] && die "failed to get meta file"
......@@ -974,7 +978,7 @@ download_to_cache() {
_dtc_download_tarball_name=$(basename "${_dtc_download_url}")
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}"
fi
}
......@@ -1020,6 +1024,36 @@ download_to_stdout() {
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
# @USAGE: <tarball>
# @DESCRIPTION:
......@@ -1049,6 +1083,10 @@ unpack() {
debug_message "gzip -cd \"${filename}\" | tar -xf -"
( 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)
edo tar xf "${filename}"
;;
......@@ -1110,22 +1148,22 @@ get_distro_alias() {
"CentOS Linux"|"CentOS"|"centos"|"Red Hat Enterprise Linux"*)
distro_alias=centos
;;
"Alpine Linux"|"Alpine")
"Alpine Linux"|"Alpine"|"alpine")
distro_alias=alpine
;;
"Linux Mint"|"LinuxMint")
"Linux Mint"|"LinuxMint"|"linuxmint")
distro_alias=mint
;;
"Amazon Linux AMI")
"Amazon Linux AMI"|"amazonlinux")
distro_alias=amazonlinux
;;
"AIX")
"AIX"|"aix")
distro_alias=aix
;;
"FreeBSD")
"FreeBSD"|"freebsd")
distro_alias=freebsd
;;
"Darwin")
"Darwin"|"darwin")
distro_alias=darwin
;;
esac
......@@ -1188,7 +1226,7 @@ get_meta_version_file() {
meta_file_name="$(basename "${META_VERSION_URL}")"
meta_filepath="${CACHE_LOCATION}/${meta_file_name}"
if [ ! -e "${meta_filepath}" ] ; then
if [ ! -f "${meta_filepath}" ] ; then
(
edo cd "${CACHE_LOCATION}"
download_silent "${META_VERSION_URL}"
......@@ -1215,7 +1253,7 @@ get_meta_download_file() {
meta_file_name="$(basename "${META_DOWNLOAD_URL}")"
meta_filepath="${CACHE_LOCATION}/${meta_file_name}"
if [ ! -e "${meta_filepath}" ] ; then
if [ ! -f "${meta_filepath}" ] ; then
(
edo cd "${CACHE_LOCATION}"
download_silent "${META_DOWNLOAD_URL}"
......@@ -1311,7 +1349,7 @@ show_ghc_installed() {
real_ghc=$(posix_realpath "${current_ghc}")
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-##')"
printf "%s" "${real_ghc}"
else # is a broken symlink
......@@ -1344,7 +1382,7 @@ get_full_ghc_ver() {
latest_ghc=0
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="$(basename "${real_ghc}" | sed 's#ghc-##')"
if [ "$(expr "${real_ghc}" \> "${latest_ghc}")" = 1 ] ; then
......@@ -1385,7 +1423,7 @@ set_ghc_major() {
# @FUNCTION: install_ghc
# @USAGE: <ghcversion>
# @USAGE: <ghcversion> [os-overwrite]
# @DESCRIPTION:
# Installs the given ghc version with a lot of side effects.
install_ghc() {
......@@ -1394,7 +1432,7 @@ install_ghc() {
myghcver=$1
inst_location=$(get_ghc_location "$1")
[ -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
die "Could not find an appropriate download for the requested GHC-${myghcver} on your system! Please report a bug at ${BUG_URL}"
fi
......@@ -1402,7 +1440,7 @@ install_ghc() {
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 ${FORCE} ; then
......@@ -1414,11 +1452,11 @@ install_ghc() {
first_install=false
fi
tmp_dir=$(mktemp -d)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory"
tmp_dir=$(mktempdir)
{ [ -z "${tmp_dir}" ] || ! [ -d "${tmp_dir}" ] ; } && die "Failed to create temporary directory"
(
if ${CACHING} ; then
if [ ! -e "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
if [ ! -f "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
download_to_cache "${download_url}"
fi
edo cd "${tmp_dir}"
......@@ -1431,6 +1469,8 @@ install_ghc() {
edo cd "./ghc-${myghcver}"
darwin_notarization .
debug_message "Installing GHC into ${inst_location}"
edo ./configure --prefix="${inst_location}"
......@@ -1438,10 +1478,10 @@ install_ghc() {
# clean up
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}/${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}"
if ${first_install} ; then
......@@ -1455,7 +1495,7 @@ install_ghc() {
}
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}")
# shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}/bin/${fn}" "${BIN_LOCATION}/${fn}"
......@@ -1469,7 +1509,7 @@ install_ghc() {
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/hp2ps "${BIN_LOCATION}/hp2ps-${myghcver}"
# shellcheck disable=SC2046
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
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/haddock "${BIN_LOCATION}/haddock-${myghcver}"
fi
......@@ -1504,10 +1544,10 @@ set_ghc() {
[ -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
[ -e "${f}" ] || die "Something went wrong, ${f} does not exist!"
[ -f "${f}" ] || die "Something went wrong, ${f} does not exist!"
source_fn=$(basename "${f}")
target_fn="$(echo "${source_fn}" | sed "s#-${myghcver}##")${target_suffix}"
# shellcheck disable=SC2046
......@@ -1523,10 +1563,19 @@ set_ghc() {
# shellcheck disable=SC2046
edo ln $(optionv "-v") -sf "hpc-${myghcver}" "${BIN_LOCATION}/hpc${target_suffix}"
# not all bindists install haddock...
if [ -e "${inst_location}/bin/haddock" ] ; then
if [ -f "${inst_location}/bin/haddock" ] ; then
# shellcheck disable=SC2046
edo ln $(optionv "-v") -sf "haddock-ghc${target_suffix}" "${BIN_LOCATION}/haddock${target_suffix}"
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"
......@@ -1554,11 +1603,57 @@ upgrade() {
status_message "Updating ${SCRIPT}"
(
edo cd "$(mktemp -d)"
download "${SCRIPT_UPDATE_URL}"
_plat="$(uname -s)"
_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 mv -f ghcup "${target_location}"/ghcup
unset _plat _arch _url
) || die "failed to install"
status_message "Done"
......@@ -1640,6 +1735,10 @@ rm_ghc() {
fi
done
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 "You may now want to set currently active GHC to a different version via:"
......@@ -1658,7 +1757,7 @@ rm_ghc() {
# @FUNCTION: install_cabal
# @USAGE: <cabalversion>
# @USAGE: <cabalversion> [os-overwrite]
# @DESCRIPTION:
# Installs the given cabal version.
install_cabal() {
......@@ -1668,22 +1767,22 @@ install_cabal() {
myarch=$(get_arch)
[ -z "${myarch}" ] && die "failed to get architecture"
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}")
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}"
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}"
tmp_dir=$(mktemp -d)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory"
tmp_dir=$(mktempdir)
{ [ -z "${tmp_dir}" ] || ! [ -d "${tmp_dir}" ] ; } && die "Failed to create temporary directory"
(
if ${CACHING} ; then
if [ ! -e "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
if [ ! -f "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
download_to_cache "${download_url}"
fi
edo cd "${tmp_dir}"
......@@ -1694,8 +1793,10 @@ install_cabal() {
unpack "${download_tarball_name}"
fi
darwin_notarization .
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}"
fi
) || die "Failed to install cabal-install"
......@@ -1729,7 +1830,7 @@ compile_ghc() {
/*) build_config=$3 ;;
*) build_config="$(pwd)/$3" ;;
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
if ghc_already_installed "${myghcver}" ; then
......@@ -1741,11 +1842,11 @@ compile_ghc() {
fi
status_message "Compiling GHC for version ${myghcver} from source"
tmp_dir=$(mktemp -d)
[ -z "${tmp_dir}" ] && die "Failed to create temporary directory"
tmp_dir=$(mktempdir)
{ [ -z "${tmp_dir}" ] || ! [ -d "${tmp_dir}" ] ; } && die "Failed to create temporary directory"
(
if ${CACHING} ; then
if [ ! -e "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
if [ ! -f "${CACHE_LOCATION}/${download_tarball_name}" ] ; then
download_to_cache "${download_url}"
fi
edo cd "${tmp_dir}"
......@@ -1758,6 +1859,8 @@ compile_ghc() {
edo cd "./ghc-${myghcver}"
darwin_notarization .
if [ -n "${build_config}" ] ; then
edo cat "${build_config}" > mk/build.mk
else
......@@ -1773,16 +1876,20 @@ compile_ghc() {
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 install
# clean up
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}/${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}"
die "Failed to install, consider updating this script via:
${SCRIPT} upgrade
......@@ -1790,7 +1897,7 @@ Also check https://ghc.haskell.org/trac/ghc/wiki/Building/Preparation/Linux for
}
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}")
# shellcheck disable=SC2046
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}/bin/${fn}" "${BIN_LOCATION}/${fn}"
......@@ -1804,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}"
# shellcheck disable=SC2046
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
edo ln $(optionv "-v") -sf ../ghc/"${myghcver}"/bin/haddock "${BIN_LOCATION}/haddock-${myghcver}"
fi
......@@ -2015,9 +2122,6 @@ print_system_reqs() {
unset mydistro reqs_url
}
#######################
#--[ Sanity checks ]--#
#######################
......@@ -2033,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 ]--#
......@@ -2082,6 +2190,9 @@ upgrade"
usage
fi
;;
-o|--os) MY_OS=$2
shift 2;;
*) ## startup tasks ##
edo mkdir -p "${INSTALL_BASE}"
......@@ -2089,10 +2200,10 @@ upgrade"
edo mkdir -p "${CACHE_LOCATION}"
# 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}")"
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}")"
fi
......@@ -2119,13 +2230,13 @@ upgrade"
if [ -z "${_tool_ver}" ] ; then
die "Could not find a recommended GHC version, please report a bug at ${BUG_URL}!"
fi
install_ghc "${_tool_ver}"
install_ghc "${_tool_ver}" "${MY_OS}"
else
# could be a version or a tag, let's check
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
install_ghc "$(get_tool_ver_from_tag "ghc" "${GHC_VER}")"
install_ghc "$(get_tool_ver_from_tag "ghc" "${GHC_VER}")" "${MY_OS}"
else
die "\"${GHC_VER}\" is not a known version or tag!"
fi
......@@ -2207,9 +2318,9 @@ upgrade"
if [ -n "${CABAL_VER}" ] ; then
# could be a version or a tag, let's check
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
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
die "\"${CABAL_VER}\" is not a known version or tag!"
fi
......@@ -2218,7 +2329,7 @@ upgrade"
if [ -z "${_cabal_ver}" ] ; then
die "Could not find a recommended cabal-install version, please report a bug at ${BUG_URL}!"
fi
install_cabal "${_cabal_ver}"
install_cabal "${_cabal_ver}" "${MY_OS}"
fi
break;;
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 > * {
margin-left: auto;
margin-right: auto;
text-align: center;
width: 31em;
width: 37em;
}
body#idx > #pitch {
......@@ -88,31 +88,56 @@ body#idx p.other-help {
background-color: rgb(250, 250, 250);
margin-left: auto;
margin-right: auto;
width: 45rem;
text-align: center;
border-radius: 3px;
border: 1px solid rgb(204, 204, 204);
box-shadow: 0px 1px 4px 0px rgb(204, 204, 204);
}
.instructions > * {
width: 45rem;
width: 55rem;
margin-left: 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 {
margin-top: 2em;
margin-bottom: 2em;
}
#platform-instructions-linux > pre,
#platform-instructions-mac > pre,
#platform-instructions-freebsd > pre,
#platform-instructions-linux > div > pre,
#platform-instructions-mac > div > pre,
#platform-instructions-freebsd > div > pre,
#platform-instructions-win32 > pre,
#platform-instructions-win64 > pre,
#platform-instructions-default > div > pre,
#platform-instructions-unknown > div > pre {
#platform-instructions-default > div > div > pre,
#platform-instructions-unknown > div > div > pre {
background-color: #515151;
color: white;
margin-left: auto;
......@@ -166,3 +191,50 @@ hr {
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;
}
......@@ -148,6 +148,16 @@ function fill_in_bug_report_values() {
nav_app.textContent = navigator.appVersion;
}
function copyToClipboard() {
const text = document.getElementsByClassName("ghcup-command").item(0).innerText;
const el = document.createElement('textarea');
el.value = text;
document.body.appendChild(el);
el.select();
document.execCommand('copy');
document.body.removeChild(el);
}
(function () {
adjust_for_platform();
set_up_cycle_button();
......