From e2f503c0d46ac207e04d51fcaa1236808a11a493 Mon Sep 17 00:00:00 2001 From: Jacob Heider Date: Sun, 9 Apr 2023 19:02:10 -0400 Subject: [PATCH] update(haskell) (#869) * update(haskell) * add PIC for x86-64 * ChatGPT says this will work * so annoying * maybe this * let's goooo --- projects/haskell.org/package.yml | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/projects/haskell.org/package.yml b/projects/haskell.org/package.yml index dca04a41..aa445d0c 100644 --- a/projects/haskell.org/package.yml +++ b/projects/haskell.org/package.yml @@ -4,6 +4,7 @@ distributable: strip-components: 1 versions: + - 9.4.4 - 9.2.4 #TODO # github: ghc/ghc/tags @@ -64,14 +65,20 @@ build: rm -r $HOME/.cabal/bin fi - cabal update - cabal install alex happy - export PATH="$HOME/.cabal/bin:$PATH" GHC="$HOME/.ghcup/bin/ghc" + # We need PIC on linux-x86_64 (it's already on the other + # platforms). This does that. + # https://www.hobson.space/posts/haskell-foreign-library/ + + sed -i.bak \ + 's/\((OSLinux, ArchAArch64) -> \[Opt_PIC, Opt_ExternalDynamicRefs\]\)/\1\n (OSLinux, ArchX86_64) -> \[Opt_PIC, Opt_ExternalDynamicRefs\]/' \ + compiler/GHC/Driver/Session.hs + rm compiler/GHC/Driver/Session.hs.bak + ./configure $ARGS - hadrian/build -j --docs=none --prefix="{{prefix}}" install + hadrian/build $HADRIAN_ARGS install for shim in $(find "{{prefix}}/bin" -type f); do sed -i.bak -e 's_="{{prefix}}_="$(dirname $(dirname $0))_' $shim @@ -84,18 +91,25 @@ build: BOOTSTRAP_HASKELL_NONINTERACTIVE: 1 BOOTSTRAP_HASKELL_ADJUST_BASHRC: 0 BOOTSTRAP_HASKELL_GHC_VERSION: ${{version}} - CONF_CC_OPTS_STAGE0: $LDFLAGS - CONF_CC_OPTS_STAGE1: $LDFLAGS - CONF_CC_OPTS_STAGE2: $LDFLAGS + CONF_CC_OPTS_STAGE0: $CFLAGS + CONF_CC_OPTS_STAGE1: $CFLAGS + CONF_CC_OPTS_STAGE2: $CFLAGS CONF_GCC_LINKER_OPTS_STAGE0: $LDFLAGS CONF_GCC_LINKER_OPTS_STAGE1: $LDFLAGS CONF_GCC_LINKER_OPTS_STAGE2: $LDFLAGS + # ChatGPT + GHC_OPTIONS: -fPIC ARGS: - --prefix={{prefix}} - --disable-numa - --with-curses-includes={{deps.invisible-island.net/ncurses.prefix}}/include/ncursesw - --with-intree-gmp - --with-system-libffi + HADRIAN_ARGS: + - -j + - --docs=none + - --flavour=release + - --prefix="{{prefix}}" linux: C_INCLUDE_PATH: ${{deps.invisible-island.net/ncurses.prefix}}/include/ncursesw # ^^ yep telling `./configure` about it just aint enough