aboutsummaryrefslogtreecommitdiffstats
path: root/community/ghc/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/ghc/APKBUILD')
-rw-r--r--community/ghc/APKBUILD110
1 files changed, 45 insertions, 65 deletions
diff --git a/community/ghc/APKBUILD b/community/ghc/APKBUILD
index 4d1b271bdd..d3e67c070d 100644
--- a/community/ghc/APKBUILD
+++ b/community/ghc/APKBUILD
@@ -1,74 +1,54 @@
# Maintainer: Mitch Tishmack <mitch.tishmack@gmail.com>
pkgname=ghc
-pkgver=8.0.2
-pkgrel=7
+pkgver=8.4.2
+pkgrel=0
+# Normal non rc candidate
+_urlprefix="$pkgver"
+_pkgprefix="$pkgname-$pkgver"
pkgdesc="The Glasgow Haskell Compiler"
+# Next 5 variables only needed for release candidate testing
+#pkgrcver=8.2.2
+#pkgrc=rc3
+#pkgdate=20171108
+#urlprefix="$pkgrcver-$pkgrc"
+#pkgprefix="ghc-$pkgver.$pkgdate"
url="http://haskell.org"
-arch="x86_64 armhf"
+arch="x86_64"
# Note ghc's license is basically BSD-3. If you'd like to know more visit:
# * https://www.haskell.org/ghc/license
# * https://ghc.haskell.org/trac/ghc/wiki/Licensing
license="BSD-3-Clause"
# Note that ghc is sensitive to the version of llvm used,
-# hence the llvm3.7 package.
+# hence the llvm5 dependency.
#
# Ref: https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.0.1
# https://ghc.haskell.org/trac/ghc/wiki/ImprovedLLVMBackend
-depends="gmp-dev perl gcc>=6.2.1 llvm3.7 libffi-dev"
+depends="gmp-dev perl gcc>=6.2.1 llvm5 libffi-dev"
# ghc is self-hosted, so we need ghc to build ghc. ghc-bootstrap is provided by
# this aport (see below).
-makedepends_build="$pkgname-bootstrap haskell-ghc
- autoconf cpio binutils-gold paxmark libffi-dev ncurses-dev"
+makedepends_build="$pkgname-bootstrap
+ autoconf cpio binutils binutils-gold paxmark libffi-dev ncurses-dev xz coreutils"
makedepends_host="linux-headers musl-dev zlib-dev gmp-dev binutils-dev libffi-dev ncurses-dev"
makedepends="$makedepends_build $makedepends_host"
-checkdepends="python2"
+checkdepends="python3"
# XXX: ghc-bootstrap is a hack to allow this abuild to depend on itself.
# Adding "ghc" to makedepends would not work, because abuild implicitly removes
# $pkgname and $subpackages from the abuild's dependencies.
-provides="
- $pkgname-bootstrap=$pkgver-r$pkgrel
- haskell-cabal=1.24.2.0
- haskell-bytestring=0.10.8.1
- haskell-containers=0.5.7.1
- haskell-deepseq=1.4.2.0
- haskell-directory=1.3.0.0
- haskell-filepath=1.4.1.1
- haskell-ghc=8.0.2
- haskell-ghc-boot=8.0.2
- haskell-ghc-boot-th=8.0.2
- haskell-ghc-prim=0.5.0.0
- haskell-ghci=8.0.2
- haskell-haskeline=0.7.3.0
- haskell-hoopl=3.10.2.1
- haskell-hpc=0.6.0.3
- haskell-integer-gmp=1.0.0.1
- haskell-pretty=1.1.3.3
- haskell-process=1.4.3.0
- haskell-rts=1.0
- haskell-template-haskell=2.11.1.0
- haskell-terminfo=0.4.0.2
- haskell-time=1.6.0.1
- haskell-transformers=0.5.2.0
- haskell-unix=2.7.2.1
- haskell-xhtml=3000.2.1
- "
+provides="$pkgname-bootstrap=$pkgver-r$pkgrel"
subpackages="$pkgname-doc $pkgname-dev"
install="$pkgname.post-install"
options="!strip" # we strip it manually in build()
-source="http://downloads.haskell.org/~ghc/$pkgver/ghc-$pkgver-src.tar.xz
- http://downloads.haskell.org/~ghc/$pkgver/ghc-$pkgver-testsuite.tar.xz
- 0000-alpine.patch
- 0000-bootstrap.patch
- 0001-rm-ghc-pwd.patch
- 0002-Correct-issue-with-libffi-and-glibc.patch
- 0003-do-not-use-SHELL.patch
- 0004-reproducible-tmp-names.patch
- 0005-buildpath-abi-stability.patch
- 0006-fix-madvise.patch
- 0007-build-hp2ps-twice.patch
- 0008-build-unlit-twice.patch
- "
-builddir="$srcdir/$pkgname-$pkgver"
+source="https://downloads.haskell.org/~ghc/$_urlprefix/$_pkgprefix-src.tar.xz
+ https://downloads.haskell.org/~ghc/$_urlprefix/$_pkgprefix-testsuite.tar.xz
+ 0005-buildpath-abi-stability.patch
+ "
+
+# We only need the bootstrap patch when bootstrapping a new arches ghc.
+if [ "$CBUILD" != "$CTARGET" ]; then
+ source="$source 0000-bootstrap.patch"
+fi
+
+builddir="$srcdir/$_pkgprefix"
prepare() {
default_prepare
@@ -79,7 +59,6 @@ prepare() {
BuildFlavour = perf-llvm
INTEGER_LIBRARY = integer-gmp
BeConservative = YES
- V = 0
GhcStage3HcOpts += -O3
SplitSections = YES
EOF
@@ -104,6 +83,8 @@ build() {
local ffi_inc=$(pkg-config libffi --cflags-only-I); ffi_inc="${ffi_inc%% }"
local ffi_lib=$(pkg-config libffi --libs-only-L); ffi_lib="${ffi_lib%% }"
+ GHCLD=${CROSS_COMPILE}ld.gold
+
# NOTE: ghc build system requires host == build, and it ends up
# compiling the cross-compiler (stage1) and cross-compiling with
# that the native compiler (stage2)
@@ -119,8 +100,17 @@ build() {
--with-nm=${CROSS_COMPILE}nm \
--with-ranlib=${CROSS_COMPILE}ranlib \
--with-objdump=${CROSS_COMPILE}objdump \
- --with-ld=${CROSS_COMPILE}ld.gold \
- --with-ld.gold=${CROSS_COMPILE}ld.gold
+ --disable-ld-override \
+ CONF_CPP_OPTS_STAGE0=" $ffi_inc $ffi_lib " \
+ CONF_CC_OPTS_STAGE0=" $ffi_inc $ffi_lib " \
+ LD=$GHCLD
+
+ # Switch llvm-targets from unknown-linux-gnueabihf->alpine-linux
+ # so we can match the llvm vendor string alpine uses
+ sed -i -e 's/unknown-linux-gnueabihf/alpine-linux/g' llvm-targets
+ sed -i -e 's/unknown-linux-gnueabi/alpine-linux/g' llvm-targets
+ sed -i -e 's/unknown-linux-gnu/alpine-linux/g' llvm-targets
+
make
}
@@ -193,16 +183,6 @@ dev() {
echo "$pfiles" | cpio -pamVd "$subpkgdir"
echo "$pfiles" | xargs rm -fr
}
-
-sha512sums="58ea3853cd93b556ecdc4abd0be079b2621171b8491f59004ea4e036a4cba4470aaafe6591b942e0a50a64bdc47540e01fe6900212a1ef7087850112d9bfc5ef ghc-8.0.2-src.tar.xz
-1b35fc6a5f482dc1e33f21ddf4c4fe17591990f16a4105c787225980a5f4dbaa42205204faf547f8e1b53f6356aefde9d3ff50cc416c9bf1a9ac08feadd74a99 ghc-8.0.2-testsuite.tar.xz
-23a52467fe83322e7b1d5f3e17a9defd08969666acb5a40e40ad93aa4f3feec028389448d4620edbe3ee8b246b3b6e338b267dce09cb14bdd0949b98e75d7562 0000-alpine.patch
-82cecce9e42c12cc3c8d484331b76ac5c6d2529887cd73181d4798f95057883be47489919379e6ebf7daba95b7c25b5d9d689b30ed8d01b13dda20a3b921ce3d 0000-bootstrap.patch
-128eece1b103f286b915a1563a628b638f03509d18cdb2e6510957d26eb56a4ae66e33c946c0e6c2aac2f947b9646dc88c1f390c69ea21f9dc64e0bef4de4e97 0001-rm-ghc-pwd.patch
-6f90b0de1e34c286e54ef14514ffabe17f9012fbc5448b4aacb3687aac065942e0a3a2c1c57b6338121140369a8870b4ce2a6b355c83c43344d4de8909a253a4 0002-Correct-issue-with-libffi-and-glibc.patch
-59194e6994c8344c579ec16c3adf3e0cdc7c356b524b12f8b10ec940191463d686782e525537c94ffa8e1bf9efcc36a2b3da3004183586ab0e354ab0a7036e0a 0003-do-not-use-SHELL.patch
-b5a5e73a2f01c0cabc96a49776d0d0f3d1d7a10759bb0b2982e7c7f6dc525d0559c0183ee779feb77ec6f2cec3bac17c1a5ba4c3bc0c6f780dfc1ed3dcf6c80e 0004-reproducible-tmp-names.patch
-e1c2cef06d307eda4b35521204e95eb54ace5dbcd22de659e95356f884b4424d6304365e4ab45c5116192cba4c095e2e91114bc7cb73d7c7173a7035287d0854 0005-buildpath-abi-stability.patch
-478f9c9990ee01b70e88daf97138f853816d862731a02e9286ad787845dcb40c1443a30520598d805d0ff7cea8c3d604ed5d9033dbe8e572e8a85911ee739ff7 0006-fix-madvise.patch
-a1032b800515908eae1602454c03bd80c92e39faa4004b52dba698d84166abea1bb4ce4afc2b69aad4a25a4e9acb2d12704453e512ab2b2ceae02c6df180bd76 0007-build-hp2ps-twice.patch
-0a53264a2066869379cbcb3a6175b93d4461d9a9fe6d2594bf0c9438daa176fbccf033832fa61bd482a23335c4528d8087301e3bdc08d08160acb789befbe005 0008-build-unlit-twice.patch"
+sha512sums="aeb17c986c597762381d9887679eb0eec194c2938a92b5a33e66b4c80002ead02d672b4aa968e1061ab5652b74e46a3c9f9e3d58d5be4a0ae47aa8aed288cf1f ghc-8.4.2-src.tar.xz
+67ce9cb89ea5b04c4d4dec4252a00c990d16ebca917959d2b251e6f230e14d297cd7b5a29f5acf5a2d1e0ff33ffa65b33688cdd2eab8bdb4d4e88245c7a6e53e ghc-8.4.2-testsuite.tar.xz
+e1c2cef06d307eda4b35521204e95eb54ace5dbcd22de659e95356f884b4424d6304365e4ab45c5116192cba4c095e2e91114bc7cb73d7c7173a7035287d0854 0005-buildpath-abi-stability.patch"