pantry/projects/haskell.org/cabal/package.yml

93 lines
3.1 KiB
YAML
Raw Normal View History

2022-08-23 01:44:03 +03:00
distributable:
url: https://hackage.haskell.org/packages/archive/cabal-install/{{ version.raw }}/cabal-install-{{ version.raw }}.tar.gz
2022-08-23 01:44:03 +03:00
strip-components: 1
versions:
2023-04-15 05:22:02 +03:00
github: haskell/cabal/releases
strip: /^[Cc]abal /
2022-08-23 01:44:03 +03:00
dependencies:
haskell.org: 9
gnu.org/gmp: 6
zlib.net: 1
provides:
- bin/cabal
build:
dependencies:
2024-05-05 04:50:57 +03:00
haskell.org: <9.6.4 # later versions pass invalid linker flags on darwin clang-14
2022-08-23 01:44:03 +03:00
curl.se: '*'
2022-12-01 23:28:21 +03:00
linux/aarch64:
github.com/numactl/numactl: ^2 # downloaded cabal needs this
2022-12-01 23:28:21 +03:00
tukaani.org/xz: 5
script:
# utf-8 issues
- run: export HOME="$(mktemp -d)"
if: linux
2022-08-23 01:44:03 +03:00
2024-05-05 04:50:57 +03:00
# FIXME: this isn't great, but it'll fix any ghc install at build time
# needs install-time customization for a true fix
- run: |
if ! grep -q 'rpath,{{pkgx.prefix}}' settings; then
sed -i \
-e 's|\(C compiler flags.*\)")|\1 -Wl,-rpath,{{pkgx.prefix}}")|' \
-e 's|\(C++ compiler flags.*\)")|\1 -Wl,-rpath,{{pkgx.prefix}}")|' \
-e 's|\(C compiler link flags.*\)")|\1 -Wl,-rpath,{{pkgx.prefix}}")|' \
settings
fi
if: darwin
working-directory: ${{deps.haskell.org.prefix}}/.ghcup/ghc/{{deps.haskell.org.version}}/lib/ghc-{{deps.haskell.org.version}}/lib
- run: |
if test ! -e .bootstrap/cabal; then
if test ! -e .bootstrap; then
mkdir .bootstrap
fi
curl -L "${BOOTSTRAP}" | tar Jxf - -C .bootstrap
fi
2022-08-23 01:44:03 +03:00
## This seems dirty, but building is an internal-only gig atm.
# Likely fix is to use CABAL_DIR in build scripts
- run: |
if test -e ~/.cabal/bin; then
rm -r ~/.cabal/bin
fi
2022-08-23 01:44:03 +03:00
# this is not an acceptable solution, do you know a better one? pls PR 🙏
#FIXME also this sed line sucks but I got bored trying to make it work
# zlib 0.7.0.0 doesn't respect our rpaths with its intermediate build products
- |
sed -i \
-e 's/build-depends: base.*/build-depends: base >=4.10 \&\& <5/' \
cabal-install.cabal
2022-08-23 01:44:03 +03:00
# ^^ SEE https://github.com/haskell/cabal/issues/8118
- mkdir -p "{{prefix}}/bin"
- ./.bootstrap/cabal v2-update
2022-08-23 01:44:03 +03:00
- ./.bootstrap/cabal v2-install
--install-method=copy
--installdir={{prefix}}/bin
2022-08-23 01:44:03 +03:00
$ADDITIONAL_CABAL_FLAGS
env:
darwin/aarch64:
BOOTSTRAP: https://downloads.haskell.org/~cabal/cabal-install-3.10.2.0/cabal-install-3.10.2.0-aarch64-darwin.tar.xz
darwin/x86-64:
BOOTSTRAP: https://downloads.haskell.org/~cabal/cabal-install-3.10.2.0/cabal-install-3.10.2.0-x86_64-darwin.tar.xz
linux/x86-64:
BOOTSTRAP: https://downloads.haskell.org/~cabal/cabal-install-3.10.2.0/cabal-install-3.10.2.0-x86_64-linux-deb10.tar.xz
linux/aarch64:
BOOTSTRAP: https://downloads.haskell.org/~cabal/cabal-install-3.10.2.0/cabal-install-3.10.2.0-aarch64-linux-deb10.tar.xz
linux:
ADDITIONAL_CABAL_FLAGS:
- -v3
# else segfaults
- --enable-relocatable
- --ghc-option=-fPIC
- --ghc-option=-Wl,-pie
2022-08-23 01:44:03 +03:00
test:
- cabal --config-file=./config user-config init
- cabal --config-file=./config info Cabal