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

81 lines
2.5 KiB
YAML
Raw Normal View History

2022-08-23 01:44:03 +03:00
distributable:
2022-11-20 03:02:25 +03:00
url: https://hackage.haskell.org/packages/archive/cabal-install/{{ version }}.0/cabal-install-{{ version }}.0.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
2022-08-23 01:44:03 +03:00
strip:
- /^[Cc]abal /
- /\.0$/ #FIXME cabal uses 4 digit versioning
dependencies:
haskell.org: 9
gnu.org/gmp: 6
zlib.net: 1
provides:
- bin/cabal
build:
dependencies:
curl.se: '*'
tea.xyz/gx/cc: c99
2022-12-01 23:28:21 +03:00
linux/aarch64:
github.com/numactl/numactl: ^2 # downloaded cabal needs this
tukaani.org/xz: 5
2022-08-23 01:44:03 +03:00
script: |-
case "X{{ hw.target }}" in
"Xaarch64-apple-darwin")
BOOTSTRAP="https://downloads.haskell.org/~ghcup/unofficial-bindists/cabal/3.6.0.0/cabal-install-3.6.0.0-aarch64-darwin-big-sur.tar.xz"
;;
"Xx86_64-apple-darwin")
BOOTSTRAP="https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-apple-darwin17.7.0.tar.xz"
;;
"Xx86_64-unknown-linux-gnu")
BOOTSTRAP="https://downloads.haskell.org/~cabal/cabal-install-3.2.0.0/cabal-install-3.2.0.0-x86_64-unknown-linux.tar.xz"
;;
"Xaarch64-unknown-linux-gnu")
BOOTSTRAP="https://downloads.haskell.org/ghcup/unofficial-bindists/cabal/3.7.0.0-pre20220407/cabal-install-3.7-aarch64-linux-deb10.tar.xz"
;;
*)
echo "Unknown arch. Please update the pantry."
exit 1
esac
if [[ "X{{ hw.platform }}" == Xlinux ]]; then
ADDITIONAL_CABAL_FLAGS="--with-gcc=clang"
fi
2023-04-15 06:46:31 +03:00
if test ! -e .bootstrap/cabal; then
if test ! -e .bootstrap; then
mkdir .bootstrap
2022-08-23 01:44:03 +03:00
fi
2023-04-15 06:46:31 +03:00
curl -L "${BOOTSTRAP}" | tar Jxf - -C .bootstrap
2022-08-23 01:44:03 +03:00
fi
## This seems dirty, but building is an internal-only gig atm.
# Likely fix is to use CABAL_DIR in build scripts
if test -e ~/.cabal/bin; then
rm -r ~/.cabal/bin
fi
# 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
2023-04-15 06:33:42 +03:00
sed -i.bak \
-e 's/build-depends: base.*/build-depends: base >=4.10 \&\& <5/' \
-e 's/text.*>=.*/text >= 1.2.3 \&\& < 3,/' \
cabal-install.cabal
2022-08-23 01:44:03 +03:00
# ^^ SEE https://github.com/haskell/cabal/issues/8118
rm *.bak
2023-04-15 06:33:42 +03:00
mkdir -p "{{prefix}}/bin"
2023-04-15 06:46:31 +03:00
./.bootstrap/cabal v2-update
./.bootstrap/cabal v2-install \
2022-08-23 01:44:03 +03:00
--install-method=copy \
--installdir={{prefix}}/bin \
$ADDITIONAL_CABAL_FLAGS
2022-12-01 23:28:21 +03:00
test: |
cabal --config-file=./config user-config init
cabal --config-file=./config info Cabal