-
Notifications
You must be signed in to change notification settings - Fork 52
/
haskell
38 lines (32 loc) · 988 Bytes
/
haskell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env bash
GHC_MIRROR=https://www.haskell.org/ghc
# Output lists of versions
plug_list_versions() {
echo $(curl -s "${GHC_MIRROR}/" | grep GHC | grep Released | \
egrep -o '[0-9]+\.[0-9]+\.[0-9]+' | \
uniq | sort)
}
# Return full url for tarball for download
# and future installation
plug_url_for_download() {
local version=$1
echo "${GHC_MIRROR}/dist/${version}/ghc-${version}-src.tar.bz2"
}
# Checks before compilation
plug_check_deps() {
if [ "`which ghc`" = "" ]; then
echo " To compile GHC from source you need pre-installed GHC version."
echo " Please, install system-wide GHC."
echo " For example, in ubuntu:"
echo ""
echo " $ sudo aptitude install ghc"
fi
}
# Overload Unpacking function
# Default way: "tar -xzf ..."
# And we need to "tar -xjf ..."
plug_unpack() {
local tarball=$1
local src_path=$2
tar -xjf "$tarball" -C "$src_path"
}