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

82 lines
2.6 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:
haskell.org: 9.6.3 # later version 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
- 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/' \
-e 's/text.*>=.*/text >= 1.2.3 \&\& < 3,/' \
-e 's/zlib.*< .*/zlib >= 0.5.3 \&\& < 0.7,/' \
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