1- name : ' Setup libsecp256k1 '
2- description : ' Installs libsecp256k1 '
1+ name : ' Setup Haskell toolchain versions '
2+ description : ' Setup Haskell toolchain versions '
33inputs :
44 ghc-version :
55 description : Version of GHC to install
99 description : Version of cabal to install
1010 default : ' '
1111
12- pacman-packages :
13- description : Pacman packages to install
14- default : ' '
15-
1612outputs :
1713 cabal-store :
1814 description : " Prefix"
@@ -21,85 +17,16 @@ outputs:
2117runs :
2218 using : " composite"
2319 steps :
24- - name : " Install pkg-config"
25- if : runner.os == 'macOS'
26- shell : bash
27- run : brew install pkg-config
28-
29- - name : Setup PKG_CONFIG_PATH
30- shell : bash
31- run : |
32- if [ ${{ runner.os }} == "macOS" ]; then
33- # OpenSSL is installed in a non-standard location in MacOS. See
34- # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
35- echo "PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/opt/[email protected] /lib/pkgconfig" | tee -a "$GITHUB_ENV" 36- elif [ ${{ runner.os }} == "Linux" ]; then
37- echo "PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig" | tee -a "$GITHUB_ENV"
38- fi
39-
40- - name : Setup LD_LIBRARY_PATH
41- shell : bash
42- run : |
43- if [ ${{ runner.os }} != "Windows" ]; then
44- # OpenSSL is installed in a non-standard location in MacOS. See
45- # https://github.com/actions/virtual-environments/blob/main/images/macos/macos-11-Readme.md
46- echo "LD_LIBRARY_PATH=/usr/local/lib" | tee -a "$GITHUB_ENV"
47- fi
48-
49- # For some unknown reason, the pacman setup must come before ghc installation.
50- # It appears as if PATHEXT is set _after_ ghcup install ghc/cabal, and
51- # as such we'd need pacman.exe instead.
52- - name : " WIN: Install System Dependencies via pacman (msys2)"
53- if : runner.os == 'Windows' && inputs.pacman-packages != ''
54- shell : pwsh
55- run : |
56- # ghcup should be installed on current GHA Windows runners. Let's use ghcup to run
57- # pacman, to install the necessary dependencies, ...
58- ghcup run -- pacman --noconfirm -S ${{ inputs.pacman-packages }}
59-
60- - name : Setup GHC (Windows)
61- if : inputs.ghc-version != '' && runner.os == 'Windows'
62- shell : pwsh
63- run : ghcup install ghc --set ${{ inputs.ghc-version }}
64-
65- - name : Setup GHC (Posix)
20+ - name : Setup GHC
6621 if : inputs.ghc-version != ''
6722 shell : bash
6823 run : ghcup install ghc --set ${{ inputs.ghc-version }}
6924
70- - name : Setup cabal (Windows)
71- if : inputs.cabal-version != '' && runner.os == 'Windows'
72- shell : pwsh
73- run : ghcup install cabal --set ${{ inputs.cabal-version }}
74-
75- - name : Setup cabal (Posix)
25+ - name : Setup cabal
7626 if : inputs.cabal-version != ''
7727 shell : bash
7828 run : ghcup install cabal --set ${{ inputs.cabal-version }}
7929
80- - name : " WIN: fixup cabal config"
81- if : runner.os == 'Windows'
82- shell : pwsh
83- run : |
84- # make sure cabal knows about msys64, and mingw64 tools. Not clear why C:/cabal/config is empty
85- # and C:/cabal doesn't even exist. The ghcup bootstrap file should have create it in the image:
86- # See https://github.com/haskell/ghcup-hs/blob/787edc17af4907dbc51c85e25c490edd8d68b80b/scripts/bootstrap/bootstrap-haskell#L591
87- # So we'll do it by hand here for now.
88- #
89- # We'll _not_ add extra-include-dirs, or extra-lib-dirs, and rely on what's shipped with GHC.
90- # https://github.com/msys2/MINGW-packages/issues/10837#issuecomment-1047105402
91- # https://gitlab.haskell.org/ghc/ghc/-/issues/21111
92- # if we _do_ want them, this would be the lines to add below
93-
94- $ghcMingwDir = Join-Path -Path $(ghc --print-libdir) `
95- -ChildPath ../mingw/x86_64-*-mingw32/lib/ `
96- -Resolve
97-
98- cabal user-config -a "extra-prog-path: C:/msys64/mingw64/bin, C:/msys64/usr/bin" `
99- -a "extra-include-dirs: C:/msys64/mingw64/include" `
100- -a ("extra-lib-dirs: {0}, C:/msys64/mingw64/lib" -f $ghcMingwDir) `
101- -f init
102-
10330 # Unify the computation of the cabal store directory to a single step. This makes referencing the cabal
10431 # store in later steps easier.
10532 #
0 commit comments