pantry/projects/haskell.org/package.yml
Max Howell d3ad7ec109 ghc seems to require m4 during builds now
bootstrapping with a previous tea version of ghc would avoid this nonsense.
2022-09-19 08:15:42 -04:00

82 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

distributable:
url: https://downloads.haskell.org/~ghc/{{ version}}/ghc-{{ version}}-src.tar.xz
strip-components: 1
versions:
- 9.2.4
#TODO
# github: ghc/ghc/tags
# strip:
# - /^ghc-/
# - /-release$/
#NOTE relocatable if we edit the shell scripts
provides:
- bin/ghc
- bin/ghc-pkg
- bin/ghci
- bin/haddock
- bin/hp2ps
- bin/hpc
- bin/hsc2hs
- bin/runghc
- bin/runhaskell
dependencies:
gnu.org/gmp: 6
invisible-island.net/ncurses: 6
tea.xyz/gx/cc: c99 # ghc uses `gcc` as part of its build process
build:
dependencies:
gnu.org/autoconf: ^2
gnu.org/automake: ^1 # `aclocal` is used during the build for some reason
tea.xyz/gx/make: '*' #FIXME specifically, gnu make is *required*
curl.se: '*'
gnu.org/m4: '*'
script: |-
# `ghc` needs `ghc` to bootstrap `ghc`
# The canonical way to achieve this is with `ghcup`
# To that end, we capture $HOME so as to no pollute the user's life with unwanted
# stage0 tooling. Instead, everything is localized to {{ prefix }}/src, and can be
# cleaned up at will, and won't capture any of the user's workflow
export HOME={{ prefix }}/src
export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
export BOOTSTRAP_HASKELL_ADJUST_BASHRC=0
export BOOTSTRAP_HASKELL_GHC_VERSION={{ version }}
if test -d .ghcup; then
echo "ghcup already installed"
else
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
fi
PATH="{{ prefix }}/src/.ghcup/bin:$PATH"
if test -e {{ prefix }}/src/.cabal/bin; then
rm -r {{ prefix }}/src/.cabal/bin
fi
cabal update && cabal install alex happy
export PATH="{{ prefix }}/src/.cabal/bin:$PATH"
GHC="{{ prefix }}/src/.ghcup/bin/ghc"
export CPATH=/opt/invisible-island.net/ncurses/v6/include/ncursesw:$CPATH
#FIXME oddly, they dont provide `./configure`; we have to generate it
autoconf
./configure --prefix={{ prefix }}
hadrian/build -j install --prefix={{ prefix }} --docs=none
test:
script: |
out=$(runghc $FIXTURE)
test "$out" = "Hello World"
fixture:
main = putStrLn "Hello World"