scripts: Add GHC 8.4 ci image

This commit is contained in:
Daniel Gröber 2018-04-24 01:13:13 +02:00
parent 8a36de9e19
commit d72e261e74

View File

@ -15,24 +15,19 @@ while read -r ghc_rel ghc ghc_arch ghc_ext cabal cabal_rev image; do
[ -n "$target" ] && [ x"$ghc_rel" != x"$target" ] && continue [ -n "$target" ] && [ x"$ghc_rel" != x"$target" ] && continue
ghc_url="https://downloads.haskell.org/~ghc/${ghc_rel}/ghc-${ghc}-${ghc_arch}.tar.${ghc_ext}" ghc_url="https://downloads.haskell.org/~ghc/${ghc_rel}/ghc-${ghc}-${ghc_arch}.tar.${ghc_ext}"
cabal_url="https://www.haskell.org/cabal/release/cabal-install-${cabal}/cabal-install-${cabal}-x86_64-unknown-linux.tar.gz" cabal_url="https://hackage.haskell.org/package/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz"
## To build cabal from source:
#cabal_url="https://hackage.haskell.org/package/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz"
# https://www.haskell.org/cabal/release/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz # https://www.haskell.org/cabal/release/cabal-install-${cabal}/cabal-install-${cabal}.tar.gz
#cabal_meta_url="https://hackage.haskell.org/package/cabal-install-${cabal}/revision/${cabal_rev}.cabal" cabal_meta_url="https://hackage.haskell.org/package/cabal-install-${cabal}/revision/${cabal_rev}.cabal"
ghc_file="$(basename "$ghc_url")" ghc_file="$(basename "$ghc_url")"
cabal_exe_file="cabal"
cabal_file="$(basename "$cabal_url")" cabal_file="$(basename "$cabal_url")"
# cabal_meta_file=cabal-install-"${cabal}"-"${cabal_rev}".cabal cabal_meta_file=cabal-install-"${cabal}"-"${cabal_rev}".cabal
ADDITIONAL_COMMANDS="" ADDITIONAL_COMMANDS=""
ADDITIONAL_BOOTSTRAP_SETUP="true" ADDITIONAL_BOOTSTRAP_SETUP="true"
if [ x"$image" = x"debian:squeeze" ]; then if [ x"$image" = x"debian:squeeze" ]; then
ADDITIONAL_PACKAGES="realpath" ADDITIONAL_PACKAGES=" libncursesw5 realpath"
ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY sources.list /etc/apt/ ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY sources.list /etc/apt/
COPY 10-no-check-valid-until /etc/apt/apt.conf.d/ COPY 10-no-check-valid-until /etc/apt/apt.conf.d/
" "
@ -46,25 +41,20 @@ EOF
cat > "$tmpdir"/10-no-check-valid-until <<EOF cat > "$tmpdir"/10-no-check-valid-until <<EOF
Acquire::Check-Valid-Until "0"; Acquire::Check-Valid-Until "0";
EOF EOF
elif [ x"$image" = x"debian:jessie" ]; then
:
fi fi
mkdir -p "$dldir" mkdir -p "$dldir"
d="$(pwd)"; cd "$dldir" || exit 1 d="$(pwd)"; cd "$dldir" || exit 1
wget -nv -nc -c "$ghc_url" && cp -l "$ghc_file" "$tmpdir" wget -nv -nc -c "$ghc_url" && cp -l "$ghc_file" "$tmpdir"
wget -nv -nc -c "$cabal_url" && tar -xzOf "$cabal_file" cabal \ wget -nv -nc -c "$cabal_url" && cp -l "$cabal_file" "$tmpdir"
> "$tmpdir/$cabal_exe_file" if [ ! -e "$dldir"/"${cabal_meta_file}" ]; then
wget -nv "$cabal_meta_url" -O "$dldir"/"${cabal_meta_file}"
#wget -nv -nc -c "$cabal_url" && cp -l "$cabal_file" "$tmpdir" fi && cp -l "$dldir"/"${cabal_meta_file}" "$tmpdir"
# if [ ! -e "$dldir"/"${cabal_meta_file}" ]; then
# wget -nv "$cabal_meta_url" -O "$dldir"/"${cabal_meta_file}"
# fi && cp -l "$dldir"/"${cabal_meta_file}" "$tmpdir"
ls -l "$tmpdir" ls -l "$tmpdir"
cd "$d" || exit 1 cd "$d" || exit 1
ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY $ghc_file $cabal_exe_file /root/ ADDITIONAL_COMMANDS="${ADDITIONAL_COMMANDS}COPY $ghc_file $cabal_file $cabal_meta_file /root/
" "
cat > "$tmpdir"/Dockerfile <<EOF cat > "$tmpdir"/Dockerfile <<EOF
@ -79,29 +69,31 @@ $ADDITIONAL_COMMANDS
RUN apt-get update && apt-get upgrade -y && \ RUN apt-get update && apt-get upgrade -y && \
apt-get install -y --no-install-recommends \ apt-get install -y --no-install-recommends \
alex happy wget git xz-utils gpgv ca-certificates build-essential libgmp3-dev zlib1g-dev libncurses5-dev libncursesw5-dev $ADDITIONAL_PACKAGES && \ alex happy wget git xz-utils gpgv ca-certificates build-essential libgmp3-dev libtinfo-dev zlib1g-dev $ADDITIONAL_PACKAGES && \
apt-get clean apt-get clean
RUN tar -xf ghc-*.tar.* && \ RUN tar -xf ghc-*.tar.* && \
cd ghc-* && ./configure --prefix=/usr/local && make install && cd .. && \ cd ghc-* && ./configure --prefix=/usr/local && make install && cd .. && \
rm -r ghc-* rm -r ghc-*
RUN chmod +x cabal; mv cabal /usr/local/bin RUN tar -xf cabal-install-*.tar.* && \
cd cabal-install-* && \
cp /root/$cabal_meta_file cabal-install.cabal && \
${ADDITIONAL_BOOTSTRAP_SETUP} && \
./bootstrap.sh --no-doc --global && \
cd .. && \
rm -r cabal-*
EOF EOF
docker build -t "${namespace}:ghc${ghc}-cabal-install${cabal}" "$tmpdir" docker build -t "${namespace}:ghc${ghc}-cabal-install${cabal}" "$tmpdir"
docker run "${namespace}:ghc${ghc}-cabal-install${cabal}" sh -c 'cabal update; git clone -bghc802 https://github.com/DanielG/ghc-mod.git; cd ghc-mod; cabal new-build'
done <<EOF done <<EOF
8.2.2 8.2.2 x86_64-deb8-linux xz 2.0.0.1 0 debian:jessie 8.4.1 8.4.1 x86_64-deb8-linux xz 2.2.0.0 0 debian:jessie
8.0.2 8.0.2 x86_64-deb8-linux xz 2.0.0.1 0 debian:jessie 8.2.2 8.2.2 x86_64-deb8-linux xz 2.0.0.0 0 debian:jessie
7.10.3 7.10.3 x86_64-deb8-linux xz 2.0.0.1 0 debian:jessie 8.0.2 8.0.2 x86_64-deb8-linux xz 1.24.0.2 0 debian:jessie
7.8.4 7.8.4 x86_64-unknown-linux-deb7 xz 2.0.0.1 0 debian:jessie 7.10.3 7.10.3 x86_64-deb8-linux xz 1.24.0.2 0 debian:jessie
7.8.4 7.8.4 x86_64-unknown-linux-deb7 xz 1.24.0.2 0 debian:jessie
7.6.3 7.6.3 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze
7.4.2 7.4.2 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze
EOF EOF
# 7.6.3 7.6.3 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze
# 7.4.2 7.4.2 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze
# 7.2.2 7.2.2 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze # 7.2.2 7.2.2 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze
# 7.0.4 7.0.4 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze # 7.0.4 7.0.4 x86_64-unknown-linux bz2 1.24.0.2 0 debian:squeeze