Compare commits
34 Commits
v0.1.2
...
ghcup-0.0.
| Author | SHA1 | Date | |
|---|---|---|---|
| e637f90fae | |||
| 5b33c3f491 | |||
| 1842ed464f | |||
| 296bbdd561 | |||
| 27ead1be7c | |||
| 5184609dba | |||
| 5d94d0bf75 | |||
| 72bcfa9270 | |||
| fafff9dadd | |||
| e3c20d53a8 | |||
| 8b7dc68491 | |||
| 7742fe08b5 | |||
| a773da037c | |||
| dfeb814dcc | |||
| 0623c7b1b1 | |||
| 62005f83a4 | |||
| eaafd77a7e | |||
| 9d9e415a09 | |||
| 6c1ae585b7 | |||
| 793aad7b6c | |||
| fd7807a66e | |||
| 879bd061dd | |||
| 75632b2cf1 | |||
| b65b9dc5e1 | |||
| 31d70e34e9 | |||
| 84de282655 | |||
| 997dcadf89 | |||
| b2312629ce | |||
| 3d10f964c6 | |||
| 404038edcb | |||
| ea4f9ceab1 | |||
| 5c481ea94e | |||
| 1ccaf4ba91 | |||
| b532511cd5 |
151
.gitlab-ci.yml
151
.gitlab-ci.yml
@@ -12,10 +12,46 @@ variables:
|
|||||||
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"
|
||||||
tags:
|
tags:
|
||||||
- x86_64-linux
|
- x86_64-linux
|
||||||
|
variables:
|
||||||
|
OS: "LINUX"
|
||||||
|
|
||||||
|
.alpine:64bit:
|
||||||
|
image: "alpine:edge"
|
||||||
|
tags:
|
||||||
|
- x86_64-linux
|
||||||
|
variables:
|
||||||
|
OS: "LINUX"
|
||||||
|
BIT: "64"
|
||||||
|
|
||||||
|
.alpine:32bit:
|
||||||
|
image: "i386/alpine:edge"
|
||||||
|
tags:
|
||||||
|
- x86_64-linux
|
||||||
|
variables:
|
||||||
|
OS: "LINUX"
|
||||||
|
BIT: "32"
|
||||||
|
|
||||||
.darwin:
|
.darwin:
|
||||||
tags:
|
tags:
|
||||||
- x86_64-darwin
|
- x86_64-darwin
|
||||||
|
variables:
|
||||||
|
OS: "DARWIN"
|
||||||
|
|
||||||
|
.freebsd:
|
||||||
|
tags:
|
||||||
|
- x86_64-freebsd
|
||||||
|
variables:
|
||||||
|
OS: "FREEBSD"
|
||||||
|
|
||||||
|
.root_cleanup:
|
||||||
|
after_script:
|
||||||
|
- BUILD_DIR=$CI_PROJECT_DIR
|
||||||
|
- echo "Cleaning $BUILD_DIR"
|
||||||
|
- cd $HOME
|
||||||
|
- test -n "$BUILD_DIR"
|
||||||
|
- shopt -s extglob
|
||||||
|
- rm -Rf "$BUILD_DIR"/!(out)
|
||||||
|
- exit 0
|
||||||
|
|
||||||
.test_ghcup_version:
|
.test_ghcup_version:
|
||||||
script:
|
script:
|
||||||
@@ -29,50 +65,133 @@ variables:
|
|||||||
- .debian
|
- .debian
|
||||||
before_script:
|
before_script:
|
||||||
- ./.gitlab/before_script/linux/install_deps.sh
|
- ./.gitlab/before_script/linux/install_deps.sh
|
||||||
variables:
|
|
||||||
OS: "LINUX"
|
|
||||||
|
|
||||||
.test_ghcup_version:darwin:
|
.test_ghcup_version:darwin:
|
||||||
extends:
|
extends:
|
||||||
- .test_ghcup_version
|
- .test_ghcup_version
|
||||||
- .darwin
|
- .darwin
|
||||||
|
- .root_cleanup
|
||||||
before_script:
|
before_script:
|
||||||
- ./.gitlab/before_script/darwin/install_deps.sh
|
- ./.gitlab/before_script/darwin/install_deps.sh
|
||||||
variables:
|
|
||||||
OS: "DARWIN"
|
|
||||||
after_script:
|
|
||||||
- BUILD_DIR=$CI_PROJECT_DIR
|
|
||||||
- echo "Cleaning $BUILD_DIR"
|
|
||||||
- cd $HOME
|
|
||||||
- rm -Rf "$BUILD_DIR"/*
|
|
||||||
- exit 0
|
|
||||||
|
|
||||||
|
.test_ghcup_version:freebsd:
|
||||||
|
extends:
|
||||||
|
- .test_ghcup_version
|
||||||
|
- .freebsd
|
||||||
|
- .root_cleanup
|
||||||
|
before_script:
|
||||||
|
- ./.gitlab/before_script/freebsd/install_deps.sh
|
||||||
|
|
||||||
|
.release_ghcup:
|
||||||
|
script:
|
||||||
|
- ./.gitlab/script/ghcup_release.sh
|
||||||
|
artifacts:
|
||||||
|
expire_in: 2 week
|
||||||
|
paths:
|
||||||
|
- out
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
|
||||||
######## linux ########
|
######## linux test ########
|
||||||
|
|
||||||
test:linux:recommended:
|
test:linux:recommended:
|
||||||
extends: .test_ghcup_version:linux
|
extends: .test_ghcup_version:linux
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "recommended"
|
GHC_VERSION: "8.6.5"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
test:linux:latest:
|
test:linux:latest:
|
||||||
extends: .test_ghcup_version:linux
|
extends: .test_ghcup_version:linux
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "latest"
|
GHC_VERSION: "8.8.3"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
######## darwin ########
|
######## darwin test ########
|
||||||
|
|
||||||
test:mac:recommended:
|
test:mac:recommended:
|
||||||
extends: .test_ghcup_version:darwin
|
extends: .test_ghcup_version:darwin
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "recommended"
|
GHC_VERSION: "8.6.5"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
test:mac:latest:
|
test:mac:latest:
|
||||||
extends: .test_ghcup_version:darwin
|
extends: .test_ghcup_version:darwin
|
||||||
variables:
|
variables:
|
||||||
GHC_VERSION: "latest"
|
GHC_VERSION: "8.8.3"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
|
######## freebsd test ########
|
||||||
|
|
||||||
|
test:freebsd:recommended:
|
||||||
|
extends: .test_ghcup_version:freebsd
|
||||||
|
variables:
|
||||||
|
GHC_VERSION: "8.6.5"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
|
test:freebsd:latest:
|
||||||
|
extends: .test_ghcup_version:freebsd
|
||||||
|
variables:
|
||||||
|
GHC_VERSION: "8.8.3"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
|
|
||||||
|
######## linux release ########
|
||||||
|
|
||||||
|
release:linux:64bit:
|
||||||
|
extends:
|
||||||
|
- .alpine:64bit
|
||||||
|
- .release_ghcup
|
||||||
|
before_script:
|
||||||
|
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
||||||
|
variables:
|
||||||
|
ARTIFACT: "x86_64-linux-ghcup"
|
||||||
|
GHC_VERSION: "8.8.3"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
release:linux:32bit:
|
||||||
|
extends:
|
||||||
|
- .alpine:32bit
|
||||||
|
- .release_ghcup
|
||||||
|
before_script:
|
||||||
|
- ./.gitlab/before_script/linux/alpine/install_deps.sh
|
||||||
|
variables:
|
||||||
|
ARTIFACT: "x86_64-linux-ghcup"
|
||||||
|
GHC_VERSION: "8.8.3"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
|
||||||
|
|
||||||
|
######## darwin release ########
|
||||||
|
|
||||||
|
release:darwin:
|
||||||
|
extends:
|
||||||
|
- .darwin
|
||||||
|
- .release_ghcup
|
||||||
|
- .root_cleanup
|
||||||
|
before_script:
|
||||||
|
- ./.gitlab/before_script/darwin/install_deps.sh
|
||||||
|
variables:
|
||||||
|
ARTIFACT: "x86_64-apple-darwin-ghcup"
|
||||||
|
GHC_VERSION: "8.8.3"
|
||||||
|
CABAL_VERSION: "3.2.0.0"
|
||||||
|
MACOSX_DEPLOYMENT_TARGET: "10.7"
|
||||||
|
|
||||||
|
|
||||||
|
######## freebsd release ########
|
||||||
|
|
||||||
|
release:freebsd:
|
||||||
|
extends:
|
||||||
|
- .freebsd
|
||||||
|
- .release_ghcup
|
||||||
|
- .root_cleanup
|
||||||
|
before_script:
|
||||||
|
- ./.gitlab/before_script/freebsd/install_deps.sh
|
||||||
|
variables:
|
||||||
|
ARTIFACT: "x86_64-portbld-freebsd-ghcup"
|
||||||
|
GHC_VERSION: "8.6.5"
|
||||||
|
|
||||||
|
|||||||
@@ -4,11 +4,11 @@ set -eux
|
|||||||
|
|
||||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||||
|
|
||||||
curl -sSfL https://gitlab.haskell.org/haskell/ghcup/-/raw/master/ghcup > ./ghcup-legacy
|
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup > ./ghcup-bin
|
||||||
chmod +x ghcup-legacy
|
chmod +x ghcup-bin
|
||||||
|
|
||||||
./ghcup-legacy install ${GHC_VERSION}
|
./ghcup-bin install ${GHC_VERSION}
|
||||||
./ghcup-legacy set ${GHC_VERSION}
|
./ghcup-bin set ${GHC_VERSION}
|
||||||
./ghcup-legacy install-cabal
|
./ghcup-bin install-cabal ${CABAL_VERSION}
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
23
.gitlab/before_script/freebsd/install_deps.sh
Executable file
23
.gitlab/before_script/freebsd/install_deps.sh
Executable file
@@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
# pkg install --force --yes --no-repo-update curl gcc gmp gmake ncurses perl5 libffi libiconv
|
||||||
|
|
||||||
|
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||||
|
|
||||||
|
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup > ./ghcup-bin
|
||||||
|
chmod +x ghcup-bin
|
||||||
|
|
||||||
|
mkdir -p "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/bin
|
||||||
|
# ./ghcup-bin install ${GHC_VERSION}
|
||||||
|
# ./ghcup-bin install-cabal ${CABAL_VERSION}
|
||||||
|
# ./ghcup-bin set ${GHC_VERSION}
|
||||||
|
|
||||||
|
# install cabal-3.2.0.0
|
||||||
|
curl -sSfL -o cabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz 'https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz&dl=1'
|
||||||
|
tar xf cabal-install-3.2.0.0-x86_64-portbld-freebsd.tar.xz
|
||||||
|
cp cabal "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin/cabal"
|
||||||
|
chmod +x "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin/cabal"
|
||||||
|
|
||||||
|
exit 0
|
||||||
60
.gitlab/before_script/linux/alpine/install_deps.sh
Executable file
60
.gitlab/before_script/linux/alpine/install_deps.sh
Executable file
@@ -0,0 +1,60 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
. "$( cd "$(dirname "$0")" ; pwd -P )/../../../ghcup_env"
|
||||||
|
|
||||||
|
apk add --no-cache \
|
||||||
|
curl \
|
||||||
|
gcc \
|
||||||
|
g++ \
|
||||||
|
gmp-dev \
|
||||||
|
ncurses-dev \
|
||||||
|
libffi-dev \
|
||||||
|
make \
|
||||||
|
xz \
|
||||||
|
tar \
|
||||||
|
perl
|
||||||
|
|
||||||
|
ln -s libncurses.so /usr/lib/libtinfo.so
|
||||||
|
ln -s libncursesw.so.6 /usr/lib/libtinfow.so.6
|
||||||
|
if [ "${BIT}" = "32" ] ; then
|
||||||
|
curl -sSfL https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4 > ./ghcup-bin
|
||||||
|
else
|
||||||
|
curl -sSfL https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4 > ./ghcup-bin
|
||||||
|
fi
|
||||||
|
chmod +x ghcup-bin
|
||||||
|
./ghcup-bin upgrade
|
||||||
|
./ghcup-bin install ${GHC_VERSION}
|
||||||
|
# ./ghcup-bin install-cabal ${CABAL_VERSION}
|
||||||
|
# install cabal-3.2.0.0
|
||||||
|
if [ "${BIT}" = "32" ] ; then
|
||||||
|
curl -sSfL -o cabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz 'https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz&dl=1'
|
||||||
|
tar xf cabal-install-3.2.0.0-i386-alpine-linux-musl.tar.xz
|
||||||
|
cp cabal-install-3.2.0.0-i386-alpine-linux-musl "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin/cabal"
|
||||||
|
else
|
||||||
|
curl -sSfL -o cabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz 'https://hasufell.de/d/d3e215db133e4fcaa61e/files/?p=/cabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz&dl=1'
|
||||||
|
tar xf cabal-install-3.2.0.0-x86_64-alpine-linux-musl.tar.xz
|
||||||
|
cp cabal-install-3.2.0.0-x86_64-alpine-linux-musl "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin/cabal"
|
||||||
|
fi
|
||||||
|
chmod +x "${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin/cabal"
|
||||||
|
|
||||||
|
|
||||||
|
# utils
|
||||||
|
apk add --no-cache \
|
||||||
|
bash
|
||||||
|
|
||||||
|
## Package specific
|
||||||
|
apk add --no-cache \
|
||||||
|
zlib \
|
||||||
|
zlib-dev \
|
||||||
|
zlib-static \
|
||||||
|
gmp \
|
||||||
|
gmp-dev \
|
||||||
|
openssl-dev \
|
||||||
|
openssl-libs-static \
|
||||||
|
xz \
|
||||||
|
xz-dev
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7,10 +7,10 @@ sudo apt-get install -y libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev li
|
|||||||
|
|
||||||
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
. "$( cd "$(dirname "$0")" ; pwd -P )/../../ghcup_env"
|
||||||
|
|
||||||
curl -sSfL https://gitlab.haskell.org/haskell/ghcup/-/raw/master/ghcup > ./ghcup-legacy
|
curl -sSfL https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > ./ghcup-bin
|
||||||
chmod +x ghcup-legacy
|
chmod +x ghcup-bin
|
||||||
|
|
||||||
./ghcup-legacy install ${GHC_VERSION}
|
./ghcup-bin install ${GHC_VERSION}
|
||||||
./ghcup-legacy set ${GHC_VERSION}
|
./ghcup-bin set ${GHC_VERSION}
|
||||||
./ghcup-legacy install-cabal
|
./ghcup-bin install-cabal ${CABAL_VERSION}
|
||||||
|
|
||||||
|
|||||||
26
.gitlab/script/ghcup_release.sh
Executable file
26
.gitlab/script/ghcup_release.sh
Executable file
@@ -0,0 +1,26 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
. "$( cd "$(dirname "$0")" ; pwd -P )/../ghcup_env"
|
||||||
|
|
||||||
|
mkdir -p "$CI_PROJECT_DIR"/.local/bin
|
||||||
|
|
||||||
|
ecabal() {
|
||||||
|
cabal --store-dir="$(pwd)"/.store "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
# build
|
||||||
|
ecabal update
|
||||||
|
|
||||||
|
if [ "${OS}" = "LINUX" ] ; then
|
||||||
|
ecabal build -w ghc-${GHC_VERSION} -fcurl --ghc-options='-split-sections -optl-static'
|
||||||
|
else
|
||||||
|
ecabal build -w ghc-${GHC_VERSION} -fcurl
|
||||||
|
fi
|
||||||
|
|
||||||
|
mkdir out
|
||||||
|
cp "$(ecabal new-exec -w ghc-${GHC_VERSION} --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
||||||
|
ver=$(./ghcup --numeric-version)
|
||||||
|
cp ghcup out/${ARTIFACT}-${ver}
|
||||||
|
|
||||||
@@ -10,49 +10,78 @@ ecabal() {
|
|||||||
cabal --store-dir="$(pwd)"/.store "$@"
|
cabal --store-dir="$(pwd)"/.store "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eghcup() {
|
||||||
|
ghcup -v -c -s file://$(pwd)/ghcup-${JSON_VERSION}.json "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
### build
|
||||||
|
|
||||||
# build
|
|
||||||
ecabal update
|
ecabal update
|
||||||
|
|
||||||
if [ "${OS}" = "DARWIN" ] ; then
|
if [ "${OS}" = "DARWIN" ] ; then
|
||||||
ecabal build -fcurl
|
ecabal build -w ghc-${GHC_VERSION} -fcurl
|
||||||
else
|
else
|
||||||
ecabal build
|
ecabal build -w ghc-${GHC_VERSION}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup')" .
|
||||||
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" .
|
cp "$(ecabal new-exec --enable-tests --verbose=0 --offline sh -- -c 'command -v ghcup-gen')" .
|
||||||
|
|
||||||
|
|
||||||
# testing
|
|
||||||
|
|
||||||
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
|
cp ./ghcup "$CI_PROJECT_DIR"/.local/bin/ghcup
|
||||||
cp ./ghcup-gen "$CI_PROJECT_DIR"/.local/bin/ghcup-gen
|
cp ./ghcup-gen "$CI_PROJECT_DIR"/.local/bin/ghcup-gen
|
||||||
|
|
||||||
|
### cleanup
|
||||||
|
|
||||||
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
rm -rf "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup
|
||||||
|
|
||||||
|
|
||||||
|
### manual cli based testing
|
||||||
|
|
||||||
|
|
||||||
ghcup-gen check -f ghcup-${JSON_VERSION}.json
|
ghcup-gen check -f ghcup-${JSON_VERSION}.json
|
||||||
|
|
||||||
ghcup numeric-version
|
eghcup --numeric-version
|
||||||
|
|
||||||
ghcup -v -c install ${GHC_VERSION}
|
# TODO: rm once we have tarballs
|
||||||
ghcup -v -c set ${GHC_VERSION}
|
if [ "${OS}" = "FREEBSD" ] ; then
|
||||||
ghcup -v -c install-cabal
|
GHC_VERSION=8.6.3
|
||||||
|
CABAL_VERSION=2.4.1.0
|
||||||
|
fi
|
||||||
|
|
||||||
|
eghcup install ${GHC_VERSION}
|
||||||
|
eghcup set ${GHC_VERSION}
|
||||||
|
eghcup install-cabal ${CABAL_VERSION}
|
||||||
|
|
||||||
cabal --version
|
cabal --version
|
||||||
|
|
||||||
ghcup -v -c debug-info
|
eghcup debug-info
|
||||||
|
|
||||||
ghcup -v -c list
|
eghcup list
|
||||||
ghcup -v -c list -t ghc
|
eghcup list -t ghc
|
||||||
ghcup -v -c list -t cabal
|
eghcup list -t cabal
|
||||||
|
|
||||||
|
ghc_ver=$(ghc --numeric-version)
|
||||||
ghc --version
|
ghc --version
|
||||||
ghci --version
|
ghci --version
|
||||||
ghc-$(ghc --numeric-version) --version
|
ghc-$(ghc --numeric-version) --version
|
||||||
ghci-$(ghc --numeric-version) --version
|
ghci-$(ghc --numeric-version) --version
|
||||||
|
|
||||||
ghcup -v upgrade
|
|
||||||
ghcup -v upgrade -f
|
|
||||||
|
|
||||||
ghcup -v rm $(ghc --numeric-version)
|
# test installing new ghc doesn't mess with currently set GHC
|
||||||
|
# https://gitlab.haskell.org/haskell/ghcup-hs/issues/7
|
||||||
|
eghcup install 8.4.4
|
||||||
|
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||||
|
eghcup set 8.4.4
|
||||||
|
eghcup set 8.4.4
|
||||||
|
[ "$(ghc --numeric-version)" = "8.4.4" ]
|
||||||
|
eghcup set ${GHC_VERSION}
|
||||||
|
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||||
|
eghcup rm 8.4.4
|
||||||
|
[ "$(ghc --numeric-version)" = "${ghc_ver}" ]
|
||||||
|
|
||||||
|
eghcup rm $(ghc --numeric-version)
|
||||||
|
|
||||||
|
eghcup upgrade
|
||||||
|
eghcup upgrade -f
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,14 @@
|
|||||||
# Revision history for ghcup
|
# Revision history for ghcup
|
||||||
|
|
||||||
|
## 0.1.4 -- 2020-04-16
|
||||||
|
|
||||||
|
* build on all platforms with curl (as a binary), wrt https://gitlab.haskell.org/haskell/ghcup-hs/issues/6
|
||||||
|
* Fix unlinking of ghc symlinks after new installation, wrt https://gitlab.haskell.org/haskell/ghcup-hs/issues/7
|
||||||
|
|
||||||
|
## 0.1.3 -- 2020-04-15
|
||||||
|
|
||||||
|
* Fix lesser bug when skipping ghcup update
|
||||||
|
|
||||||
## 0.1.2 -- 2020-04-15
|
## 0.1.2 -- 2020-04-15
|
||||||
|
|
||||||
* Fix bug when removing the set GHC version
|
* Fix bug when removing the set GHC version
|
||||||
|
|||||||
@@ -142,3 +142,6 @@ ghcup is not a reimplementation of stack. The only common part is automatic inst
|
|||||||
|
|
||||||
Consider using [Chocolatey](https://chocolatey.org/search?q=ghc) or [ghcups](https://github.com/kakkun61/ghcups).
|
Consider using [Chocolatey](https://chocolatey.org/search?q=ghc) or [ghcups](https://github.com/kakkun61/ghcups).
|
||||||
|
|
||||||
|
3. Why the haskell reimplementation?
|
||||||
|
|
||||||
|
Why not?
|
||||||
|
|||||||
20
TODO.md
20
TODO.md
@@ -2,27 +2,39 @@
|
|||||||
|
|
||||||
## Now
|
## Now
|
||||||
|
|
||||||
* move out GHCup.Version module, bc it's not library-ish
|
* try to run exe before upgrade (backup to ~/.ghcup/bin/ghcup.old)
|
||||||
|
* allow to build 8.8
|
||||||
|
* curl DL does not cache json
|
||||||
|
* explain environment variables
|
||||||
|
* add --keep=<always|error> option
|
||||||
|
|
||||||
|
* allow to switch to curl/wget at runtime
|
||||||
|
|
||||||
|
* cross support
|
||||||
|
* installing multiple versions of the same
|
||||||
|
|
||||||
|
* proper test suite
|
||||||
|
* add more logging
|
||||||
|
|
||||||
|
|
||||||
## Maybe
|
## Maybe
|
||||||
|
|
||||||
* maybe: changelog Show the changelog of a GHC release (online)
|
* version ranges in json
|
||||||
* sign the JSON? (Or check gpg keys?)
|
* sign the JSON? (Or check gpg keys?)
|
||||||
* testing (especially distro detection -> unit tests)
|
* testing (especially distro detection -> unit tests)
|
||||||
|
|
||||||
## Later
|
## Later
|
||||||
|
|
||||||
* i386 support
|
|
||||||
* add support for RC/alpha/HEAD versions
|
* add support for RC/alpha/HEAD versions
|
||||||
|
|
||||||
## Cleanups
|
## Cleanups
|
||||||
|
|
||||||
* too many decodeutf8
|
|
||||||
* avoid alternative for IO
|
* avoid alternative for IO
|
||||||
* use plucky or oops instead of Excepts
|
* use plucky or oops instead of Excepts
|
||||||
|
|
||||||
## Questions
|
## Questions
|
||||||
|
|
||||||
|
* move out GHCup.Version module, bc it's not library-ish?
|
||||||
* mirror support
|
* mirror support
|
||||||
* interactive handling when distro doesn't exist and we know the tarball is incompatible?
|
* interactive handling when distro doesn't exist and we know the tarball is incompatible?
|
||||||
* ghcup-with wrapper to execute a command with a given ghc in PATH?
|
* ghcup-with wrapper to execute a command with a given ghc in PATH?
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ ghc_883_32_musl :: DownloadInfo
|
|||||||
ghc_883_32_musl = DownloadInfo
|
ghc_883_32_musl = DownloadInfo
|
||||||
[uri|https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.3-musl/ghc-8.8.3-i386-unknown-linux-musl.tar.xz|]
|
[uri|https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.3-musl/ghc-8.8.3-i386-unknown-linux-musl.tar.xz|]
|
||||||
(Just [rel|ghc-8.8.3|])
|
(Just [rel|ghc-8.8.3|])
|
||||||
"23779adb4cf4b314d0f8c66ee215ba6e74154c0768a573780475943544020bec"
|
"7a5f41646d06777e75636291a1855d60a0984552bbdf33c3d107565d302f38a4"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -984,32 +984,32 @@ cabal_3200_64_darwin = DownloadInfo
|
|||||||
-------------
|
-------------
|
||||||
|
|
||||||
|
|
||||||
ghcup_011_32_linux :: DownloadInfo
|
ghcup_014_32_linux :: DownloadInfo
|
||||||
ghcup_011_32_linux = DownloadInfo
|
ghcup_014_32_linux = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/ghcup/0.1.1/i386-linux-ghcup-0.1.1|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4|]
|
||||||
Nothing
|
Nothing
|
||||||
"f576f22efdcf17fa18189b65d70e596d14f2347ef549a00592ef28d529c7d5a0"
|
"057cc1cc39abdacd92cb1d4fb44c850fd9c5398a36b893286248ac5c38bc0c70"
|
||||||
|
|
||||||
|
|
||||||
ghcup_011_64_linux :: DownloadInfo
|
ghcup_014_64_linux :: DownloadInfo
|
||||||
ghcup_011_64_linux = DownloadInfo
|
ghcup_014_64_linux = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/ghcup/0.1.1/x86_64-linux-ghcup-0.1.1|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4|]
|
||||||
Nothing
|
Nothing
|
||||||
"2789fbab2848e4dfd77406b9a710c925b3b9680ac0f8486caca190628646486f"
|
"78d69ed4c9a810a445af89ea25e4217a632799ecb427b06cd2320ffb574f555e"
|
||||||
|
|
||||||
|
|
||||||
ghcup_011_64_freebsd :: DownloadInfo
|
ghcup_014_64_freebsd :: DownloadInfo
|
||||||
ghcup_011_64_freebsd = DownloadInfo
|
ghcup_014_64_freebsd = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/ghcup/0.1.1/x86_64-portbld-freebsd-ghcup-0.1.1|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4|]
|
||||||
Nothing
|
Nothing
|
||||||
"1336585b15692d6458edf4d913fd585d9963a708e2c952a71ee1ad3400ed2163"
|
"cda0b959f053abc04ab0a1b9919a505b8c9304e2898a291f527a370cb0e00731"
|
||||||
|
|
||||||
|
|
||||||
ghcup_011_64_darwin10_13 :: DownloadInfo
|
ghcup_014_64_darwin10_13 :: DownloadInfo
|
||||||
ghcup_011_64_darwin10_13 = DownloadInfo
|
ghcup_014_64_darwin10_13 = DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/ghcup/0.1.1/x86_64-apple-darwin-ghcup-0.1.1|]
|
[uri|https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4|]
|
||||||
Nothing
|
Nothing
|
||||||
"b9694de40134e3d17611749eba94d8e4d00a84e2a16bb2409eab1e87f810dacd"
|
"2422b79933ae037237ccb8f836417b90b3111d7931beb7ae8b9e33a1945c641e"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1027,6 +1027,9 @@ ghcupDownloads = M.fromList
|
|||||||
[ ( [vver|7.10.3|]
|
[ ( [vver|7.10.3|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/7.10.3/docs/html/users_guide/release-7-10-1.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-src.tar.xz|]
|
||||||
(Just [rel|ghc-7.10.3|])
|
(Just [rel|ghc-7.10.3|])
|
||||||
@@ -1070,6 +1073,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.0.2|]
|
, ( [vver|8.0.2|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.0.2/docs/html/users_guide/8.0.1-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.0.2|])
|
(Just [rel|ghc-8.0.2|])
|
||||||
@@ -1113,6 +1119,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.2.2|]
|
, ( [vver|8.2.2|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.2.2/docs/html/users_guide/8.2.2-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.2.2|])
|
(Just [rel|ghc-8.2.2|])
|
||||||
@@ -1162,6 +1171,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.4.1|]
|
, ( [vver|8.4.1|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.4.1/docs/html/users_guide/8.4.1-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.4.1|])
|
(Just [rel|ghc-8.4.1|])
|
||||||
@@ -1198,6 +1210,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.4.2|]
|
, ( [vver|8.4.2|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.4.2|])
|
(Just [rel|ghc-8.4.2|])
|
||||||
@@ -1245,6 +1260,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.4.3|]
|
, ( [vver|8.4.3|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.4.3|])
|
(Just [rel|ghc-8.4.3|])
|
||||||
@@ -1291,6 +1309,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.4.4|]
|
, ( [vver|8.4.4|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.4.4/docs/html/users_guide/8.4.4-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.4.4|])
|
(Just [rel|ghc-8.4.4|])
|
||||||
@@ -1342,6 +1363,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.6.1|]
|
, ( [vver|8.6.1|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.6.1/docs/html/users_guide/8.6.1-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.6.1/ghc-8.6.1-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.6.1/ghc-8.6.1-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.6.1|])
|
(Just [rel|ghc-8.6.1|])
|
||||||
@@ -1389,6 +1413,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.6.2|]
|
, ( [vver|8.6.2|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.6.2/docs/html/users_guide/8.6.2-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.6.2|])
|
(Just [rel|ghc-8.6.2|])
|
||||||
@@ -1430,6 +1457,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.6.3|]
|
, ( [vver|8.6.3|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.6.3/docs/html/users_guide/8.6.3-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.6.3|])
|
(Just [rel|ghc-8.6.3|])
|
||||||
@@ -1481,6 +1511,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.6.4|]
|
, ( [vver|8.6.4|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.6.4/docs/html/users_guide/8.6.4-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.6.4|])
|
(Just [rel|ghc-8.6.4|])
|
||||||
@@ -1527,6 +1560,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.6.5|]
|
, ( [vver|8.6.5|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.6.5|])
|
(Just [rel|ghc-8.6.5|])
|
||||||
@@ -1577,6 +1613,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.8.1|]
|
, ( [vver|8.8.1|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.8.1|])
|
(Just [rel|ghc-8.8.1|])
|
||||||
@@ -1627,6 +1666,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.8.2|]
|
, ( [vver|8.8.2|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.8.2/docs/html/users_guide/8.8.2-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.8.2|])
|
(Just [rel|ghc-8.8.2|])
|
||||||
@@ -1677,6 +1719,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.8.3|]
|
, ( [vver|8.8.3|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[Recommended]
|
[Recommended]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.8.3|])
|
(Just [rel|ghc-8.8.3|])
|
||||||
@@ -1727,6 +1772,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|8.10.1|]
|
, ( [vver|8.10.1|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[Latest]
|
[Latest]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-src.tar.xz|]
|
[uri|https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-src.tar.xz|]
|
||||||
(Just [rel|ghc-8.10.1|])
|
(Just [rel|ghc-8.10.1|])
|
||||||
@@ -1796,6 +1844,9 @@ ghcupDownloads = M.fromList
|
|||||||
[ ( [vver|2.4.1.0|]
|
[ ( [vver|2.4.1.0|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/changelog|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://github.com/haskell/cabal/archive/cabal-install-v2.4.1.0.tar.gz|]
|
[uri|https://github.com/haskell/cabal/archive/cabal-install-v2.4.1.0.tar.gz|]
|
||||||
(Just [rel|cabal-cabal-install-v2.4.1.0/cabal-install|])
|
(Just [rel|cabal-cabal-install-v2.4.1.0/cabal-install|])
|
||||||
@@ -1824,6 +1875,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|3.0.0.0|]
|
, ( [vver|3.0.0.0|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[]
|
[]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/changelog|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://github.com/haskell/cabal/archive/cabal-install-v3.0.0.0.tar.gz|]
|
[uri|https://github.com/haskell/cabal/archive/cabal-install-v3.0.0.0.tar.gz|]
|
||||||
(Just [rel|cabal-cabal-install-v3.0.0.0/cabal-install|])
|
(Just [rel|cabal-cabal-install-v3.0.0.0/cabal-install|])
|
||||||
@@ -1850,6 +1904,9 @@ ghcupDownloads = M.fromList
|
|||||||
, ( [vver|3.2.0.0|]
|
, ( [vver|3.2.0.0|]
|
||||||
, VersionInfo
|
, VersionInfo
|
||||||
[Recommended, Latest]
|
[Recommended, Latest]
|
||||||
|
(Just
|
||||||
|
[uri|https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/changelog|]
|
||||||
|
)
|
||||||
(Just $ DownloadInfo
|
(Just $ DownloadInfo
|
||||||
[uri|https://github.com/haskell/cabal/archive/cabal-install-v3.2.0.0.tar.gz|]
|
[uri|https://github.com/haskell/cabal/archive/cabal-install-v3.2.0.0.tar.gz|]
|
||||||
(Just [rel|cabal-cabal-install-v3.2.0.0/cabal-install|])
|
(Just [rel|cabal-cabal-install-v3.2.0.0/cabal-install|])
|
||||||
@@ -1877,20 +1934,31 @@ ghcupDownloads = M.fromList
|
|||||||
)
|
)
|
||||||
, ( GHCup
|
, ( GHCup
|
||||||
, M.fromList
|
, M.fromList
|
||||||
[ ( [vver|0.1.1|]
|
[ ( [vver|0.1.4|]
|
||||||
, VersionInfo [Recommended, Latest] Nothing $ M.fromList
|
, VersionInfo
|
||||||
[ ( A_64
|
[Recommended, Latest]
|
||||||
, M.fromList
|
(Just
|
||||||
[ (Linux UnknownLinux, M.fromList [(Nothing, ghcup_011_64_linux)])
|
[uri|https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md|]
|
||||||
, (Darwin, M.fromList [(Nothing, ghcup_011_64_darwin10_13)])
|
)
|
||||||
, (FreeBSD, M.fromList [(Nothing, ghcup_011_64_freebsd)])
|
Nothing
|
||||||
|
$ M.fromList
|
||||||
|
[ ( A_64
|
||||||
|
, M.fromList
|
||||||
|
[ ( Linux UnknownLinux
|
||||||
|
, M.fromList [(Nothing, ghcup_014_64_linux)]
|
||||||
|
)
|
||||||
|
, (Darwin , M.fromList [(Nothing, ghcup_014_64_darwin10_13)])
|
||||||
|
, (FreeBSD, M.fromList [(Nothing, ghcup_014_64_freebsd)])
|
||||||
|
]
|
||||||
|
)
|
||||||
|
, ( A_32
|
||||||
|
, M.fromList
|
||||||
|
[ ( Linux UnknownLinux
|
||||||
|
, M.fromList [(Nothing, ghcup_014_32_linux)]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
]
|
]
|
||||||
)
|
|
||||||
, ( A_32
|
|
||||||
, M.fromList
|
|
||||||
[(Linux UnknownLinux, M.fromList [(Nothing, ghcup_011_32_linux)])]
|
|
||||||
)
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ validate dls = do
|
|||||||
[i|FreeBSD missing for #{t} #{v'} #{arch}|]
|
[i|FreeBSD missing for #{t} #{v'} #{arch}|]
|
||||||
|
|
||||||
checkUniqueTags tool = do
|
checkUniqueTags tool = do
|
||||||
let allTags = join $ fmap snd $ availableToolVersions dls tool
|
let allTags = join $ M.elems $ availableToolVersions dls tool
|
||||||
let nonUnique =
|
let nonUnique =
|
||||||
fmap fst
|
fmap fst
|
||||||
. filter (\(_, b) -> not b)
|
. filter (\(_, b) -> not b)
|
||||||
@@ -118,7 +118,7 @@ validate dls = do
|
|||||||
|
|
||||||
-- a tool must have at least one of each mandatory tags
|
-- a tool must have at least one of each mandatory tags
|
||||||
checkMandatoryTags tool = do
|
checkMandatoryTags tool = do
|
||||||
let allTags = join $ fmap snd $ availableToolVersions dls tool
|
let allTags = join $ M.elems $ availableToolVersions dls tool
|
||||||
forM_ [Latest, Recommended] $ \t -> case elem t allTags of
|
forM_ [Latest, Recommended] $ \t -> case elem t allTags of
|
||||||
False -> do
|
False -> do
|
||||||
lift $ $(logError) [i|Tag #{t} missing from #{tool}|]
|
lift $ $(logError) [i|Tag #{t} missing from #{tool}|]
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import GHCup.Platform
|
|||||||
import GHCup.Requirements
|
import GHCup.Requirements
|
||||||
import GHCup.Types
|
import GHCup.Types
|
||||||
import GHCup.Utils
|
import GHCup.Utils
|
||||||
|
import GHCup.Utils.File
|
||||||
import GHCup.Utils.Logger
|
import GHCup.Utils.Logger
|
||||||
import GHCup.Utils.Prelude
|
import GHCup.Utils.Prelude
|
||||||
import GHCup.Version
|
import GHCup.Version
|
||||||
@@ -32,6 +33,7 @@ import Data.Char
|
|||||||
import Data.Either
|
import Data.Either
|
||||||
import Data.Functor
|
import Data.Functor
|
||||||
import Data.List ( intercalate )
|
import Data.List ( intercalate )
|
||||||
|
import Data.Maybe
|
||||||
import Data.String.Interpolate
|
import Data.String.Interpolate
|
||||||
import Data.Text ( Text )
|
import Data.Text ( Text )
|
||||||
import Data.Versions
|
import Data.Versions
|
||||||
@@ -40,8 +42,11 @@ import GHC.IO.Encoding
|
|||||||
import Haskus.Utils.Variant.Excepts
|
import Haskus.Utils.Variant.Excepts
|
||||||
import HPath
|
import HPath
|
||||||
import HPath.IO
|
import HPath.IO
|
||||||
|
import Language.Haskell.TH
|
||||||
import Options.Applicative hiding ( style )
|
import Options.Applicative hiding ( style )
|
||||||
|
import Options.Applicative.Help.Pretty ( text )
|
||||||
import Prelude hiding ( appendFile )
|
import Prelude hiding ( appendFile )
|
||||||
|
import Safe
|
||||||
import System.Console.Pretty
|
import System.Console.Pretty
|
||||||
import System.Environment
|
import System.Environment
|
||||||
import System.Exit
|
import System.Exit
|
||||||
@@ -81,8 +86,8 @@ data Command
|
|||||||
| DInfo
|
| DInfo
|
||||||
| Compile CompileCommand
|
| Compile CompileCommand
|
||||||
| Upgrade UpgradeOpts Bool
|
| Upgrade UpgradeOpts Bool
|
||||||
| NumericVersion
|
|
||||||
| ToolRequirements
|
| ToolRequirements
|
||||||
|
| ChangeLog ChangeLogOptions
|
||||||
|
|
||||||
data ToolVersion = ToolVersion Version
|
data ToolVersion = ToolVersion Version
|
||||||
| ToolTag Tag
|
| ToolTag Tag
|
||||||
@@ -124,17 +129,19 @@ data UpgradeOpts = UpgradeInplace
|
|||||||
| UpgradeGHCupDir
|
| UpgradeGHCupDir
|
||||||
deriving Show
|
deriving Show
|
||||||
|
|
||||||
|
data ChangeLogOptions = ChangeLogOptions
|
||||||
|
{ clOpen :: Bool
|
||||||
|
, clTool :: Maybe Tool
|
||||||
|
, clToolVer :: Maybe ToolVersion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
opts :: Parser Options
|
opts :: Parser Options
|
||||||
opts =
|
opts =
|
||||||
Options
|
Options
|
||||||
<$> switch
|
<$> switch (short 'v' <> long "verbose" <> help "Enable verbosity")
|
||||||
(short 'v' <> long "verbose" <> help
|
|
||||||
"Enable verbosity"
|
|
||||||
)
|
|
||||||
<*> switch
|
<*> switch
|
||||||
(short 'c' <> long "cache" <> help
|
(short 'c' <> long "cache" <> help "Cache downloads in ~/.ghcup/cache"
|
||||||
"Cache downloads in ~/.ghcup/cache"
|
|
||||||
)
|
)
|
||||||
<*> (optional
|
<*> (optional
|
||||||
(option
|
(option
|
||||||
@@ -162,15 +169,21 @@ com =
|
|||||||
subparser
|
subparser
|
||||||
( command
|
( command
|
||||||
"install"
|
"install"
|
||||||
((info ((Install <$> installOpts) <**> helper)
|
((info
|
||||||
(progDesc "Install or update GHC")
|
((Install <$> installOpts) <**> helper)
|
||||||
|
( progDesc "Install or update GHC"
|
||||||
|
<> footerDoc (Just $ text installFooter)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
<> command
|
<> command
|
||||||
"set"
|
"set"
|
||||||
( SetGHC
|
( SetGHC
|
||||||
<$> (info (setGHCOpts <**> helper)
|
<$> (info
|
||||||
(progDesc "Set currently active GHC version")
|
(setGHCOpts <**> helper)
|
||||||
|
( progDesc "Set currently active GHC version"
|
||||||
|
<> footerDoc (Just $ text setFooter)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
<> command
|
<> command
|
||||||
@@ -181,8 +194,11 @@ com =
|
|||||||
|
|
||||||
<> command
|
<> command
|
||||||
"install-cabal"
|
"install-cabal"
|
||||||
((info ((InstallCabal <$> installOpts) <**> helper)
|
((info
|
||||||
(progDesc "Install or update cabal")
|
((InstallCabal <$> installOpts) <**> helper)
|
||||||
|
( progDesc "Install or update cabal"
|
||||||
|
<> footerDoc (Just $ text installCabalFooter)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
<> command
|
<> command
|
||||||
@@ -194,12 +210,14 @@ com =
|
|||||||
)
|
)
|
||||||
<> command
|
<> command
|
||||||
"upgrade"
|
"upgrade"
|
||||||
(info ((Upgrade <$> upgradeOptsP <*>
|
(info
|
||||||
switch
|
( (Upgrade <$> upgradeOptsP <*> switch
|
||||||
(short 'f' <> long "force" <> help
|
(short 'f' <> long "force" <> help "Force update")
|
||||||
"Force update"
|
)
|
||||||
)
|
<**> helper
|
||||||
) <**> helper) (progDesc "Upgrade ghcup"))
|
)
|
||||||
|
(progDesc "Upgrade ghcup")
|
||||||
|
)
|
||||||
<> command
|
<> command
|
||||||
"compile"
|
"compile"
|
||||||
( Compile
|
( Compile
|
||||||
@@ -213,11 +231,6 @@ com =
|
|||||||
( command
|
( command
|
||||||
"debug-info"
|
"debug-info"
|
||||||
((\_ -> DInfo) <$> (info (helper) (progDesc "Show debug info")))
|
((\_ -> DInfo) <$> (info (helper) (progDesc "Show debug info")))
|
||||||
<> command
|
|
||||||
"numeric-version"
|
|
||||||
( (\_ -> NumericVersion)
|
|
||||||
<$> (info (helper) (progDesc "Show the numeric version"))
|
|
||||||
)
|
|
||||||
<> command
|
<> command
|
||||||
"tool-requirements"
|
"tool-requirements"
|
||||||
( (\_ -> ToolRequirements)
|
( (\_ -> ToolRequirements)
|
||||||
@@ -225,9 +238,35 @@ com =
|
|||||||
(progDesc "Show the requirements for ghc/cabal")
|
(progDesc "Show the requirements for ghc/cabal")
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
<> command
|
||||||
|
"changelog"
|
||||||
|
((info (fmap ChangeLog changelogP <**> helper)
|
||||||
|
(progDesc "Find/show changelog"
|
||||||
|
<> footerDoc (Just $ text changeLogFooter)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
<> commandGroup "Other commands:"
|
<> commandGroup "Other commands:"
|
||||||
<> hidden
|
<> hidden
|
||||||
)
|
)
|
||||||
|
where
|
||||||
|
installFooter = [i|Discussion:
|
||||||
|
Installs the specified GHC version (or a recommended default one) into
|
||||||
|
a self-contained "~/.ghcup/ghc/<ghcver>" directory
|
||||||
|
and symlinks the ghc binaries to "~/.ghcup/bin/<binary>-<ghcver>".|]
|
||||||
|
setFooter = [i|Discussion:
|
||||||
|
Sets the the current GHC version by creating non-versioned
|
||||||
|
symlinks for all ghc binaries of the specified version in
|
||||||
|
"~/.ghcup/bin/<binary>".|]
|
||||||
|
installCabalFooter = [i|Discussion:
|
||||||
|
Installs the specified cabal-install version (or a recommended default one)
|
||||||
|
into "~/.ghcup/bin", so it can be overwritten by later
|
||||||
|
"cabal install cabal-install", which installs into "~/.cabal/bin" by
|
||||||
|
default. Make sure to set up your PATH appropriately, so the cabal
|
||||||
|
installation takes precedence.|]
|
||||||
|
changeLogFooter = [i|Discussion:
|
||||||
|
By default returns the URI of the ChangeLog of the latest GHC release.
|
||||||
|
Pass '-o' to automatically open via xdg-open.|]
|
||||||
|
|
||||||
|
|
||||||
installOpts :: Parser InstallOptions
|
installOpts :: Parser InstallOptions
|
||||||
@@ -275,22 +314,67 @@ rmOpts :: Parser RmOptions
|
|||||||
rmOpts = RmOptions <$> versionArgument
|
rmOpts = RmOptions <$> versionArgument
|
||||||
|
|
||||||
|
|
||||||
|
changelogP :: Parser ChangeLogOptions
|
||||||
|
changelogP =
|
||||||
|
(\x y -> ChangeLogOptions x y)
|
||||||
|
<$> switch (short 'o' <> long "open" <> help "xdg-open the changelog url")
|
||||||
|
<*> (optional
|
||||||
|
(option
|
||||||
|
(eitherReader
|
||||||
|
(\s' -> case fmap toLower s' of
|
||||||
|
"ghc" -> Right GHC
|
||||||
|
"cabal" -> Right Cabal
|
||||||
|
"ghcup" -> Right GHCup
|
||||||
|
e -> Left $ e
|
||||||
|
)
|
||||||
|
)
|
||||||
|
(short 't' <> long "tool" <> metavar "<ghc|cabal|ghcup>" <> help
|
||||||
|
"Open changelog for given tool (default: ghc)"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
<*> optional toolVersionArgument
|
||||||
|
|
||||||
compileP :: Parser CompileCommand
|
compileP :: Parser CompileCommand
|
||||||
compileP = subparser
|
compileP = subparser
|
||||||
( command
|
( command
|
||||||
"ghc"
|
"ghc"
|
||||||
( CompileGHC
|
( CompileGHC
|
||||||
<$> (info (compileOpts <**> helper) (progDesc "Compile GHC from source")
|
<$> (info
|
||||||
|
(compileOpts <**> helper)
|
||||||
|
( progDesc "Compile GHC from source"
|
||||||
|
<> footerDoc (Just $ text compileFooter)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
<> command
|
<> command
|
||||||
"cabal"
|
"cabal"
|
||||||
( CompileCabal
|
( CompileCabal
|
||||||
<$> (info (compileOpts <**> helper)
|
<$> (info
|
||||||
(progDesc "Compile Cabal from source")
|
(compileOpts <**> helper)
|
||||||
|
( progDesc "Compile Cabal from source"
|
||||||
|
<> footerDoc (Just $ text compileCabalFooter)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
where
|
||||||
|
compileFooter = [i|Discussion:
|
||||||
|
Compiles and installs the specified GHC version into
|
||||||
|
a self-contained "~/.ghcup/ghc/<ghcver>" directory
|
||||||
|
and symlinks the ghc binaries to "~/.ghcup/bin/<binary>-<ghcver>".
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
ghcup compile ghc -j 4 -v 8.4.2 -b 8.2.2
|
||||||
|
ghcup compile ghc -j 4 -v 8.4.2 -b /usr/bin/ghc-8.2.2|]
|
||||||
|
compileCabalFooter = [i|Discussion:
|
||||||
|
Compiles and installs the specified Cabal version
|
||||||
|
into "~/.ghcup/bin".
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
ghcup compile cabal -j 4 -v 3.2.0.0 -b 8.6.5
|
||||||
|
ghcup compile cabal -j 4 -v 3.2.0.0 -b /usr/bin/ghc-8.6.5|]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
compileOpts :: Parser CompileOptions
|
compileOpts :: Parser CompileOptions
|
||||||
@@ -371,9 +455,7 @@ toolVersionArgument =
|
|||||||
|
|
||||||
|
|
||||||
versionArgument :: Parser Version
|
versionArgument :: Parser Version
|
||||||
versionArgument = argument
|
versionArgument = argument (eitherReader versionEither) (metavar "VERSION")
|
||||||
(eitherReader versionEither)
|
|
||||||
(metavar "VERSION")
|
|
||||||
|
|
||||||
versionParser :: Parser Version
|
versionParser :: Parser Version
|
||||||
versionParser = option
|
versionParser = option
|
||||||
@@ -390,9 +472,9 @@ tagEither s' = case fmap toLower s' of
|
|||||||
versionEither :: String -> Either String Version
|
versionEither :: String -> Either String Version
|
||||||
versionEither s' =
|
versionEither s' =
|
||||||
-- 'version' is a bit too lax and will parse typoed tags
|
-- 'version' is a bit too lax and will parse typoed tags
|
||||||
case readMaybe ((:[]) . head $ s') :: Maybe Int of
|
case readMaybe ((: []) . head $ s') :: Maybe Int of
|
||||||
Just _ -> bimap (const "Not a valid version") id . version . T.pack $ s'
|
Just _ -> bimap (const "Not a valid version") id . version . T.pack $ s'
|
||||||
Nothing -> Left "Not a valid version"
|
Nothing -> Left "Not a valid version"
|
||||||
|
|
||||||
toolVersionEither :: String -> Either String ToolVersion
|
toolVersionEither :: String -> Either String ToolVersion
|
||||||
toolVersionEither s' =
|
toolVersionEither s' =
|
||||||
@@ -518,11 +600,43 @@ upgradeOptsP =
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
describe_result :: String
|
||||||
|
describe_result = $( (LitE . StringL) <$>
|
||||||
|
runIO (do
|
||||||
|
CapturedProcess{..} <- executeOut [rel|git|] ["describe"] Nothing
|
||||||
|
case _exitCode of
|
||||||
|
ExitSuccess -> pure . T.unpack . decUTF8Safe $ _stdOut
|
||||||
|
ExitFailure _ -> pure numericVer
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
main = do
|
main = do
|
||||||
|
let versionHelp = infoOption
|
||||||
|
( ("The GHCup Haskell installer, version " <>)
|
||||||
|
$ (head . lines $ describe_result)
|
||||||
|
)
|
||||||
|
(long "version" <> help "Show version" <> hidden)
|
||||||
|
let numericVersionHelp = infoOption
|
||||||
|
numericVer
|
||||||
|
( long "numeric-version"
|
||||||
|
<> help "Show the numeric version (for use in scripts)"
|
||||||
|
<> hidden
|
||||||
|
)
|
||||||
|
|
||||||
customExecParser (prefs showHelpOnError) (info (opts <**> helper) idm)
|
let main_footer = [i|Discussion:
|
||||||
|
ghcup installs the Glasgow Haskell Compiler from the official
|
||||||
|
release channels, enabling you to easily switch between different
|
||||||
|
versions.
|
||||||
|
|
||||||
|
Report bugs at <https://gitlab.haskell.org/haskell/ghcup-hs/issues>|]
|
||||||
|
|
||||||
|
customExecParser
|
||||||
|
(prefs showHelpOnError)
|
||||||
|
(info (opts <**> helper <**> versionHelp <**> numericVersionHelp)
|
||||||
|
(footerDoc (Just $ text main_footer))
|
||||||
|
)
|
||||||
>>= \opt@Options {..} -> do
|
>>= \opt@Options {..} -> do
|
||||||
let settings = toSettings opt
|
let settings = toSettings opt
|
||||||
|
|
||||||
@@ -570,10 +684,7 @@ main = do
|
|||||||
, TagNotFound
|
, TagNotFound
|
||||||
]
|
]
|
||||||
|
|
||||||
let runListGHC =
|
let runListGHC = runE @'[] . runLogger
|
||||||
runLogger
|
|
||||||
. flip runReaderT settings
|
|
||||||
. runE @'[FileDoesNotExistError]
|
|
||||||
|
|
||||||
let runRmGHC =
|
let runRmGHC =
|
||||||
runLogger . flip runReaderT settings . runE @'[NotInstalled]
|
runLogger . flip runReaderT settings . runE @'[NotInstalled]
|
||||||
@@ -644,135 +755,153 @@ main = do
|
|||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight r -> pure r
|
VRight r -> pure r
|
||||||
VLeft e ->
|
VLeft e -> do
|
||||||
runLogger
|
runLogger
|
||||||
($(logError) [i|Error fetching download info: #{e}|])
|
($(logError) [i|Error fetching download info: #{e}|])
|
||||||
>> exitFailure
|
exitWith (ExitFailure 2)
|
||||||
runLogger $ checkForUpdates dls
|
runLogger $ checkForUpdates dls
|
||||||
|
|
||||||
case optCommand of
|
res <- case optCommand of
|
||||||
Install (InstallOptions {..}) ->
|
Install (InstallOptions {..}) ->
|
||||||
void
|
(runInstTool $ do
|
||||||
$ (runInstTool $ do
|
v <- liftE $ fromVersion dls instVer GHC
|
||||||
v <- liftE $ fromVersion dls instVer GHC
|
liftE $ installGHCBin dls v instPlatform
|
||||||
liftE $ installGHCBin dls v instPlatform
|
)
|
||||||
)
|
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ ->
|
VRight _ -> do
|
||||||
runLogger $ $(logInfo) ("GHC installation successful")
|
runLogger $ $(logInfo) ("GHC installation successful")
|
||||||
VLeft (V (AlreadyInstalled _ v)) ->
|
pure ExitSuccess
|
||||||
|
VLeft (V (AlreadyInstalled _ v)) -> do
|
||||||
runLogger $ $(logWarn)
|
runLogger $ $(logWarn)
|
||||||
[i|GHC ver #{prettyVer v} already installed|]
|
[i|GHC ver #{prettyVer v} already installed|]
|
||||||
VLeft (V (BuildFailed tmpdir e)) ->
|
pure ExitSuccess
|
||||||
|
VLeft (V (BuildFailed tmpdir e)) -> do
|
||||||
runLogger
|
runLogger
|
||||||
($(logError) [i|Build failed with #{e}
|
($(logError) [i|Build failed with #{e}
|
||||||
Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues.|]
|
Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues.|]
|
||||||
)
|
)
|
||||||
>> exitFailure
|
pure $ ExitFailure 3
|
||||||
VLeft e -> do
|
VLeft e -> do
|
||||||
runLogger $ do
|
runLogger $ do
|
||||||
$(logError) [i|#{e}|]
|
$(logError) [i|#{e}|]
|
||||||
$(logError) [i|Also check the logs in ~/.ghcup/logs|]
|
$(logError) [i|Also check the logs in ~/.ghcup/logs|]
|
||||||
exitFailure
|
pure $ ExitFailure 3
|
||||||
InstallCabal (InstallOptions {..}) ->
|
InstallCabal (InstallOptions {..}) ->
|
||||||
void
|
(runInstTool $ do
|
||||||
$ (runInstTool $ do
|
v <- liftE $ fromVersion dls instVer Cabal
|
||||||
v <- liftE $ fromVersion dls instVer Cabal
|
liftE $ installCabalBin dls v instPlatform
|
||||||
liftE $ installCabalBin dls v instPlatform
|
)
|
||||||
)
|
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ ->
|
VRight _ -> do
|
||||||
runLogger $ $(logInfo) ("Cabal installation successful")
|
runLogger $ $(logInfo) ("Cabal installation successful")
|
||||||
VLeft (V (AlreadyInstalled _ v)) ->
|
pure ExitSuccess
|
||||||
|
VLeft (V (AlreadyInstalled _ v)) -> do
|
||||||
runLogger $ $(logWarn)
|
runLogger $ $(logWarn)
|
||||||
[i|Cabal ver #{prettyVer v} already installed|]
|
[i|Cabal ver #{prettyVer v} already installed|]
|
||||||
|
pure ExitSuccess
|
||||||
VLeft e -> do
|
VLeft e -> do
|
||||||
runLogger $ do
|
runLogger $ do
|
||||||
$(logError) [i|#{e}|]
|
$(logError) [i|#{e}|]
|
||||||
$(logError) [i|Also check the logs in ~/.ghcup/logs|]
|
$(logError) [i|Also check the logs in ~/.ghcup/logs|]
|
||||||
exitFailure
|
pure $ ExitFailure 4
|
||||||
|
|
||||||
SetGHC (SetGHCOptions {..}) ->
|
SetGHC (SetGHCOptions {..}) ->
|
||||||
void
|
(runSetGHC $ do
|
||||||
$ (runSetGHC $ do
|
v <- liftE $ fromVersion dls ghcVer GHC
|
||||||
v <- liftE $ fromVersion dls ghcVer GHC
|
liftE $ setGHC v SetGHCOnly
|
||||||
liftE $ setGHC v SetGHCOnly
|
)
|
||||||
)
|
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ ->
|
VRight v -> do
|
||||||
runLogger $ $(logInfo) ("GHC successfully set")
|
runLogger
|
||||||
VLeft e ->
|
$ $(logInfo)
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
[i|GHC #{prettyVer v} successfully set as default version|]
|
||||||
|
pure ExitSuccess
|
||||||
|
VLeft e -> do
|
||||||
|
runLogger ($(logError) [i|#{e}|])
|
||||||
|
pure $ ExitFailure 5
|
||||||
|
|
||||||
List (ListOptions {..}) ->
|
List (ListOptions {..}) ->
|
||||||
void
|
(runListGHC $ do
|
||||||
$ (runListGHC $ do
|
l <- listVersions dls lTool lCriteria
|
||||||
liftIO $ listVersions dls lTool lCriteria
|
pure l
|
||||||
)
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight r -> liftIO $ printListResult r
|
VRight r -> do
|
||||||
VLeft e ->
|
liftIO $ printListResult r
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
pure ExitSuccess
|
||||||
|
VLeft e -> do
|
||||||
|
runLogger ($(logError) [i|#{e}|])
|
||||||
|
pure $ ExitFailure 6
|
||||||
|
|
||||||
Rm (RmOptions {..}) ->
|
Rm (RmOptions {..}) ->
|
||||||
void
|
(runRmGHC $ do
|
||||||
$ (runRmGHC $ do
|
liftE $ rmGHCVer ghcVer
|
||||||
liftE $ rmGHCVer ghcVer
|
)
|
||||||
)
|
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ -> pure ()
|
VRight _ -> pure ExitSuccess
|
||||||
VLeft e ->
|
VLeft e -> do
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
runLogger ($(logError) [i|#{e}|])
|
||||||
|
pure $ ExitFailure 7
|
||||||
|
|
||||||
DInfo -> do
|
DInfo ->
|
||||||
void
|
do
|
||||||
$ (runDebugInfo $ do
|
(runDebugInfo $ liftE $ getDebugInfo)
|
||||||
liftE $ getDebugInfo
|
|
||||||
)
|
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight dinfo -> putStrLn $ show dinfo
|
VRight dinfo -> do
|
||||||
VLeft e ->
|
putStrLn $ prettyDebugInfo dinfo
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
pure ExitSuccess
|
||||||
|
VLeft e -> do
|
||||||
|
runLogger ($(logError) [i|#{e}|])
|
||||||
|
pure $ ExitFailure 8
|
||||||
|
|
||||||
Compile (CompileGHC CompileOptions {..}) ->
|
Compile (CompileGHC CompileOptions {..}) ->
|
||||||
void
|
(runCompileGHC $ liftE $ compileGHC dls
|
||||||
$ (runCompileGHC $ do
|
targetVer
|
||||||
liftE
|
bootstrapGhc
|
||||||
$ compileGHC dls targetVer bootstrapGhc jobs buildConfig patchDir
|
jobs
|
||||||
)
|
buildConfig
|
||||||
|
patchDir
|
||||||
|
)
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ ->
|
VRight _ -> do
|
||||||
runLogger $ $(logInfo)
|
runLogger $ $(logInfo)
|
||||||
("GHC successfully compiled and installed")
|
("GHC successfully compiled and installed")
|
||||||
VLeft (V (AlreadyInstalled _ v)) ->
|
pure ExitSuccess
|
||||||
|
VLeft (V (AlreadyInstalled _ v)) -> do
|
||||||
runLogger $ $(logWarn)
|
runLogger $ $(logWarn)
|
||||||
[i|GHC ver #{prettyVer v} already installed|]
|
[i|GHC ver #{prettyVer v} already installed|]
|
||||||
VLeft (V (BuildFailed tmpdir e)) ->
|
pure ExitSuccess
|
||||||
|
VLeft (V (BuildFailed tmpdir e)) -> do
|
||||||
runLogger
|
runLogger
|
||||||
($(logError) [i|Build failed with #{e}
|
($(logError) [i|Build failed with #{e}
|
||||||
Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues.|]
|
Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues.
|
||||||
)
|
Make sure to clean up #{tmpdir} afterwards.|]
|
||||||
>> exitFailure
|
)
|
||||||
VLeft e ->
|
pure $ ExitFailure 9
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
VLeft e -> do
|
||||||
|
runLogger ($(logError) [i|#{e}|])
|
||||||
|
pure $ ExitFailure 9
|
||||||
|
|
||||||
Compile (CompileCabal CompileOptions {..}) ->
|
Compile (CompileCabal CompileOptions {..}) ->
|
||||||
void
|
(runCompileCabal $ do
|
||||||
$ (runCompileCabal $ do
|
liftE $ compileCabal dls targetVer bootstrapGhc jobs patchDir
|
||||||
liftE $ compileCabal dls targetVer bootstrapGhc jobs patchDir
|
)
|
||||||
)
|
|
||||||
>>= \case
|
>>= \case
|
||||||
VRight _ ->
|
VRight _ -> do
|
||||||
runLogger $ $(logInfo)
|
|
||||||
("Cabal successfully compiled and installed")
|
|
||||||
VLeft (V (BuildFailed tmpdir e)) ->
|
|
||||||
runLogger
|
runLogger
|
||||||
($(logError) [i|Build failed with #{e}
|
($(logInfo)
|
||||||
|
"Cabal successfully compiled and installed"
|
||||||
|
)
|
||||||
|
pure ExitSuccess
|
||||||
|
VLeft (V (BuildFailed tmpdir e)) -> do
|
||||||
|
runLogger
|
||||||
|
($(logError) [i|Build failed with #{e}
|
||||||
Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues.|]
|
Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues.|]
|
||||||
)
|
)
|
||||||
>> exitFailure
|
pure $ ExitFailure 10
|
||||||
VLeft e ->
|
VLeft e -> do
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
runLogger ($(logError) [i|#{e}|])
|
||||||
|
pure $ ExitFailure 10
|
||||||
|
|
||||||
Upgrade (uOpts) force -> do
|
Upgrade (uOpts) force -> do
|
||||||
target <- case uOpts of
|
target <- case uOpts of
|
||||||
@@ -785,38 +914,74 @@ Check the logs at ~/.ghcup/logs and the build directory #{tmpdir} for more clues
|
|||||||
bdir <- liftIO $ ghcupBinDir
|
bdir <- liftIO $ ghcupBinDir
|
||||||
pure (Just (bdir </> [rel|ghcup|]))
|
pure (Just (bdir </> [rel|ghcup|]))
|
||||||
|
|
||||||
void
|
(runUpgrade $ (liftE $ upgradeGHCup dls target force)) >>= \case
|
||||||
$ (runUpgrade $ do
|
VRight v' -> do
|
||||||
liftE $ upgradeGHCup dls target force
|
let pretty_v = prettyVer v'
|
||||||
)
|
runLogger $ $(logInfo)
|
||||||
>>= \case
|
[i|Successfully upgraded GHCup to version #{pretty_v}|]
|
||||||
VRight v' -> do
|
pure ExitSuccess
|
||||||
let pretty_v = prettyVer v'
|
VLeft (V NoUpdate) -> do
|
||||||
runLogger
|
runLogger $ $(logWarn) [i|No GHCup update available|]
|
||||||
$ $(logInfo)
|
pure ExitSuccess
|
||||||
[i|Successfully upgraded GHCup to version #{pretty_v}|]
|
VLeft e -> do
|
||||||
VLeft (V NoUpdate) ->
|
runLogger ($(logError) [i|#{e}|])
|
||||||
runLogger $ $(logWarn)
|
pure $ ExitFailure 11
|
||||||
[i|No GHCup update available|]
|
|
||||||
VLeft e ->
|
|
||||||
runLogger ($(logError) [i|#{e}|]) >> exitFailure
|
|
||||||
|
|
||||||
NumericVersion -> T.hPutStr stdout (prettyPVP ghcUpVer)
|
ToolRequirements ->
|
||||||
ToolRequirements -> (runLogger $ runE
|
( runLogger
|
||||||
@'[ NoCompatiblePlatform
|
$ runE
|
||||||
, DistroNotFound
|
@'[NoCompatiblePlatform , DistroNotFound , NoToolRequirements]
|
||||||
, NoToolRequirements
|
$ do
|
||||||
] $ do
|
platform <- liftE $ getPlatform
|
||||||
platform <- liftE $ getPlatform
|
req <-
|
||||||
req <- (getCommonRequirements platform $ treq)
|
(getCommonRequirements platform $ treq)
|
||||||
?? NoToolRequirements
|
?? NoToolRequirements
|
||||||
liftIO $ T.hPutStr stdout (prettyRequirements req))
|
liftIO $ T.hPutStr stdout (prettyRequirements req)
|
||||||
>>= \case
|
)
|
||||||
VRight r -> pure r
|
>>= \case
|
||||||
VLeft e ->
|
VRight _ -> pure ExitSuccess
|
||||||
runLogger
|
VLeft e -> do
|
||||||
($(logError) [i|Error getting tool requirements: #{e}|])
|
runLogger
|
||||||
>> exitFailure
|
($(logError)
|
||||||
|
[i|Error getting tool requirements: #{e}|]
|
||||||
|
)
|
||||||
|
pure $ ExitFailure 12
|
||||||
|
|
||||||
|
ChangeLog (ChangeLogOptions {..}) -> do
|
||||||
|
let tool = fromMaybe GHC clTool
|
||||||
|
ver' = maybe
|
||||||
|
(Right Latest)
|
||||||
|
(\case
|
||||||
|
ToolVersion tv -> Left tv
|
||||||
|
ToolTag t -> Right t
|
||||||
|
)
|
||||||
|
clToolVer
|
||||||
|
muri = getChangeLog dls tool ver'
|
||||||
|
case muri of
|
||||||
|
Nothing -> do
|
||||||
|
runLogger
|
||||||
|
($(logWarn)
|
||||||
|
[i|Could not find ChangeLog for #{tool}, version #{either (T.unpack . prettyVer) show ver'}|]
|
||||||
|
)
|
||||||
|
pure ExitSuccess
|
||||||
|
Just uri -> do
|
||||||
|
let uri' = T.unpack . decUTF8Safe . serializeURIRef' $ uri
|
||||||
|
if clOpen
|
||||||
|
then
|
||||||
|
exec "xdg-open"
|
||||||
|
True
|
||||||
|
[serializeURIRef' uri]
|
||||||
|
Nothing
|
||||||
|
Nothing
|
||||||
|
>>= \case
|
||||||
|
Right _ -> pure ExitSuccess
|
||||||
|
Left e -> runLogger ($(logError) [i|#{e}|])
|
||||||
|
>> pure (ExitFailure 13)
|
||||||
|
else putStrLn uri' >> pure ExitSuccess
|
||||||
|
|
||||||
|
case res of
|
||||||
|
ExitSuccess -> pure ()
|
||||||
|
ef@(ExitFailure _) -> exitWith ef
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
|
|
||||||
@@ -857,17 +1022,61 @@ printListResult lr = do
|
|||||||
, fmap toLower . show $ lTool
|
, fmap toLower . show $ lTool
|
||||||
, T.unpack . prettyVer $ lVer
|
, T.unpack . prettyVer $ lVer
|
||||||
, intercalate "," $ ((fmap . fmap) toLower . fmap show $ lTag)
|
, intercalate "," $ ((fmap . fmap) toLower . fmap show $ lTag)
|
||||||
, if fromSrc then (color Blue "compiled") else mempty
|
, intercalate "," $
|
||||||
|
(if fromSrc then [color Blue "compiled"] else mempty)
|
||||||
|
++ (if lStray then [color Blue "stray"] else mempty)
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
lr
|
lr
|
||||||
putStrLn $ formatted
|
putStrLn $ formatted
|
||||||
|
|
||||||
|
|
||||||
checkForUpdates :: (MonadFail m, MonadLogger m) => GHCupDownloads -> m ()
|
checkForUpdates :: (MonadThrow m, MonadIO m, MonadFail m, MonadLogger m)
|
||||||
|
=> GHCupDownloads
|
||||||
|
-> m ()
|
||||||
checkForUpdates dls = do
|
checkForUpdates dls = do
|
||||||
forM_ (getLatest dls GHCup) $ \l -> do
|
forM_ (getLatest dls GHCup) $ \l -> do
|
||||||
(Right ghc_ver) <- pure $ version $ prettyPVP ghcUpVer
|
(Right ghc_ver) <- pure $ version $ prettyPVP ghcUpVer
|
||||||
when (l > ghc_ver)
|
when (l > ghc_ver)
|
||||||
$ $(logWarn)
|
$ $(logWarn)
|
||||||
[i|New GHCup version available: #{prettyVer l}. To upgrade, run 'ghcup upgrade'|]
|
[i|New GHCup version available: #{prettyVer l}. To upgrade, run 'ghcup upgrade'|]
|
||||||
|
|
||||||
|
forM_ (getLatest dls GHC) $ \l -> do
|
||||||
|
mghc_ver <- latestInstalled GHC
|
||||||
|
forM mghc_ver $ \ghc_ver ->
|
||||||
|
when (l > ghc_ver)
|
||||||
|
$ $(logWarn)
|
||||||
|
[i|New GHC version available: #{prettyVer l}. To upgrade, run 'ghcup install #{prettyVer l}'|]
|
||||||
|
|
||||||
|
forM_ (getLatest dls Cabal) $ \l -> do
|
||||||
|
mcabal_ver <- latestInstalled Cabal
|
||||||
|
forM mcabal_ver $ \cabal_ver ->
|
||||||
|
when (l > cabal_ver)
|
||||||
|
$ $(logWarn)
|
||||||
|
[i|New Cabal version available: #{prettyVer l}. To upgrade, run 'ghcup install-cabal #{prettyVer l}'|]
|
||||||
|
|
||||||
|
where
|
||||||
|
latestInstalled tool = (fmap lVer . lastMay)
|
||||||
|
<$> (listVersions dls (Just tool) (Just ListInstalled))
|
||||||
|
|
||||||
|
|
||||||
|
prettyDebugInfo :: DebugInfo -> String
|
||||||
|
prettyDebugInfo DebugInfo {..} = [i|Debug Info
|
||||||
|
==========
|
||||||
|
GHCup base dir: #{toFilePath diBaseDir}
|
||||||
|
GHCup bin dir: #{toFilePath diBinDir}
|
||||||
|
GHCup GHC directory: #{toFilePath diGHCDir}
|
||||||
|
GHCup cache directory: #{toFilePath diCacheDir}
|
||||||
|
Architecture: #{prettyArch diArch}
|
||||||
|
Platform: #{prettyPlatform diPlatform}
|
||||||
|
Version: #{describe_result}|]
|
||||||
|
where
|
||||||
|
prettyArch :: Architecture -> String
|
||||||
|
prettyArch A_64 = "amd64"
|
||||||
|
prettyArch A_32 = "i386"
|
||||||
|
prettyPlatform :: PlatformResult -> String
|
||||||
|
prettyPlatform PlatformResult { _platform = plat, _distroVersion = Just v' }
|
||||||
|
= show plat <> ", " <> show v'
|
||||||
|
prettyPlatform PlatformResult { _platform = plat, _distroVersion = Nothing }
|
||||||
|
= show plat
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ download_ghcup() {
|
|||||||
"linux"|"Linux")
|
"linux"|"Linux")
|
||||||
case "${_arch}" in
|
case "${_arch}" in
|
||||||
x86_64|amd64)
|
x86_64|amd64)
|
||||||
_url=https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup
|
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4
|
||||||
;;
|
;;
|
||||||
i*86)
|
i*86)
|
||||||
_url=https://downloads.haskell.org/~ghcup/i386-linux-ghcup
|
_url=https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4
|
||||||
;;
|
;;
|
||||||
*) die "Unknown architecture: ${_arch}"
|
*) die "Unknown architecture: ${_arch}"
|
||||||
;;
|
;;
|
||||||
@@ -50,7 +50,7 @@ download_ghcup() {
|
|||||||
*) die "Unknown architecture: ${_arch}"
|
*) die "Unknown architecture: ${_arch}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_url=https://downloads.haskell.org/~ghcup/x86_64-portbld-freebsd-ghcup
|
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4
|
||||||
;;
|
;;
|
||||||
"Darwin"|"darwin")
|
"Darwin"|"darwin")
|
||||||
case "${_arch}" in
|
case "${_arch}" in
|
||||||
@@ -62,7 +62,7 @@ download_ghcup() {
|
|||||||
*) die "Unknown architecture: ${_arch}"
|
*) die "Unknown architecture: ${_arch}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_url=https://downloads.haskell.org/~ghcup/x86_64-apple-darwin-ghcup ;;
|
_url=https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4 ;;
|
||||||
*) die "Unknown platform: ${_plat}"
|
*) die "Unknown platform: ${_plat}"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
@@ -108,6 +108,7 @@ else
|
|||||||
EOF
|
EOF
|
||||||
# shellcheck disable=SC1090
|
# shellcheck disable=SC1090
|
||||||
edo . "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env
|
edo . "${GHCUP_INSTALL_BASE_PREFIX}"/.ghcup/env
|
||||||
|
eghcup upgrade
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -170,6 +170,7 @@
|
|||||||
"dlSubdir": "ghc-8.6.2",
|
"dlSubdir": "ghc-8.6.2",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.6.2/ghc-8.6.2-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.2/docs/html/users_guide/8.6.2-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.0.2": {
|
"8.0.2": {
|
||||||
@@ -264,6 +265,7 @@
|
|||||||
"dlSubdir": "ghc-8.0.2",
|
"dlSubdir": "ghc-8.0.2",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.0.2/ghc-8.0.2-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.0.2/docs/html/users_guide/8.0.1-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.6.4": {
|
"8.6.4": {
|
||||||
@@ -377,6 +379,7 @@
|
|||||||
"dlSubdir": "ghc-8.6.4",
|
"dlSubdir": "ghc-8.6.4",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.6.4/ghc-8.6.4-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.4/docs/html/users_guide/8.6.4-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.4.1": {
|
"8.4.1": {
|
||||||
@@ -482,6 +485,7 @@
|
|||||||
"dlSubdir": "ghc-8.4.1",
|
"dlSubdir": "ghc-8.4.1",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.4.1/ghc-8.4.1-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.1/docs/html/users_guide/8.4.1-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.6.3": {
|
"8.6.3": {
|
||||||
@@ -616,6 +620,7 @@
|
|||||||
"dlSubdir": "ghc-8.6.3",
|
"dlSubdir": "ghc-8.6.3",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.6.3/ghc-8.6.3-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.3/docs/html/users_guide/8.6.3-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.10.1": {
|
"8.10.1": {
|
||||||
@@ -756,6 +761,7 @@
|
|||||||
"dlSubdir": "ghc-8.10.1",
|
"dlSubdir": "ghc-8.10.1",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.10.1/ghc-8.10.1-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.10.1/docs/html/users_guide/8.10.1-notes.html",
|
||||||
"viTags": [
|
"viTags": [
|
||||||
"Latest"
|
"Latest"
|
||||||
]
|
]
|
||||||
@@ -885,6 +891,7 @@
|
|||||||
"dlSubdir": "ghc-8.6.5",
|
"dlSubdir": "ghc-8.6.5",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.5/docs/html/users_guide/8.6.5-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.4.2": {
|
"8.4.2": {
|
||||||
@@ -1005,6 +1012,7 @@
|
|||||||
"dlSubdir": "ghc-8.4.2",
|
"dlSubdir": "ghc-8.4.2",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.4.2/ghc-8.4.2-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.2/docs/html/users_guide/8.4.2-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.8.1": {
|
"8.8.1": {
|
||||||
@@ -1132,6 +1140,7 @@
|
|||||||
"dlSubdir": "ghc-8.8.1",
|
"dlSubdir": "ghc-8.8.1",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.8.1/ghc-8.8.1-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.8.1/docs/html/users_guide/8.8.1-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.4.3": {
|
"8.4.3": {
|
||||||
@@ -1245,6 +1254,7 @@
|
|||||||
"dlSubdir": "ghc-8.4.3",
|
"dlSubdir": "ghc-8.4.3",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.4.3/ghc-8.4.3-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.3/docs/html/users_guide/8.4.3-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.6.1": {
|
"8.6.1": {
|
||||||
@@ -1365,6 +1375,7 @@
|
|||||||
"dlSubdir": "ghc-8.6.1",
|
"dlSubdir": "ghc-8.6.1",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.6.1/ghc-8.6.1-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.6.1/ghc-8.6.1-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.6.1/docs/html/users_guide/8.6.1-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.8.2": {
|
"8.8.2": {
|
||||||
@@ -1492,6 +1503,7 @@
|
|||||||
"dlSubdir": "ghc-8.8.2",
|
"dlSubdir": "ghc-8.8.2",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.8.2/ghc-8.8.2-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.8.2/docs/html/users_guide/8.8.2-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"7.10.3": {
|
"7.10.3": {
|
||||||
@@ -1618,6 +1630,7 @@
|
|||||||
"dlSubdir": "ghc-7.10.3",
|
"dlSubdir": "ghc-7.10.3",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/7.10.3/ghc-7.10.3-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/7.10.3/docs/html/users_guide/release-7-10-1.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.2.2": {
|
"8.2.2": {
|
||||||
@@ -1722,6 +1735,7 @@
|
|||||||
"dlSubdir": "ghc-8.2.2",
|
"dlSubdir": "ghc-8.2.2",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.2.2/ghc-8.2.2-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.2.2/docs/html/users_guide/8.2.2-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.4.4": {
|
"8.4.4": {
|
||||||
@@ -1856,6 +1870,7 @@
|
|||||||
"dlSubdir": "ghc-8.4.4",
|
"dlSubdir": "ghc-8.4.4",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.4.4/ghc-8.4.4-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.4.4/docs/html/users_guide/8.4.4-notes.html",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"8.8.3": {
|
"8.8.3": {
|
||||||
@@ -1943,7 +1958,7 @@
|
|||||||
"A_32": {
|
"A_32": {
|
||||||
"Linux_Alpine": {
|
"Linux_Alpine": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "23779adb4cf4b314d0f8c66ee215ba6e74154c0768a573780475943544020bec",
|
"dlHash": "7a5f41646d06777e75636291a1855d60a0984552bbdf33c3d107565d302f38a4",
|
||||||
"dlSubdir": "ghc-8.8.3",
|
"dlSubdir": "ghc-8.8.3",
|
||||||
"dlUri": "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.3-musl/ghc-8.8.3-i386-unknown-linux-musl.tar.xz"
|
"dlUri": "https://github.com/redneb/ghc-alt-libc/releases/download/ghc-8.8.3-musl/ghc-8.8.3-i386-unknown-linux-musl.tar.xz"
|
||||||
}
|
}
|
||||||
@@ -1983,6 +1998,7 @@
|
|||||||
"dlSubdir": "ghc-8.8.3",
|
"dlSubdir": "ghc-8.8.3",
|
||||||
"dlUri": "https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-src.tar.xz"
|
"dlUri": "https://downloads.haskell.org/~ghc/8.8.3/ghc-8.8.3-src.tar.xz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/ghc/8.8.3/docs/html/users_guide/8.8.3-notes.html",
|
||||||
"viTags": [
|
"viTags": [
|
||||||
"Recommended"
|
"Recommended"
|
||||||
]
|
]
|
||||||
@@ -2022,6 +2038,7 @@
|
|||||||
"dlSubdir": "cabal-cabal-install-v3.0.0.0/cabal-install",
|
"dlSubdir": "cabal-cabal-install-v3.0.0.0/cabal-install",
|
||||||
"dlUri": "https://github.com/haskell/cabal/archive/cabal-install-v3.0.0.0.tar.gz"
|
"dlUri": "https://github.com/haskell/cabal/archive/cabal-install-v3.0.0.0.tar.gz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/~cabal/cabal-install-3.0.0.0/changelog",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
},
|
},
|
||||||
"3.2.0.0": {
|
"3.2.0.0": {
|
||||||
@@ -2057,6 +2074,7 @@
|
|||||||
"dlSubdir": "cabal-cabal-install-v3.2.0.0/cabal-install",
|
"dlSubdir": "cabal-cabal-install-v3.2.0.0/cabal-install",
|
||||||
"dlUri": "https://github.com/haskell/cabal/archive/cabal-install-v3.2.0.0.tar.gz"
|
"dlUri": "https://github.com/haskell/cabal/archive/cabal-install-v3.2.0.0.tar.gz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/changelog",
|
||||||
"viTags": [
|
"viTags": [
|
||||||
"Recommended",
|
"Recommended",
|
||||||
"Latest"
|
"Latest"
|
||||||
@@ -2109,46 +2127,48 @@
|
|||||||
"dlSubdir": "cabal-cabal-install-v2.4.1.0/cabal-install",
|
"dlSubdir": "cabal-cabal-install-v2.4.1.0/cabal-install",
|
||||||
"dlUri": "https://github.com/haskell/cabal/archive/cabal-install-v2.4.1.0.tar.gz"
|
"dlUri": "https://github.com/haskell/cabal/archive/cabal-install-v2.4.1.0.tar.gz"
|
||||||
},
|
},
|
||||||
|
"viChangeLog": "https://downloads.haskell.org/~cabal/cabal-install-2.4.1.0/changelog",
|
||||||
"viTags": []
|
"viTags": []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"GHCup": {
|
"GHCup": {
|
||||||
"0.1.1": {
|
"0.1.4": {
|
||||||
"viArch": {
|
"viArch": {
|
||||||
"A_64": {
|
"A_64": {
|
||||||
"FreeBSD": {
|
"FreeBSD": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "1336585b15692d6458edf4d913fd585d9963a708e2c952a71ee1ad3400ed2163",
|
"dlHash": "cda0b959f053abc04ab0a1b9919a505b8c9304e2898a291f527a370cb0e00731",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/ghcup/0.1.1/x86_64-portbld-freebsd-ghcup-0.1.1"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/x86_64-portbld-freebsd-ghcup-0.1.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Darwin": {
|
"Darwin": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "b9694de40134e3d17611749eba94d8e4d00a84e2a16bb2409eab1e87f810dacd",
|
"dlHash": "2422b79933ae037237ccb8f836417b90b3111d7931beb7ae8b9e33a1945c641e",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/ghcup/0.1.1/x86_64-apple-darwin-ghcup-0.1.1"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/x86_64-apple-darwin-ghcup-0.1.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Linux_UnknownLinux": {
|
"Linux_UnknownLinux": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "2789fbab2848e4dfd77406b9a710c925b3b9680ac0f8486caca190628646486f",
|
"dlHash": "78d69ed4c9a810a445af89ea25e4217a632799ecb427b06cd2320ffb574f555e",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/ghcup/0.1.1/x86_64-linux-ghcup-0.1.1"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/x86_64-linux-ghcup-0.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"A_32": {
|
"A_32": {
|
||||||
"Linux_UnknownLinux": {
|
"Linux_UnknownLinux": {
|
||||||
"unknown_versioning": {
|
"unknown_versioning": {
|
||||||
"dlHash": "f576f22efdcf17fa18189b65d70e596d14f2347ef549a00592ef28d529c7d5a0",
|
"dlHash": "057cc1cc39abdacd92cb1d4fb44c850fd9c5398a36b893286248ac5c38bc0c70",
|
||||||
"dlSubdir": null,
|
"dlSubdir": null,
|
||||||
"dlUri": "https://downloads.haskell.org/ghcup/0.1.1/i386-linux-ghcup-0.1.1"
|
"dlUri": "https://downloads.haskell.org/~ghcup/0.1.4/i386-linux-ghcup-0.1.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"viSourceDL": null,
|
"viSourceDL": null,
|
||||||
|
"viChangeLog": "https://gitlab.haskell.org/haskell/ghcup-hs/-/blob/master/CHANGELOG.md",
|
||||||
"viTags": [
|
"viTags": [
|
||||||
"Recommended",
|
"Recommended",
|
||||||
"Latest"
|
"Latest"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
cabal-version: 3.0
|
cabal-version: 3.0
|
||||||
name: ghcup
|
name: ghcup
|
||||||
version: 0.1.2
|
version: 0.1.4
|
||||||
synopsis: ghc toolchain installer as an exe/library
|
synopsis: ghc toolchain installer as an exe/library
|
||||||
description:
|
description:
|
||||||
A rewrite of the shell script ghcup, for providing
|
A rewrite of the shell script ghcup, for providing
|
||||||
@@ -326,8 +326,10 @@ executable ghcup
|
|||||||
, optparse-applicative
|
, optparse-applicative
|
||||||
, pretty-terminal
|
, pretty-terminal
|
||||||
, resourcet
|
, resourcet
|
||||||
|
, safe
|
||||||
, string-interpolate
|
, string-interpolate
|
||||||
, table-layout
|
, table-layout
|
||||||
|
, template-haskell
|
||||||
, text
|
, text
|
||||||
, uri-bytestring
|
, uri-bytestring
|
||||||
, utf8-string
|
, utf8-string
|
||||||
|
|||||||
86
lib/GHCup.hs
86
lib/GHCup.hs
@@ -9,6 +9,7 @@
|
|||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
{-# LANGUAGE TypeApplications #-}
|
{-# LANGUAGE TypeApplications #-}
|
||||||
{-# LANGUAGE TypeFamilies #-}
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
{-# LANGUAGE ViewPatterns #-}
|
||||||
|
|
||||||
module GHCup where
|
module GHCup where
|
||||||
|
|
||||||
@@ -228,7 +229,7 @@ installCabalBin bDls ver mpfReq = do
|
|||||||
setGHC :: (MonadLogger m, MonadThrow m, MonadFail m, MonadIO m)
|
setGHC :: (MonadLogger m, MonadThrow m, MonadFail m, MonadIO m)
|
||||||
=> Version
|
=> Version
|
||||||
-> SetGHC
|
-> SetGHC
|
||||||
-> Excepts '[NotInstalled] m ()
|
-> Excepts '[NotInstalled] m Version
|
||||||
setGHC ver sghc = do
|
setGHC ver sghc = do
|
||||||
let verBS = verToBS ver
|
let verBS = verToBS ver
|
||||||
ghcdir <- liftIO $ ghcupGHCDir ver
|
ghcdir <- liftIO $ ghcupGHCDir ver
|
||||||
@@ -247,7 +248,6 @@ setGHC ver sghc = do
|
|||||||
-- for ghc tools (ghc, ghci, haddock, ...)
|
-- for ghc tools (ghc, ghci, haddock, ...)
|
||||||
verfiles <- ghcToolFiles ver
|
verfiles <- ghcToolFiles ver
|
||||||
forM_ verfiles $ \file -> do
|
forM_ verfiles $ \file -> do
|
||||||
liftIO $ hideError doesNotExistErrorType $ deleteFile (bindir </> file)
|
|
||||||
targetFile <- case sghc of
|
targetFile <- case sghc of
|
||||||
SetGHCOnly -> pure file
|
SetGHCOnly -> pure file
|
||||||
SetGHC_XY -> do
|
SetGHC_XY -> do
|
||||||
@@ -266,7 +266,7 @@ setGHC ver sghc = do
|
|||||||
-- create symlink for share dir
|
-- create symlink for share dir
|
||||||
lift $ symlinkShareDir ghcdir verBS
|
lift $ symlinkShareDir ghcdir verBS
|
||||||
|
|
||||||
pure ()
|
pure ver
|
||||||
|
|
||||||
where
|
where
|
||||||
|
|
||||||
@@ -306,25 +306,38 @@ data ListResult = ListResult
|
|||||||
, lVer :: Version
|
, lVer :: Version
|
||||||
, lTag :: [Tag]
|
, lTag :: [Tag]
|
||||||
, lInstalled :: Bool
|
, lInstalled :: Bool
|
||||||
, lSet :: Bool
|
, lSet :: Bool -- ^ currently active version
|
||||||
, fromSrc :: Bool
|
, fromSrc :: Bool -- ^ compiled from source
|
||||||
|
, lStray :: Bool -- ^ not in download info
|
||||||
}
|
}
|
||||||
deriving Show
|
deriving (Eq, Ord, Show)
|
||||||
|
|
||||||
|
|
||||||
availableToolVersions :: GHCupDownloads -> Tool -> [(Version, [Tag])]
|
availableToolVersions :: GHCupDownloads -> Tool -> Map.Map Version [Tag]
|
||||||
availableToolVersions av tool = toListOf
|
availableToolVersions av tool = view
|
||||||
(ix tool % to (fmap (\(v, vi) -> (v, (_viTags vi))) . Map.toList) % folded)
|
(at tool % non Map.empty % to (fmap (_viTags)))
|
||||||
av
|
av
|
||||||
|
|
||||||
|
|
||||||
listVersions :: GHCupDownloads
|
-- | List all versions from the download info, as well as stray
|
||||||
|
-- versions.
|
||||||
|
listVersions :: (MonadLogger m, MonadIO m)
|
||||||
|
=> GHCupDownloads
|
||||||
-> Maybe Tool
|
-> Maybe Tool
|
||||||
-> Maybe ListCriteria
|
-> Maybe ListCriteria
|
||||||
-> IO [ListResult]
|
-> m [ListResult]
|
||||||
listVersions av lt criteria = case lt of
|
listVersions av lt criteria = case lt of
|
||||||
Just t -> do
|
Just t -> do
|
||||||
filter' <$> forM (availableToolVersions av t) (toListResult t)
|
-- get versions from GHCupDownloads
|
||||||
|
let avTools = availableToolVersions av t
|
||||||
|
lr <- filter' <$> forM (Map.toList avTools) (liftIO . toListResult t)
|
||||||
|
|
||||||
|
case t of
|
||||||
|
-- append stray GHCs
|
||||||
|
GHC -> do
|
||||||
|
slr <- strayGHCs avTools
|
||||||
|
pure $ (sort (slr ++ lr))
|
||||||
|
_ -> pure lr
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
ghcvers <- listVersions av (Just GHC) criteria
|
ghcvers <- listVersions av (Just GHC) criteria
|
||||||
cabalvers <- listVersions av (Just Cabal) criteria
|
cabalvers <- listVersions av (Just Cabal) criteria
|
||||||
@@ -332,21 +345,60 @@ listVersions av lt criteria = case lt of
|
|||||||
pure (ghcvers <> cabalvers <> ghcupvers)
|
pure (ghcvers <> cabalvers <> ghcupvers)
|
||||||
|
|
||||||
where
|
where
|
||||||
|
strayGHCs :: (MonadLogger m, MonadIO m)
|
||||||
|
=> Map.Map Version [Tag]
|
||||||
|
-> m [ListResult]
|
||||||
|
strayGHCs avTools = do
|
||||||
|
ghcdir <- liftIO $ ghcupGHCBaseDir
|
||||||
|
fs <- liftIO $ getDirsFiles' ghcdir
|
||||||
|
fmap catMaybes $ forM fs $ \(toFilePath -> f) -> do
|
||||||
|
case version . decUTF8Safe $ f of
|
||||||
|
Right v' -> do
|
||||||
|
case Map.lookup v' avTools of
|
||||||
|
Just _ -> pure Nothing
|
||||||
|
Nothing -> do
|
||||||
|
lSet <- fmap (maybe False (== v')) $ ghcSet
|
||||||
|
fromSrc <- liftIO $ ghcSrcInstalled v'
|
||||||
|
pure $ Just $ ListResult
|
||||||
|
{ lTool = GHC
|
||||||
|
, lVer = v'
|
||||||
|
, lTag = []
|
||||||
|
, lInstalled = True
|
||||||
|
, lStray = maybe True (const False) (Map.lookup v' avTools)
|
||||||
|
, ..
|
||||||
|
}
|
||||||
|
Left e -> do
|
||||||
|
$(logWarn)
|
||||||
|
[i|Could not parse version of stray directory #{toFilePath ghcdir}/#{f}: #{e}|]
|
||||||
|
pure Nothing
|
||||||
|
|
||||||
toListResult :: Tool -> (Version, [Tag]) -> IO ListResult
|
toListResult :: Tool -> (Version, [Tag]) -> IO ListResult
|
||||||
toListResult t (v, tags) = case t of
|
toListResult t (v, tags) = case t of
|
||||||
GHC -> do
|
GHC -> do
|
||||||
lSet <- fmap (maybe False (== v)) $ ghcSet
|
lSet <- fmap (maybe False (== v)) $ ghcSet
|
||||||
lInstalled <- ghcInstalled v
|
lInstalled <- ghcInstalled v
|
||||||
fromSrc <- ghcSrcInstalled v
|
fromSrc <- ghcSrcInstalled v
|
||||||
pure ListResult { lVer = v, lTag = tags, lTool = t, .. }
|
pure ListResult { lVer = v, lTag = tags, lTool = t, lStray = False, .. }
|
||||||
Cabal -> do
|
Cabal -> do
|
||||||
lSet <- fmap (== v) $ cabalSet
|
lSet <- fmap (== v) $ cabalSet
|
||||||
let lInstalled = lSet
|
let lInstalled = lSet
|
||||||
pure ListResult { lVer = v, lTag = tags, lTool = t, fromSrc = False, .. }
|
pure ListResult { lVer = v
|
||||||
|
, lTag = tags
|
||||||
|
, lTool = t
|
||||||
|
, fromSrc = False
|
||||||
|
, lStray = False
|
||||||
|
, ..
|
||||||
|
}
|
||||||
GHCup -> do
|
GHCup -> do
|
||||||
let lSet = prettyPVP ghcUpVer == prettyVer v
|
let lSet = prettyPVP ghcUpVer == prettyVer v
|
||||||
let lInstalled = lSet
|
let lInstalled = lSet
|
||||||
pure ListResult { lVer = v, lTag = tags, lTool = t, fromSrc = False, .. }
|
pure ListResult { lVer = v
|
||||||
|
, lTag = tags
|
||||||
|
, lTool = t
|
||||||
|
, fromSrc = False
|
||||||
|
, lStray = False
|
||||||
|
, ..
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
filter' :: [ListResult] -> [ListResult]
|
filter' :: [ListResult] -> [ListResult]
|
||||||
@@ -692,7 +744,7 @@ upgradeGHCup :: ( MonadMask m
|
|||||||
upgradeGHCup dls mtarget force = do
|
upgradeGHCup dls mtarget force = do
|
||||||
lift $ $(logInfo) [i|Upgrading GHCup...|]
|
lift $ $(logInfo) [i|Upgrading GHCup...|]
|
||||||
let latestVer = fromJust $ getLatest dls GHCup
|
let latestVer = fromJust $ getLatest dls GHCup
|
||||||
when (not force && (latestVer < pvpToVersion ghcUpVer)) $ throwE NoUpdate
|
when (not force && (latestVer <= pvpToVersion ghcUpVer)) $ throwE NoUpdate
|
||||||
pfreq <- liftE platformRequest
|
pfreq <- liftE platformRequest
|
||||||
dli <- lE $ getDownloadInfo GHCup latestVer pfreq dls
|
dli <- lE $ getDownloadInfo GHCup latestVer pfreq dls
|
||||||
tmp <- lift withGHCupTmpDir
|
tmp <- lift withGHCupTmpDir
|
||||||
@@ -732,7 +784,7 @@ postGHCInstall :: (MonadLogger m, MonadThrow m, MonadFail m, MonadIO m)
|
|||||||
=> Version
|
=> Version
|
||||||
-> Excepts '[NotInstalled] m ()
|
-> Excepts '[NotInstalled] m ()
|
||||||
postGHCInstall ver = do
|
postGHCInstall ver = do
|
||||||
liftE $ setGHC ver SetGHC_XYZ
|
void $ liftE $ setGHC ver SetGHC_XYZ
|
||||||
|
|
||||||
-- Create ghc-x.y symlinks. This may not be the current
|
-- Create ghc-x.y symlinks. This may not be the current
|
||||||
-- version, create it regardless.
|
-- version, create it regardless.
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ getDownloads urlSource = do
|
|||||||
True
|
True
|
||||||
defaultTimeLocale
|
defaultTimeLocale
|
||||||
"%a, %d %b %Y %H:%M:%S %Z"
|
"%a, %d %b %Y %H:%M:%S %Z"
|
||||||
(T.unpack . E.decodeUtf8 $ h)
|
(T.unpack . decUTF8Safe $ h)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -256,7 +256,7 @@ download dli dest mfn
|
|||||||
liftIO $ copyFile fromFile destFile Strict
|
liftIO $ copyFile fromFile destFile Strict
|
||||||
pure destFile
|
pure destFile
|
||||||
dl = do
|
dl = do
|
||||||
let uri' = E.decodeUtf8 (serializeURIRef' (view dlUri dli))
|
let uri' = decUTF8Safe (serializeURIRef' (view dlUri dli))
|
||||||
lift $ $(logInfo) [i|downloading: #{uri'}|]
|
lift $ $(logInfo) [i|downloading: #{uri'}|]
|
||||||
|
|
||||||
-- destination dir must exist
|
-- destination dir must exist
|
||||||
@@ -371,17 +371,17 @@ downloadBS uri'
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
checkDigest :: (MonadIO m, MonadLogger m, MonadReader Settings m)
|
checkDigest :: (MonadIO m, MonadThrow m, MonadLogger m, MonadReader Settings m)
|
||||||
=> DownloadInfo
|
=> DownloadInfo
|
||||||
-> Path Abs
|
-> Path Abs
|
||||||
-> Excepts '[DigestError] m ()
|
-> Excepts '[DigestError] m ()
|
||||||
checkDigest dli file = do
|
checkDigest dli file = do
|
||||||
verify <- lift ask <&> (not . noVerify)
|
verify <- lift ask <&> (not . noVerify)
|
||||||
when verify $ do
|
when verify $ do
|
||||||
let p' = toFilePath file
|
p' <- toFilePath <$> basename file
|
||||||
lift $ $(logInfo) [i|verifying digest of: #{p'}|]
|
lift $ $(logInfo) [i|verifying digest of: #{p'}|]
|
||||||
c <- liftIO $ readFile file
|
c <- liftIO $ readFile file
|
||||||
let cDigest = E.decodeUtf8 . B16.encode . SHA256.hashlazy $ c
|
cDigest <- throwEither . E.decodeUtf8' . B16.encode . SHA256.hashlazy $ c
|
||||||
eDigest = view dlHash dli
|
let eDigest = view dlHash dli
|
||||||
when ((cDigest /= eDigest) && verify) $ throwE (DigestError cDigest eDigest)
|
when ((cDigest /= eDigest) && verify) $ throwE (DigestError cDigest eDigest)
|
||||||
|
|
||||||
|
|||||||
@@ -47,7 +47,6 @@ import URI.ByteString
|
|||||||
import qualified Data.ByteString as BS
|
import qualified Data.ByteString as BS
|
||||||
import qualified Data.ByteString.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
import qualified Data.Map.Strict as M
|
import qualified Data.Map.Strict as M
|
||||||
import qualified Data.Text.Encoding as E
|
|
||||||
import qualified System.IO.Streams as Streams
|
import qualified System.IO.Streams as Streams
|
||||||
|
|
||||||
|
|
||||||
@@ -146,7 +145,7 @@ downloadInternal = go (5 :: Int)
|
|||||||
|
|
||||||
downloadStream r i' = do
|
downloadStream r i' = do
|
||||||
let size = case getHeader r "Content-Length" of
|
let size = case getHeader r "Content-Length" of
|
||||||
Just x' -> case decimal $ E.decodeUtf8 x' of
|
Just x' -> case decimal $ decUTF8Safe x' of
|
||||||
Left _ -> 0
|
Left _ -> 0
|
||||||
Right (r', _) -> r'
|
Right (r', _) -> r'
|
||||||
Nothing -> 0
|
Nothing -> 0
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import System.Info
|
|||||||
import Text.Regex.Posix
|
import Text.Regex.Posix
|
||||||
|
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.Encoding as E
|
|
||||||
|
|
||||||
--------------------------
|
--------------------------
|
||||||
--[ Platform detection ]--
|
--[ Platform detection ]--
|
||||||
@@ -84,13 +83,13 @@ getPlatform = do
|
|||||||
( either (const Nothing) Just
|
( either (const Nothing) Just
|
||||||
. versioning
|
. versioning
|
||||||
. getMajorVersion
|
. getMajorVersion
|
||||||
. E.decodeUtf8
|
. decUTF8Safe
|
||||||
)
|
)
|
||||||
<$> getDarwinVersion
|
<$> getDarwinVersion
|
||||||
pure $ PlatformResult { _platform = Darwin, _distroVersion = ver }
|
pure $ PlatformResult { _platform = Darwin, _distroVersion = ver }
|
||||||
"freebsd" -> do
|
"freebsd" -> do
|
||||||
ver <-
|
ver <-
|
||||||
(either (const Nothing) Just . versioning . E.decodeUtf8)
|
(either (const Nothing) Just . versioning . decUTF8Safe)
|
||||||
<$> getFreeBSDVersion
|
<$> getFreeBSDVersion
|
||||||
pure $ PlatformResult { _platform = FreeBSD, _distroVersion = ver }
|
pure $ PlatformResult { _platform = FreeBSD, _distroVersion = ver }
|
||||||
what -> throwE $ NoCompatiblePlatform what
|
what -> throwE $ NoCompatiblePlatform what
|
||||||
@@ -159,7 +158,7 @@ getLinuxDistro = do
|
|||||||
(Just _) <- findExecutable lsb_release_cmd
|
(Just _) <- findExecutable lsb_release_cmd
|
||||||
name <- fmap _stdOut $ executeOut lsb_release_cmd ["-si"] Nothing
|
name <- fmap _stdOut $ executeOut lsb_release_cmd ["-si"] Nothing
|
||||||
ver <- fmap _stdOut $ executeOut lsb_release_cmd ["-sr"] Nothing
|
ver <- fmap _stdOut $ executeOut lsb_release_cmd ["-sr"] Nothing
|
||||||
pure (E.decodeUtf8 name, Just $ E.decodeUtf8 ver)
|
pure (decUTF8Safe name, Just $ decUTF8Safe ver)
|
||||||
|
|
||||||
try_lsb_release :: IO (Text, Maybe Text)
|
try_lsb_release :: IO (Text, Maybe Text)
|
||||||
try_lsb_release = do
|
try_lsb_release = do
|
||||||
@@ -169,7 +168,7 @@ getLinuxDistro = do
|
|||||||
|
|
||||||
try_redhat_release :: IO (Text, Maybe Text)
|
try_redhat_release :: IO (Text, Maybe Text)
|
||||||
try_redhat_release = do
|
try_redhat_release = do
|
||||||
t <- fmap lBS2sT $ readFile redhat_release
|
t <- fmap decUTF8Safe' $ readFile redhat_release
|
||||||
let nameRegex n =
|
let nameRegex n =
|
||||||
makeRegexOpts compIgnoreCase
|
makeRegexOpts compIgnoreCase
|
||||||
execBlank
|
execBlank
|
||||||
@@ -192,4 +191,4 @@ getLinuxDistro = do
|
|||||||
try_debian_version :: IO (Text, Maybe Text)
|
try_debian_version :: IO (Text, Maybe Text)
|
||||||
try_debian_version = do
|
try_debian_version = do
|
||||||
ver <- readFile debian_version
|
ver <- readFile debian_version
|
||||||
pure (T.pack "debian", Just $ lBS2sT ver)
|
pure (T.pack "debian", Just . decUTF8Safe' $ ver)
|
||||||
|
|||||||
@@ -70,9 +70,10 @@ data Tool = GHC
|
|||||||
-- | All necessary information of a tool version, including
|
-- | All necessary information of a tool version, including
|
||||||
-- source download and per-architecture downloads.
|
-- source download and per-architecture downloads.
|
||||||
data VersionInfo = VersionInfo
|
data VersionInfo = VersionInfo
|
||||||
{ _viTags :: [Tag] -- ^ version specific tag
|
{ _viTags :: [Tag] -- ^ version specific tag
|
||||||
, _viSourceDL :: Maybe DownloadInfo -- ^ source tarball
|
, _viChangeLog :: Maybe URI
|
||||||
, _viArch :: ArchitectureSpec -- ^ descend for binary downloads per arch
|
, _viSourceDL :: Maybe DownloadInfo -- ^ source tarball
|
||||||
|
, _viArch :: ArchitectureSpec -- ^ descend for binary downloads per arch
|
||||||
}
|
}
|
||||||
deriving (Eq, Show)
|
deriving (Eq, Show)
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ deriveJSON defaultOptions { fieldLabelModifier = removeLensFieldLabel } ''Requir
|
|||||||
|
|
||||||
|
|
||||||
instance ToJSON URI where
|
instance ToJSON URI where
|
||||||
toJSON = toJSON . decodeUtf8 . serializeURIRef'
|
toJSON = toJSON . decUTF8Safe . serializeURIRef'
|
||||||
|
|
||||||
instance FromJSON URI where
|
instance FromJSON URI where
|
||||||
parseJSON = withText "URL" $ \t ->
|
parseJSON = withText "URL" $ \t ->
|
||||||
@@ -151,7 +151,7 @@ instance FromJSONKey Tool where
|
|||||||
|
|
||||||
instance ToJSON (Path Rel) where
|
instance ToJSON (Path Rel) where
|
||||||
toJSON p = case and . fmap isAscii . BS.unpack $ fp of
|
toJSON p = case and . fmap isAscii . BS.unpack $ fp of
|
||||||
True -> toJSON . E.decodeUtf8 $ fp
|
True -> toJSON . decUTF8Safe $ fp
|
||||||
False -> String "/not/a/valid/path"
|
False -> String "/not/a/valid/path"
|
||||||
where fp = toFilePath p
|
where fp = toFilePath p
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ where
|
|||||||
|
|
||||||
import GHCup.Errors
|
import GHCup.Errors
|
||||||
import GHCup.Types
|
import GHCup.Types
|
||||||
|
import GHCup.Types.Optics
|
||||||
import GHCup.Types.JSON ( )
|
import GHCup.Types.JSON ( )
|
||||||
import GHCup.Utils.Dirs
|
import GHCup.Utils.Dirs
|
||||||
import GHCup.Utils.File
|
import GHCup.Utils.File
|
||||||
@@ -83,9 +84,11 @@ ghcLinkVersion = either (throwM . ParseError) pure . parseOnly parser
|
|||||||
where
|
where
|
||||||
parser = string "../ghc/" *> verParser <* string "/bin/ghc"
|
parser = string "../ghc/" *> verParser <* string "/bin/ghc"
|
||||||
verParser = many1' (notWord8 _slash) >>= \t ->
|
verParser = many1' (notWord8 _slash) >>= \t ->
|
||||||
case version $ E.decodeUtf8 $ B.pack t of
|
case
|
||||||
Left e -> fail $ show e
|
version (decUTF8Safe $ B.pack t)
|
||||||
Right r -> pure r
|
of
|
||||||
|
Left e -> fail $ show e
|
||||||
|
Right r -> pure r
|
||||||
|
|
||||||
|
|
||||||
-- e.g. ghc-8.6.5
|
-- e.g. ghc-8.6.5
|
||||||
@@ -159,7 +162,7 @@ ghcSrcInstalled ver = do
|
|||||||
doesFileExist (ghcdir </> ghcUpSrcBuiltFile)
|
doesFileExist (ghcdir </> ghcUpSrcBuiltFile)
|
||||||
|
|
||||||
|
|
||||||
ghcSet :: (MonadIO m, MonadThrow m) => m (Maybe Version)
|
ghcSet :: (MonadIO m) => m (Maybe Version)
|
||||||
ghcSet = do
|
ghcSet = do
|
||||||
ghcBin <- (</> [rel|ghc|]) <$> liftIO ghcupBinDir
|
ghcBin <- (</> [rel|ghc|]) <$> liftIO ghcupBinDir
|
||||||
|
|
||||||
@@ -179,7 +182,7 @@ cabalSet = do
|
|||||||
cabalbin <- (</> [rel|cabal|]) <$> liftIO ghcupBinDir
|
cabalbin <- (</> [rel|cabal|]) <$> liftIO ghcupBinDir
|
||||||
mc <- liftIO $ executeOut cabalbin ["--numeric-version"] Nothing
|
mc <- liftIO $ executeOut cabalbin ["--numeric-version"] Nothing
|
||||||
let reportedVer = fst . B.spanEnd (== _lf) . _stdOut $ mc
|
let reportedVer = fst . B.spanEnd (== _lf) . _stdOut $ mc
|
||||||
case version (E.decodeUtf8 reportedVer) of
|
case version $ decUTF8Safe reportedVer of
|
||||||
Left e -> throwM e
|
Left e -> throwM e
|
||||||
Right r -> pure r
|
Right r -> pure r
|
||||||
|
|
||||||
@@ -206,7 +209,8 @@ getGHCForMajor :: (MonadIO m, MonadThrow m)
|
|||||||
getGHCForMajor major' minor' = do
|
getGHCForMajor major' minor' = do
|
||||||
p <- liftIO $ ghcupGHCBaseDir
|
p <- liftIO $ ghcupGHCBaseDir
|
||||||
ghcs <- liftIO $ getDirsFiles' p
|
ghcs <- liftIO $ getDirsFiles' p
|
||||||
semvers <- forM ghcs $ throwEither . semver . E.decodeUtf8 . toFilePath
|
semvers <- forM ghcs $ \ghc ->
|
||||||
|
throwEither . semver =<< (throwEither . E.decodeUtf8' . toFilePath $ ghc)
|
||||||
mapM (throwEither . version)
|
mapM (throwEither . version)
|
||||||
. fmap prettySemVer
|
. fmap prettySemVer
|
||||||
. lastMay
|
. lastMay
|
||||||
@@ -232,8 +236,9 @@ unpackToDir :: (MonadLogger m, MonadIO m, MonadThrow m)
|
|||||||
-> Path Abs -- ^ archive path
|
-> Path Abs -- ^ archive path
|
||||||
-> Excepts '[UnknownArchive] m ()
|
-> Excepts '[UnknownArchive] m ()
|
||||||
unpackToDir dest av = do
|
unpackToDir dest av = do
|
||||||
let fp = E.decodeUtf8 (toFilePath av)
|
fp <- (decUTF8Safe . toFilePath) <$> basename av
|
||||||
lift $ $(logInfo) [i|Unpacking: #{fp}|]
|
let dfp = decUTF8Safe . toFilePath $ dest
|
||||||
|
lift $ $(logInfo) [i|Unpacking: #{fp} to #{dfp}|]
|
||||||
fn <- toFilePath <$> basename av
|
fn <- toFilePath <$> basename av
|
||||||
let untar = Tar.unpack (toFilePath dest) . Tar.read
|
let untar = Tar.unpack (toFilePath dest) . Tar.read
|
||||||
|
|
||||||
@@ -258,21 +263,20 @@ unpackToDir dest av = do
|
|||||||
------------
|
------------
|
||||||
|
|
||||||
|
|
||||||
-- | Get the tool versions that have this tag.
|
-- | Get the tool version that has this tag. If multiple have it,
|
||||||
getTagged :: GHCupDownloads -> Tool -> Tag -> [Version]
|
-- picks the greatest version.
|
||||||
getTagged av tool tag = toListOf
|
getTagged :: Tag -> AffineFold (Map.Map Version VersionInfo) (Version, VersionInfo)
|
||||||
( ix tool
|
getTagged tag =
|
||||||
% to (Map.filter (\VersionInfo {..} -> elem tag _viTags))
|
( to (Map.filter (\VersionInfo {..} -> elem tag _viTags))
|
||||||
% to Map.keys
|
% to Map.toDescList
|
||||||
% folded
|
% _head
|
||||||
)
|
)
|
||||||
av
|
|
||||||
|
|
||||||
getLatest :: GHCupDownloads -> Tool -> Maybe Version
|
getLatest :: GHCupDownloads -> Tool -> Maybe Version
|
||||||
getLatest av tool = headOf folded $ getTagged av tool Latest
|
getLatest av tool = headOf (ix tool % getTagged Latest % to fst) $ av
|
||||||
|
|
||||||
getRecommended :: GHCupDownloads -> Tool -> Maybe Version
|
getRecommended :: GHCupDownloads -> Tool -> Maybe Version
|
||||||
getRecommended av tool = headOf folded $ getTagged av tool Recommended
|
getRecommended av tool = headOf (ix tool % getTagged Recommended % to fst) $ av
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -368,3 +372,15 @@ darwinNotarization Darwin path = exec
|
|||||||
Nothing
|
Nothing
|
||||||
Nothing
|
Nothing
|
||||||
darwinNotarization _ _ = pure $ Right ()
|
darwinNotarization _ _ = pure $ Right ()
|
||||||
|
|
||||||
|
|
||||||
|
getChangeLog :: GHCupDownloads -> Tool -> Either Version Tag -> Maybe URI
|
||||||
|
getChangeLog dls tool (Left v') =
|
||||||
|
preview (ix tool % ix v' % viChangeLog % _Just) dls
|
||||||
|
getChangeLog dls tool (Right tag) = preview
|
||||||
|
( ix tool
|
||||||
|
% getTagged tag
|
||||||
|
% to snd
|
||||||
|
% viChangeLog
|
||||||
|
% _Just
|
||||||
|
) dls
|
||||||
|
|||||||
@@ -43,8 +43,6 @@ import System.Posix.Types
|
|||||||
|
|
||||||
import qualified Control.Exception as EX
|
import qualified Control.Exception as EX
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.Encoding as E
|
|
||||||
import qualified Data.Text.Encoding.Error as E
|
|
||||||
import qualified System.Posix.Process.ByteString
|
import qualified System.Posix.Process.ByteString
|
||||||
as SPPB
|
as SPPB
|
||||||
import Streamly.External.Posix.DirStream
|
import Streamly.External.Posix.DirStream
|
||||||
@@ -208,7 +206,7 @@ execLogged exe spath args lfile chdir env = do
|
|||||||
. T.pack
|
. T.pack
|
||||||
. color Blue
|
. color Blue
|
||||||
. T.unpack
|
. T.unpack
|
||||||
. E.decodeUtf8With E.lenientDecode
|
. decUTF8Safe
|
||||||
. trim w
|
. trim w
|
||||||
. (\b -> "[ " <> toFilePath lfile <> " ] " <> b)
|
. (\b -> "[ " <> toFilePath lfile <> " ] " <> b)
|
||||||
$ bs
|
$ bs
|
||||||
@@ -371,8 +369,7 @@ searchPath paths needle = go paths
|
|||||||
where
|
where
|
||||||
go [] = pure Nothing
|
go [] = pure Nothing
|
||||||
go (x : xs) =
|
go (x : xs) =
|
||||||
hideErrorDefM PermissionDenied (go xs)
|
hideErrorDefM [InappropriateType, PermissionDenied, NoSuchThing] (go xs)
|
||||||
$ hideErrorDefM NoSuchThing (go xs)
|
|
||||||
$ do
|
$ do
|
||||||
dirStream <- openDirStream (toFilePath x)
|
dirStream <- openDirStream (toFilePath x)
|
||||||
S.findM (\(_, p) -> isMatch x p) (dirContentsStream dirStream)
|
S.findM (\(_, p) -> isMatch x p) (dirContentsStream dirStream)
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ import qualified Data.ByteString.Lazy as L
|
|||||||
import qualified Data.Strict.Maybe as S
|
import qualified Data.Strict.Maybe as S
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import qualified Data.Text.Encoding as E
|
import qualified Data.Text.Encoding as E
|
||||||
|
import qualified Data.Text.Encoding.Error as E
|
||||||
import qualified Data.Text.Lazy as TL
|
import qualified Data.Text.Lazy as TL
|
||||||
import qualified Data.Text.Lazy.Builder as B
|
import qualified Data.Text.Lazy.Builder as B
|
||||||
import qualified Data.Text.Lazy.Builder.Int as B
|
import qualified Data.Text.Lazy.Builder.Int as B
|
||||||
@@ -87,10 +88,6 @@ whileM_ ~action = void . whileM action
|
|||||||
guardM :: (Monad m, Alternative m) => m Bool -> m ()
|
guardM :: (Monad m, Alternative m) => m Bool -> m ()
|
||||||
guardM ~f = guard =<< f
|
guardM ~f = guard =<< f
|
||||||
|
|
||||||
lBS2sT :: L.ByteString -> Text
|
|
||||||
lBS2sT = TL.toStrict . TLE.decodeUtf8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
handleIO' :: (MonadIO m, MonadCatch m)
|
handleIO' :: (MonadIO m, MonadCatch m)
|
||||||
=> IOErrorType
|
=> IOErrorType
|
||||||
@@ -168,14 +165,14 @@ liftIOException errType ex =
|
|||||||
. lift
|
. lift
|
||||||
|
|
||||||
|
|
||||||
hideErrorDef :: IOErrorType -> a -> IO a -> IO a
|
hideErrorDef :: [IOErrorType] -> a -> IO a -> IO a
|
||||||
hideErrorDef err def =
|
hideErrorDef errs def =
|
||||||
handleIO (\e -> if err == ioeGetErrorType e then pure def else ioError e)
|
handleIO (\e -> if ioeGetErrorType e `elem` errs then pure def else ioError e)
|
||||||
|
|
||||||
|
|
||||||
hideErrorDefM :: IOErrorType -> IO a -> IO a -> IO a
|
hideErrorDefM :: [IOErrorType] -> IO a -> IO a -> IO a
|
||||||
hideErrorDefM err def =
|
hideErrorDefM errs def =
|
||||||
handleIO (\e -> if err == ioeGetErrorType e then def else ioError e)
|
handleIO (\e -> if ioeGetErrorType e `elem` errs then def else ioError e)
|
||||||
|
|
||||||
|
|
||||||
-- TODO: does this work?
|
-- TODO: does this work?
|
||||||
@@ -243,4 +240,16 @@ addToCurrentEnv adds = do
|
|||||||
|
|
||||||
|
|
||||||
pvpToVersion :: PVP -> Version
|
pvpToVersion :: PVP -> Version
|
||||||
pvpToVersion = either (\_ -> error "Couldn't convert PVP to Version") id . version . prettyPVP
|
pvpToVersion =
|
||||||
|
either (\_ -> error "Couldn't convert PVP to Version") id
|
||||||
|
. version
|
||||||
|
. prettyPVP
|
||||||
|
|
||||||
|
|
||||||
|
-- | Safe 'decodeUtf8With'. Replaces an invalid input byte with
|
||||||
|
-- the Unicode replacement character U+FFFD.
|
||||||
|
decUTF8Safe :: ByteString -> Text
|
||||||
|
decUTF8Safe = E.decodeUtf8With E.lenientDecode
|
||||||
|
|
||||||
|
decUTF8Safe' :: L.ByteString -> Text
|
||||||
|
decUTF8Safe' = TL.toStrict . TLE.decodeUtf8With E.lenientDecode
|
||||||
|
|||||||
@@ -9,9 +9,14 @@ import Data.Versions
|
|||||||
import URI.ByteString
|
import URI.ByteString
|
||||||
import URI.ByteString.QQ
|
import URI.ByteString.QQ
|
||||||
|
|
||||||
|
import qualified Data.Text as T
|
||||||
|
|
||||||
-- | This reflects the API version of the JSON.
|
-- | This reflects the API version of the JSON.
|
||||||
ghcupURL :: URI
|
ghcupURL :: URI
|
||||||
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.1.json|]
|
ghcupURL = [uri|https://www.haskell.org/ghcup/data/ghcup-0.0.1.json|]
|
||||||
|
|
||||||
ghcUpVer :: PVP
|
ghcUpVer :: PVP
|
||||||
ghcUpVer = [pver|0.1.2|]
|
ghcUpVer = [pver|0.1.4|]
|
||||||
|
|
||||||
|
numericVer :: String
|
||||||
|
numericVer = T.unpack . prettyPVP $ ghcUpVer
|
||||||
|
|||||||
208
www/LICENSE
Normal file
208
www/LICENSE
Normal file
@@ -0,0 +1,208 @@
|
|||||||
|
The ghcup website, excluding ghcup, fonts, bootstrap-haskell script are subject
|
||||||
|
to the license below. Design, javascript and css are used from the rustup
|
||||||
|
project: https://github.com/rust-lang/rustup.rs/tree/master/www
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
===============================================================================
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction,
|
||||||
|
and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by
|
||||||
|
the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all
|
||||||
|
other entities that control, are controlled by, or are under common
|
||||||
|
control with that entity. For the purposes of this definition,
|
||||||
|
"control" means (i) the power, direct or indirect, to cause the
|
||||||
|
direction or management of such entity, whether by contract or
|
||||||
|
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||||
|
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity
|
||||||
|
exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications,
|
||||||
|
including but not limited to software source code, documentation
|
||||||
|
source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical
|
||||||
|
transformation or translation of a Source form, including but
|
||||||
|
not limited to compiled object code, generated documentation,
|
||||||
|
and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or
|
||||||
|
Object form, made available under the License, as indicated by a
|
||||||
|
copyright notice that is included in or attached to the work
|
||||||
|
(an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object
|
||||||
|
form, that is based on (or derived from) the Work and for which the
|
||||||
|
editorial revisions, annotations, elaborations, or other modifications
|
||||||
|
represent, as a whole, an original work of authorship. For the purposes
|
||||||
|
of this License, Derivative Works shall not include works that remain
|
||||||
|
separable from, or merely link (or bind by name) to the interfaces of,
|
||||||
|
the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including
|
||||||
|
the original version of the Work and any modifications or additions
|
||||||
|
to that Work or Derivative Works thereof, that is intentionally
|
||||||
|
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||||
|
or by an individual or Legal Entity authorized to submit on behalf of
|
||||||
|
the copyright owner. For the purposes of this definition, "submitted"
|
||||||
|
means any form of electronic, verbal, or written communication sent
|
||||||
|
to the Licensor or its representatives, including but not limited to
|
||||||
|
communication on electronic mailing lists, source code control systems,
|
||||||
|
and issue tracking systems that are managed by, or on behalf of, the
|
||||||
|
Licensor for the purpose of discussing and improving the Work, but
|
||||||
|
excluding communication that is conspicuously marked or otherwise
|
||||||
|
designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||||
|
on behalf of whom a Contribution has been received by Licensor and
|
||||||
|
subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
copyright license to reproduce, prepare Derivative Works of,
|
||||||
|
publicly display, publicly perform, sublicense, and distribute the
|
||||||
|
Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of
|
||||||
|
this License, each Contributor hereby grants to You a perpetual,
|
||||||
|
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||||
|
(except as stated in this section) patent license to make, have made,
|
||||||
|
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||||
|
where such license applies only to those patent claims licensable
|
||||||
|
by such Contributor that are necessarily infringed by their
|
||||||
|
Contribution(s) alone or by combination of their Contribution(s)
|
||||||
|
with the Work to which such Contribution(s) was submitted. If You
|
||||||
|
institute patent litigation against any entity (including a
|
||||||
|
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||||
|
or a Contribution incorporated within the Work constitutes direct
|
||||||
|
or contributory patent infringement, then any patent licenses
|
||||||
|
granted to You under this License for that Work shall terminate
|
||||||
|
as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the
|
||||||
|
Work or Derivative Works thereof in any medium, with or without
|
||||||
|
modifications, and in Source or Object form, provided that You
|
||||||
|
meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or
|
||||||
|
Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices
|
||||||
|
stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works
|
||||||
|
that You distribute, all copyright, patent, trademark, and
|
||||||
|
attribution notices from the Source form of the Work,
|
||||||
|
excluding those notices that do not pertain to any part of
|
||||||
|
the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its
|
||||||
|
distribution, then any Derivative Works that You distribute must
|
||||||
|
include a readable copy of the attribution notices contained
|
||||||
|
within such NOTICE file, excluding those notices that do not
|
||||||
|
pertain to any part of the Derivative Works, in at least one
|
||||||
|
of the following places: within a NOTICE text file distributed
|
||||||
|
as part of the Derivative Works; within the Source form or
|
||||||
|
documentation, if provided along with the Derivative Works; or,
|
||||||
|
within a display generated by the Derivative Works, if and
|
||||||
|
wherever such third-party notices normally appear. The contents
|
||||||
|
of the NOTICE file are for informational purposes only and
|
||||||
|
do not modify the License. You may add Your own attribution
|
||||||
|
notices within Derivative Works that You distribute, alongside
|
||||||
|
or as an addendum to the NOTICE text from the Work, provided
|
||||||
|
that such additional attribution notices cannot be construed
|
||||||
|
as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and
|
||||||
|
may provide additional or different license terms and conditions
|
||||||
|
for use, reproduction, or distribution of Your modifications, or
|
||||||
|
for any such Derivative Works as a whole, provided Your use,
|
||||||
|
reproduction, and distribution of the Work otherwise complies with
|
||||||
|
the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||||
|
any Contribution intentionally submitted for inclusion in the Work
|
||||||
|
by You to the Licensor shall be under the terms and conditions of
|
||||||
|
this License, without any additional terms or conditions.
|
||||||
|
Notwithstanding the above, nothing herein shall supersede or modify
|
||||||
|
the terms of any separate license agreement you may have executed
|
||||||
|
with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade
|
||||||
|
names, trademarks, service marks, or product names of the Licensor,
|
||||||
|
except as required for reasonable and customary use in describing the
|
||||||
|
origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||||
|
agreed to in writing, Licensor provides the Work (and each
|
||||||
|
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||||
|
implied, including, without limitation, any warranties or conditions
|
||||||
|
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||||
|
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||||
|
appropriateness of using or redistributing the Work and assume any
|
||||||
|
risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory,
|
||||||
|
whether in tort (including negligence), contract, or otherwise,
|
||||||
|
unless required by applicable law (such as deliberate and grossly
|
||||||
|
negligent acts) or agreed to in writing, shall any Contributor be
|
||||||
|
liable to You for damages, including any direct, indirect, special,
|
||||||
|
incidental, or consequential damages of any character arising as a
|
||||||
|
result of this License or out of the use or inability to use the
|
||||||
|
Work (including but not limited to damages for loss of goodwill,
|
||||||
|
work stoppage, computer failure or malfunction, or any and all
|
||||||
|
other commercial damages or losses), even if such Contributor
|
||||||
|
has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing
|
||||||
|
the Work or Derivative Works thereof, You may choose to offer,
|
||||||
|
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||||
|
or other liability obligations and/or rights consistent with this
|
||||||
|
License. However, in accepting such obligations, You may act only
|
||||||
|
on Your own behalf and on Your sole responsibility, not on behalf
|
||||||
|
of any other Contributor, and only if You agree to indemnify,
|
||||||
|
defend, and hold each Contributor harmless for any liability
|
||||||
|
incurred by, or claims asserted against, such Contributor by reason
|
||||||
|
of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following
|
||||||
|
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||||
|
replaced with your own identifying information. (Don't include
|
||||||
|
the brackets!) The text should be enclosed in the appropriate
|
||||||
|
comment syntax for the file format. We also recommend that a
|
||||||
|
file or class name and description of purpose be included on the
|
||||||
|
same "printed page" as the copyright notice for easier
|
||||||
|
identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
||||||
1
www/copy.svg
Normal file
1
www/copy.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<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>
|
||||||
|
After Width: | Height: | Size: 696 B |
BIN
www/fonts/FiraSans-Light.woff
Normal file
BIN
www/fonts/FiraSans-Light.woff
Normal file
Binary file not shown.
BIN
www/fonts/FiraSans-Medium.woff
Normal file
BIN
www/fonts/FiraSans-Medium.woff
Normal file
Binary file not shown.
BIN
www/fonts/FiraSans-Regular.woff
Normal file
BIN
www/fonts/FiraSans-Regular.woff
Normal file
Binary file not shown.
BIN
www/fonts/Inconsolata-Regular.ttf
Normal file
BIN
www/fonts/Inconsolata-Regular.ttf
Normal file
Binary file not shown.
92
www/fonts/OFL.txt
Normal file
92
www/fonts/OFL.txt
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
Copyright (c) 2011, Raph Levien (firstname.lastname@gmail.com), Copyright (c) 2012, Cyreal (cyreal.org)
|
||||||
|
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||||
|
This license is copied below, and is also available with a FAQ at:
|
||||||
|
http://scripts.sil.org/OFL
|
||||||
|
|
||||||
|
|
||||||
|
-----------------------------------------------------------
|
||||||
|
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||||
|
-----------------------------------------------------------
|
||||||
|
|
||||||
|
PREAMBLE
|
||||||
|
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||||
|
development of collaborative font projects, to support the font creation
|
||||||
|
efforts of academic and linguistic communities, and to provide a free and
|
||||||
|
open framework in which fonts may be shared and improved in partnership
|
||||||
|
with others.
|
||||||
|
|
||||||
|
The OFL allows the licensed fonts to be used, studied, modified and
|
||||||
|
redistributed freely as long as they are not sold by themselves. The
|
||||||
|
fonts, including any derivative works, can be bundled, embedded,
|
||||||
|
redistributed and/or sold with any software provided that any reserved
|
||||||
|
names are not used by derivative works. The fonts and derivatives,
|
||||||
|
however, cannot be released under any other type of license. The
|
||||||
|
requirement for fonts to remain under this license does not apply
|
||||||
|
to any document created using the fonts or their derivatives.
|
||||||
|
|
||||||
|
DEFINITIONS
|
||||||
|
"Font Software" refers to the set of files released by the Copyright
|
||||||
|
Holder(s) under this license and clearly marked as such. This may
|
||||||
|
include source files, build scripts and documentation.
|
||||||
|
|
||||||
|
"Reserved Font Name" refers to any names specified as such after the
|
||||||
|
copyright statement(s).
|
||||||
|
|
||||||
|
"Original Version" refers to the collection of Font Software components as
|
||||||
|
distributed by the Copyright Holder(s).
|
||||||
|
|
||||||
|
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||||
|
or substituting -- in part or in whole -- any of the components of the
|
||||||
|
Original Version, by changing formats or by porting the Font Software to a
|
||||||
|
new environment.
|
||||||
|
|
||||||
|
"Author" refers to any designer, engineer, programmer, technical
|
||||||
|
writer or other person who contributed to the Font Software.
|
||||||
|
|
||||||
|
PERMISSION & CONDITIONS
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining
|
||||||
|
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||||
|
redistribute, and sell modified and unmodified copies of the Font
|
||||||
|
Software, subject to the following conditions:
|
||||||
|
|
||||||
|
1) Neither the Font Software nor any of its individual components,
|
||||||
|
in Original or Modified Versions, may be sold by itself.
|
||||||
|
|
||||||
|
2) Original or Modified Versions of the Font Software may be bundled,
|
||||||
|
redistributed and/or sold with any software, provided that each copy
|
||||||
|
contains the above copyright notice and this license. These can be
|
||||||
|
included either as stand-alone text files, human-readable headers or
|
||||||
|
in the appropriate machine-readable metadata fields within text or
|
||||||
|
binary files as long as those fields can be easily viewed by the user.
|
||||||
|
|
||||||
|
3) No Modified Version of the Font Software may use the Reserved Font
|
||||||
|
Name(s) unless explicit written permission is granted by the corresponding
|
||||||
|
Copyright Holder. This restriction only applies to the primary font name as
|
||||||
|
presented to the users.
|
||||||
|
|
||||||
|
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||||
|
Software shall not be used to promote, endorse or advertise any
|
||||||
|
Modified Version, except to acknowledge the contribution(s) of the
|
||||||
|
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||||
|
permission.
|
||||||
|
|
||||||
|
5) The Font Software, modified or unmodified, in part or in whole,
|
||||||
|
must be distributed entirely under this license, and must not be
|
||||||
|
distributed under any other license. The requirement for fonts to
|
||||||
|
remain under this license does not apply to any document created
|
||||||
|
using the Font Software.
|
||||||
|
|
||||||
|
TERMINATION
|
||||||
|
This license becomes null and void if any of the above conditions are
|
||||||
|
not met.
|
||||||
|
|
||||||
|
DISCLAIMER
|
||||||
|
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||||
|
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||||
|
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||||
|
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||||
|
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||||
BIN
www/fonts/WorkSans-Medium.ttf
Normal file
BIN
www/fonts/WorkSans-Medium.ttf
Normal file
Binary file not shown.
240
www/ghcup.css
Normal file
240
www/ghcup.css
Normal file
@@ -0,0 +1,240 @@
|
|||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 300;
|
||||||
|
src: local('Fira Sans Light'), url("fonts/FiraSans-Light.woff") format('woff');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Fira Sans'), url("fonts/FiraSans-Regular.woff") format('woff');
|
||||||
|
}
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Fira Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
src: local('Fira Sans Medium'), url("fonts/FiraSans-Medium.woff") format('woff');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Work Sans';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 500;
|
||||||
|
src: local('Work Sans Medium'), url("fonts/WorkSans-Medium.ttf") format('ttf');
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: 'Inconsolata';
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
src: local('Inconsolata Regular'), url("fonts/Inconsolata-Regular.ttf") format('ttf');
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin-top: 2em;
|
||||||
|
background-color: white;
|
||||||
|
color: #515151;
|
||||||
|
font-family: "Fira Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||||
|
font-weight: 300;
|
||||||
|
font-size: 25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
pre {
|
||||||
|
font-family: Inconsolata,Menlo,Monaco,Consolas,"Courier New",monospace;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#idx #pitch > a {
|
||||||
|
font-weight: 500;
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
a {
|
||||||
|
color: #428bca;
|
||||||
|
text-decoration: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
a:hover {
|
||||||
|
color: rgb(42, 100, 150);
|
||||||
|
}
|
||||||
|
|
||||||
|
body#idx > * {
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
text-align: center;
|
||||||
|
width: 37em;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#idx > #pitch {
|
||||||
|
width: 30rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#pitch em {
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#idx p {
|
||||||
|
margin-top: 2em;
|
||||||
|
margin-bottom: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
body#idx p.other-help {
|
||||||
|
font-size: 0.6em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.instructions {
|
||||||
|
background-color: rgb(250, 250, 250);
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
border-radius: 3px;
|
||||||
|
border: 1px solid rgb(204, 204, 204);
|
||||||
|
box-shadow: 0px 1px 4px 0px rgb(204, 204, 204);
|
||||||
|
}
|
||||||
|
|
||||||
|
.instructions > * {
|
||||||
|
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 > div > pre,
|
||||||
|
#platform-instructions-mac > div > pre,
|
||||||
|
#platform-instructions-freebsd > div > pre,
|
||||||
|
#platform-instructions-win32 > pre,
|
||||||
|
#platform-instructions-win64 > pre,
|
||||||
|
#platform-instructions-default > div > div > pre,
|
||||||
|
#platform-instructions-unknown > div > div > pre {
|
||||||
|
background-color: #515151;
|
||||||
|
color: white;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
padding-top: 1rem;
|
||||||
|
padding-bottom: 1rem;
|
||||||
|
padding-right: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
border-radius: 3px;
|
||||||
|
box-shadow: inset 0px 0px 20px 0px #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
#platform-instructions-win32 a.windows-download,
|
||||||
|
#platform-instructions-win64 a.windows-download,
|
||||||
|
#platform-instructions-default a.windows-download,
|
||||||
|
#platform-instructions-unknown a.windows-download {
|
||||||
|
display: block;
|
||||||
|
padding-top: 0.4rem;
|
||||||
|
padding-bottom: 0.6rem;
|
||||||
|
font-family: "Work Sans", "Fira Sans","Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||||
|
font-weight: 500;
|
||||||
|
letter-spacing: 0.1rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* This is the box that prints navigator.platform, navigator.appVersion values */
|
||||||
|
#platform-instructions-unknown > div:first-of-type {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 2rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
#about {
|
||||||
|
font-size: 16px;
|
||||||
|
line-height: 2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
#about > img {
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
transform: translateY(11px);
|
||||||
|
}
|
||||||
|
|
||||||
|
#platform-button {
|
||||||
|
background-color: #515151;
|
||||||
|
color: white;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
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;
|
||||||
|
}
|
||||||
166
www/ghcup.js
Normal file
166
www/ghcup.js
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
var platforms = ["default", "unknown", "win32", "win64", "linux", "freebsd", "mac"];
|
||||||
|
var platform_override = null;
|
||||||
|
|
||||||
|
function detect_platform() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
if (platform_override !== null) {
|
||||||
|
return platforms[platform_override];
|
||||||
|
}
|
||||||
|
|
||||||
|
var os = "unknown";
|
||||||
|
|
||||||
|
if (navigator.platform == "Linux x86_64") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux i686") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux i686 on x86_64") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux aarch64") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux armv6l") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux armv7l") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux armv8l") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux ppc64") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux mips") {os = "linux";}
|
||||||
|
if (navigator.platform == "Linux mips64") {os = "linux";}
|
||||||
|
if (navigator.platform == "Mac") {os = "mac";}
|
||||||
|
if (navigator.platform == "Win32") {os = "win32";}
|
||||||
|
if (navigator.platform == "Win64" ||
|
||||||
|
navigator.userAgent.indexOf("WOW64") != -1 ||
|
||||||
|
navigator.userAgent.indexOf("Win64") != -1) { os = "win64"; }
|
||||||
|
if (navigator.platform == "FreeBSD x86_64") {os = "freebsd";}
|
||||||
|
if (navigator.platform == "FreeBSD amd64") {os = "freebsd";}
|
||||||
|
// if (navigator.platform == "NetBSD x86_64") {os = "unix";}
|
||||||
|
// if (navigator.platform == "NetBSD amd64") {os = "unix";}
|
||||||
|
|
||||||
|
// I wish I knew by now, but I don't. Try harder.
|
||||||
|
if (os == "unknown") {
|
||||||
|
if (navigator.appVersion.indexOf("Win")!=-1) {os = "win32";}
|
||||||
|
if (navigator.appVersion.indexOf("Mac")!=-1) {os = "mac";}
|
||||||
|
if (navigator.appVersion.indexOf("FreeBSD")!=-1) {os = "freebsd";}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Firefox Quantum likes to hide platform and appVersion but oscpu works
|
||||||
|
if (navigator.oscpu) {
|
||||||
|
if (navigator.oscpu.indexOf("Win32")!=-1) {os = "win32";}
|
||||||
|
if (navigator.oscpu.indexOf("Win64")!=-1) {os = "win64";}
|
||||||
|
if (navigator.oscpu.indexOf("Mac")!=-1) {os = "mac";}
|
||||||
|
if (navigator.oscpu.indexOf("Linux")!=-1) {os = "linux";}
|
||||||
|
if (navigator.oscpu.indexOf("FreeBSD")!=-1) {os = "freebsd";}
|
||||||
|
// if (navigator.oscpu.indexOf("NetBSD")!=-1) {os = "unix";}
|
||||||
|
}
|
||||||
|
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
|
function adjust_for_platform() {
|
||||||
|
"use strict";
|
||||||
|
|
||||||
|
var platform = detect_platform();
|
||||||
|
|
||||||
|
platforms.forEach(function (platform_elem) {
|
||||||
|
var platform_div = document.getElementById("platform-instructions-" + platform_elem);
|
||||||
|
platform_div.style.display = "none";
|
||||||
|
if (platform == platform_elem) {
|
||||||
|
platform_div.style.display = "block";
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
adjust_platform_specific_instrs(platform);
|
||||||
|
}
|
||||||
|
|
||||||
|
function adjust_platform_specific_instrs(platform) {
|
||||||
|
var platform_specific = document.getElementsByClassName("platform-specific");
|
||||||
|
for (var el of platform_specific) {
|
||||||
|
var el_is_not_win = el.className.indexOf("not-win") !== -1;
|
||||||
|
var el_is_inline = el.tagName.toLowerCase() == "span";
|
||||||
|
var el_visible_style = "block";
|
||||||
|
if (el_is_inline) {
|
||||||
|
el_visible_style = "inline";
|
||||||
|
}
|
||||||
|
if (platform == "win64" || platform == "win32") {
|
||||||
|
if (el_is_not_win) {
|
||||||
|
el.style.display = "none";
|
||||||
|
} else {
|
||||||
|
el.style.display = el_visible_style;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (el_is_not_win) {
|
||||||
|
el.style.display = el_visible_style;
|
||||||
|
} else {
|
||||||
|
el.style.display = "none";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function cycle_platform() {
|
||||||
|
if (platform_override == null) {
|
||||||
|
platform_override = 0;
|
||||||
|
} else {
|
||||||
|
platform_override = (platform_override + 1) % platforms.length;
|
||||||
|
}
|
||||||
|
adjust_for_platform();
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_up_cycle_button() {
|
||||||
|
var cycle_button = document.getElementById("platform-button");
|
||||||
|
cycle_button.onclick = cycle_platform;
|
||||||
|
|
||||||
|
var key="test";
|
||||||
|
var idx=0;
|
||||||
|
var unlocked=false;
|
||||||
|
|
||||||
|
document.onkeypress = function(event) {
|
||||||
|
if (event.key == "n" && unlocked) {
|
||||||
|
cycle_platform();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (event.key == key[idx]) {
|
||||||
|
idx += 1;
|
||||||
|
|
||||||
|
if (idx == key.length) {
|
||||||
|
cycle_button.style.display = "block";
|
||||||
|
unlocked = true;
|
||||||
|
cycle_platform();
|
||||||
|
}
|
||||||
|
} else if (event.key == key[0]) {
|
||||||
|
idx = 1;
|
||||||
|
} else {
|
||||||
|
idx = 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
function go_to_default_platform() {
|
||||||
|
platform_override = 0;
|
||||||
|
adjust_for_platform();
|
||||||
|
}
|
||||||
|
|
||||||
|
function set_up_default_platform_buttons() {
|
||||||
|
var defaults_buttons = document.getElementsByClassName('default-platform-button');
|
||||||
|
for (var i = 0; i < defaults_buttons.length; i++) {
|
||||||
|
defaults_buttons[i].onclick = go_to_default_platform;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function fill_in_bug_report_values() {
|
||||||
|
var nav_plat = document.getElementById("nav-plat");
|
||||||
|
var nav_app = document.getElementById("nav-app");
|
||||||
|
nav_plat.textContent = navigator.platform;
|
||||||
|
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();
|
||||||
|
set_up_default_platform_buttons();
|
||||||
|
fill_in_bug_report_values();
|
||||||
|
}());
|
||||||
66
www/haskell-logo.svg
Normal file
66
www/haskell-logo.svg
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<svg
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
width="109"
|
||||||
|
height="80"
|
||||||
|
viewBox="0 0 109.00001 80"
|
||||||
|
version="1.1"
|
||||||
|
id="svg14"
|
||||||
|
sodipodi:docname="haskell-logo.svg"
|
||||||
|
inkscape:version="0.92.3 (2405546, 2018-03-11)">
|
||||||
|
<metadata
|
||||||
|
id="metadata20">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
<dc:title></dc:title>
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<defs
|
||||||
|
id="defs18" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1"
|
||||||
|
objecttolerance="10"
|
||||||
|
gridtolerance="10"
|
||||||
|
guidetolerance="10"
|
||||||
|
inkscape:pageopacity="0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:window-width="1916"
|
||||||
|
inkscape:window-height="1033"
|
||||||
|
id="namedview16"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="2.0159478"
|
||||||
|
inkscape:cx="298.15447"
|
||||||
|
inkscape:cy="-2.7202801"
|
||||||
|
inkscape:window-x="1366"
|
||||||
|
inkscape:window-y="22"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="svg14" />
|
||||||
|
<path
|
||||||
|
d="M 1.842,77.722 26.586,40.63 1.842,3.537 H 20.4 L 45.144,40.63 20.4,77.722 Z m 0,0"
|
||||||
|
id="path8"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#453a62" />
|
||||||
|
<path
|
||||||
|
d="M 26.586,77.722 51.33,40.63 26.586,3.537 H 45.144 L 94.63,77.722 H 76.074 L 60.61,54.54 45.143,77.722 Z m 0,0"
|
||||||
|
id="path10"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#5e5086" />
|
||||||
|
<path
|
||||||
|
d="M 86.384,56.085 78.136,43.72 h 28.868 V 56.086 H 86.384 Z M 74.012,37.54 65.764,25.175 h 41.24 V 37.54 Z m 0,0"
|
||||||
|
id="path12"
|
||||||
|
inkscape:connector-curvature="0"
|
||||||
|
style="fill:#8f4e8b" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.1 KiB |
177
www/index.html
Normal file
177
www/index.html
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title>ghcup - The Haskell (GHC) toolchain installer</title>
|
||||||
|
<meta name="keywords" content="Haskell, Haskell programming language, ghc, ghcup">
|
||||||
|
<meta name="description" content="The Haskell (GHC) toolchain installer">
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="normalize.css">
|
||||||
|
<link rel="stylesheet" href="ghcup.css">
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body id="idx">
|
||||||
|
|
||||||
|
<script id='html-content' type="text/html">
|
||||||
|
<a id="platform-button" style="display: none;" href="#">
|
||||||
|
click or press "n" to cycle platforms
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<p id="pitch">
|
||||||
|
<em>ghcup</em> is an installer for<br/>
|
||||||
|
the general purpose language <a href="https://www.haskell.org/">Haskell</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div id="platform-instructions-linux" class="instructions" style="display: none;">
|
||||||
|
<p>Run the following in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.<br/>You appear to be running Linux. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="platform-instructions-mac" class="instructions" style="display: none;">
|
||||||
|
<p>Run the following in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.<br/>You appear to be running macOS. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="platform-instructions-freebsd" class="instructions" style="display: none;">
|
||||||
|
<p>Run the following in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.<br/>You appear to be running FreeBSD. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="platform-instructions-win32" class="instructions">
|
||||||
|
<p>
|
||||||
|
To install Haskell, follow the instructions on
|
||||||
|
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
||||||
|
</p>
|
||||||
|
<p class="other-help">You appear to be running Windows 32-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="platform-instructions-win64" class="instructions" style="display: none;">
|
||||||
|
<p>
|
||||||
|
To install Haskell, follow the instructions on
|
||||||
|
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
||||||
|
</p>
|
||||||
|
<p class="other-help">You appear to be running Windows 64-bit. If not, <a class="default-platform-button" href="#">display all supported installers</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="platform-instructions-unknown" class="instructions" style="display: none;">
|
||||||
|
<!-- unrecognized platform: ask for help -->
|
||||||
|
<p>I don't recognize your platform.</p>
|
||||||
|
<p>
|
||||||
|
ghcup runs on Linux, macOS and FreeBSD. If
|
||||||
|
you are on one of these platforms and are seeing this then please
|
||||||
|
<a href="https://gitlab.haskell.org/haskell/ghcup-hs/issues">report an issue</a>,
|
||||||
|
along with the following values:
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<div>navigator.platform:</div>
|
||||||
|
<div id="nav-plat"></div>
|
||||||
|
<div>navigator.appVersion:</div>
|
||||||
|
<div id="nav-app"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- duplicate the default cross-platform instructions -->
|
||||||
|
<div>
|
||||||
|
<p>If you are running Linux, macOS or FreeBSD,<br/>run the following in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
If you are running Windows,<br/>follow the instructions on
|
||||||
|
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="platform-instructions-default" class="instructions">
|
||||||
|
<div>
|
||||||
|
<p>To install Haskell, if you are running Linux, macOS or FreeBSD,<br/>run the following
|
||||||
|
in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
|
<div class="command-button"><pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre><button class="tooltip" onclick="copyToClipboard()"><img src="copy.svg" alt="" /><span class="tooltiptext">Copy to clipboard</span></button></div>
|
||||||
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
If you are running Windows,<br/>follow the instructions on
|
||||||
|
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Need help? <a href="http://webchat.freenode.net/?randomnick=1&channels=%23haskell&uio=d4">Ask on #haskell</a> or <a href="https://gitlab.haskell.org/haskell/ghcup-hs/issues">report a bug</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p id="about">
|
||||||
|
<img src="haskell-logo.svg" alt="" />
|
||||||
|
ghcup is a haskell.org hosted project.
|
||||||
|
<br/>
|
||||||
|
<a href="https://www.haskell.org/downloads/">other installation options</a>
|
||||||
|
·
|
||||||
|
<a href="https://gitlab.haskell.org/haskell/ghcup-hs">about ghcup</a>
|
||||||
|
·
|
||||||
|
<a href="https://github.com/rust-lang/rustup.rs/tree/master/www">web design from rustup</a>
|
||||||
|
</p>
|
||||||
|
</script>
|
||||||
|
<script>
|
||||||
|
document.write(document.getElementById("html-content").innerHTML);
|
||||||
|
</script>
|
||||||
|
<script type="text/javascript" src="ghcup.js"></script>
|
||||||
|
|
||||||
|
<noscript>
|
||||||
|
<p id="pitch">
|
||||||
|
<em>ghcup</em> is an installer for<br/>
|
||||||
|
the general purpose language <a href="https://www.haskell.org/">Haskell</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div id="platform-instructions-default" class="instructions">
|
||||||
|
<div>
|
||||||
|
<p>To install Haskell, if you are running Linux, macOS or FreeBSD,<br/>run the following
|
||||||
|
in your terminal (as a user other than root), then follow the onscreen instructions.</p>
|
||||||
|
<pre><span class='ghcup-command'>curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh</span></pre>
|
||||||
|
<p class="other-help">If you don't like curl | sh, see <a href="https://gitlab.haskell.org/haskell/ghcup-hs#manual-install">other installation methods</a>.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<hr/>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
If you are running Windows,<br/>follow the instructions on
|
||||||
|
<a class="windows-download" href="https://www.haskell.org/platform/#windows">Haskell Platform</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Need help? <a href="http://webchat.freenode.net/?randomnick=1&channels=%23haskell&uio=d4">Ask on #haskell</a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p id="about">
|
||||||
|
<img src="haskell-logo.svg" alt="" />
|
||||||
|
ghcup is a haskell.org hosted project.
|
||||||
|
<br/>
|
||||||
|
<a href="https://www.haskell.org/downloads/">other installation options</a>
|
||||||
|
·
|
||||||
|
<a href="https://gitlab.haskell.org/haskell/ghcup-hs">about ghcup</a>
|
||||||
|
·
|
||||||
|
<a href="https://github.com/rust-lang/rustup.rs/tree/master/www">web design from rustup</a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</noscript>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
427
www/normalize.css
vendored
Normal file
427
www/normalize.css
vendored
Normal file
@@ -0,0 +1,427 @@
|
|||||||
|
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Set default font family to sans-serif.
|
||||||
|
* 2. Prevent iOS text size adjust after orientation change, without disabling
|
||||||
|
* user zoom.
|
||||||
|
*/
|
||||||
|
|
||||||
|
html {
|
||||||
|
font-family: sans-serif; /* 1 */
|
||||||
|
-ms-text-size-adjust: 100%; /* 2 */
|
||||||
|
-webkit-text-size-adjust: 100%; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove default margin.
|
||||||
|
*/
|
||||||
|
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* HTML5 display definitions
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct `block` display not defined for any HTML5 element in IE 8/9.
|
||||||
|
* Correct `block` display not defined for `details` or `summary` in IE 10/11
|
||||||
|
* and Firefox.
|
||||||
|
* Correct `block` display not defined for `main` in IE 11.
|
||||||
|
*/
|
||||||
|
|
||||||
|
article,
|
||||||
|
aside,
|
||||||
|
details,
|
||||||
|
figcaption,
|
||||||
|
figure,
|
||||||
|
footer,
|
||||||
|
header,
|
||||||
|
hgroup,
|
||||||
|
main,
|
||||||
|
menu,
|
||||||
|
nav,
|
||||||
|
section,
|
||||||
|
summary {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct `inline-block` display not defined in IE 8/9.
|
||||||
|
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio,
|
||||||
|
canvas,
|
||||||
|
progress,
|
||||||
|
video {
|
||||||
|
display: inline-block; /* 1 */
|
||||||
|
vertical-align: baseline; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent modern browsers from displaying `audio` without controls.
|
||||||
|
* Remove excess height in iOS 5 devices.
|
||||||
|
*/
|
||||||
|
|
||||||
|
audio:not([controls]) {
|
||||||
|
display: none;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address `[hidden]` styling not present in IE 8/9/10.
|
||||||
|
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
|
||||||
|
*/
|
||||||
|
|
||||||
|
[hidden],
|
||||||
|
template {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Links
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove the gray background color from active links in IE 10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Improve readability when focused and also mouse hovered in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
a:active,
|
||||||
|
a:hover {
|
||||||
|
outline: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Text-level semantics
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
abbr[title] {
|
||||||
|
border-bottom: 1px dotted;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
b,
|
||||||
|
strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address styling not present in Safari and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
dfn {
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address variable `h1` font-size and margin within `section` and `article`
|
||||||
|
* contexts in Firefox 4+, Safari, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
font-size: 2em;
|
||||||
|
margin: 0.67em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address styling not present in IE 8/9.
|
||||||
|
*/
|
||||||
|
|
||||||
|
mark {
|
||||||
|
background: #ff0;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address inconsistent and variable font size in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
small {
|
||||||
|
font-size: 80%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
sub,
|
||||||
|
sup {
|
||||||
|
font-size: 75%;
|
||||||
|
line-height: 0;
|
||||||
|
position: relative;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
sup {
|
||||||
|
top: -0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
sub {
|
||||||
|
bottom: -0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Embedded content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove border when inside `a` element in IE 8/9/10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
img {
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Correct overflow not hidden in IE 9/10/11.
|
||||||
|
*/
|
||||||
|
|
||||||
|
svg:not(:root) {
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Grouping content
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address margin not present in IE 8/9 and Safari.
|
||||||
|
*/
|
||||||
|
|
||||||
|
figure {
|
||||||
|
margin: 1em 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address differences between Firefox and other browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
hr {
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
box-sizing: content-box;
|
||||||
|
height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contain overflow in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
pre {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address odd `em`-unit font size rendering in all browsers.
|
||||||
|
*/
|
||||||
|
|
||||||
|
code,
|
||||||
|
kbd,
|
||||||
|
pre,
|
||||||
|
samp {
|
||||||
|
font-family: monospace, monospace;
|
||||||
|
font-size: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Forms
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Known limitation: by default, Chrome and Safari on OS X allow very limited
|
||||||
|
* styling of `select`, unless a `border` property is set.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct color not being inherited.
|
||||||
|
* Known issue: affects color of disabled elements.
|
||||||
|
* 2. Correct font properties not being inherited.
|
||||||
|
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
input,
|
||||||
|
optgroup,
|
||||||
|
select,
|
||||||
|
textarea {
|
||||||
|
color: inherit; /* 1 */
|
||||||
|
font: inherit; /* 2 */
|
||||||
|
margin: 0; /* 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address `overflow` set to `hidden` in IE 8/9/10/11.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button {
|
||||||
|
overflow: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address inconsistent `text-transform` inheritance for `button` and `select`.
|
||||||
|
* All other form control elements do not inherit `text-transform` values.
|
||||||
|
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
|
||||||
|
* Correct `select` style inheritance in Firefox.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
select {
|
||||||
|
text-transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
|
||||||
|
* and `video` controls.
|
||||||
|
* 2. Correct inability to style clickable `input` types in iOS.
|
||||||
|
* 3. Improve usability and consistency of cursor style between image-type
|
||||||
|
* `input` and others.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button,
|
||||||
|
html input[type="button"], /* 1 */
|
||||||
|
input[type="reset"],
|
||||||
|
input[type="submit"] {
|
||||||
|
-webkit-appearance: button; /* 2 */
|
||||||
|
cursor: pointer; /* 3 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Re-set default cursor for disabled elements.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button[disabled],
|
||||||
|
html input[disabled] {
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove inner padding and border in Firefox 4+.
|
||||||
|
*/
|
||||||
|
|
||||||
|
button::-moz-focus-inner,
|
||||||
|
input::-moz-focus-inner {
|
||||||
|
border: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
|
||||||
|
* the UA stylesheet.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input {
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It's recommended that you don't attempt to style these elements.
|
||||||
|
* Firefox's implementation doesn't respect box-sizing, padding, or width.
|
||||||
|
*
|
||||||
|
* 1. Address box sizing set to `content-box` in IE 8/9/10.
|
||||||
|
* 2. Remove excess padding in IE 8/9/10.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="checkbox"],
|
||||||
|
input[type="radio"] {
|
||||||
|
box-sizing: border-box; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
|
||||||
|
* `font-size` values of the `input`, it causes the cursor style of the
|
||||||
|
* decrement button to change from `default` to `text`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="number"]::-webkit-inner-spin-button,
|
||||||
|
input[type="number"]::-webkit-outer-spin-button {
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
|
||||||
|
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
|
||||||
|
* (include `-moz` to future-proof).
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="search"] {
|
||||||
|
-webkit-appearance: textfield; /* 1 */
|
||||||
|
-moz-box-sizing: content-box;
|
||||||
|
-webkit-box-sizing: content-box; /* 2 */
|
||||||
|
box-sizing: content-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
|
||||||
|
* Safari (but not Chrome) clips the cancel button when the search input has
|
||||||
|
* padding (and `textfield` appearance).
|
||||||
|
*/
|
||||||
|
|
||||||
|
input[type="search"]::-webkit-search-cancel-button,
|
||||||
|
input[type="search"]::-webkit-search-decoration {
|
||||||
|
-webkit-appearance: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Define consistent border, margin, and padding.
|
||||||
|
*/
|
||||||
|
|
||||||
|
fieldset {
|
||||||
|
border: 1px solid #c0c0c0;
|
||||||
|
margin: 0 2px;
|
||||||
|
padding: 0.35em 0.625em 0.75em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1. Correct `color` not being inherited in IE 8/9/10/11.
|
||||||
|
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
|
||||||
|
*/
|
||||||
|
|
||||||
|
legend {
|
||||||
|
border: 0; /* 1 */
|
||||||
|
padding: 0; /* 2 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove default vertical scrollbar in IE 8/9/10/11.
|
||||||
|
*/
|
||||||
|
|
||||||
|
textarea {
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Don't inherit the `font-weight` (applied by a rule above).
|
||||||
|
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
|
||||||
|
*/
|
||||||
|
|
||||||
|
optgroup {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tables
|
||||||
|
========================================================================== */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove most spacing between table cells.
|
||||||
|
*/
|
||||||
|
|
||||||
|
table {
|
||||||
|
border-collapse: collapse;
|
||||||
|
border-spacing: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
td,
|
||||||
|
th {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user