@@ -11,15 +11,37 @@ RUN apk --no-cache add binutils-gold curl gcc g++ git gmp-dev ncurses-dev ncurse
11
11
# Install system deps for FOSSA CLI:
12
12
RUN apk --no-cache add bash xz-libs xz-dev bzip2-dev bzip2-static upx curl jq
13
13
14
- ENV BOOTSTRAP_HASKELL_NONINTERACTIVE=1
15
- ENV BOOTSTRAP_HASKELL_MINIMAL=1
14
+ ENV GHC_VERSION= "9.8.2"
15
+
16
16
ENV PATH="/root/.cabal/bin:/root/.ghcup/bin:$PATH"
17
- RUN curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
18
17
19
- RUN ghcup install ghc 9.8.2
18
+ RUN <<EOF
19
+ if [ $(uname -m) != "aarch64" ] ; then
20
+ export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
21
+ export BOOTSTRAP_HASKELL_MINIMAL=1
22
+ curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
23
+
24
+ ghcup install ghc "$GHC_VERSION"
25
+ ghcup set ghc "$GHC_VERSION"
26
+ else
27
+ mkdir /tmp/ghc
28
+ curl "https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-aarch64-alpine3_18-linux.tar.xz" | tar --strip-components=1 -xJC /tmp/ghc
29
+ cd /tmp/ghc
30
+ ./configure --prefix="$HOME/.ghcup" && make install && rm -rf /tmp/ghc
31
+ fi
32
+ EOF
33
+
34
+ # Install cabal
35
+ RUN <<EOF
36
+ if [ $(uname -m) != "aarch64" ] ; then
37
+ ghcup install cabal 3.10.3.0
38
+ else
39
+ curl https://downloads.haskell.org/~cabal/cabal-install-3.12.1.0/cabal-install-3.12.1.0-aarch64-linux-alpine3_18.tar.xz | tar -xJC "$HOME/.ghcup/bin/"
40
+ chmod 755 "$HOME/.ghcup/bin/cabal"
41
+ rm "$HOME/.ghcup/bin/plan.json"
42
+ fi
43
+ EOF
20
44
21
- RUN ghcup set ghc 9.8.2
22
- RUN ghcup install cabal 3.10.3.0
23
45
24
46
# Sets USER environment to overcome issue, as described in:
25
47
# https://github.com/cachix/install-nix-action/issues/122
0 commit comments