Mail archive
alpine-aports

[alpine-aports] [PATCH 3/5] testing/ghc: new aport

From: Mitch Tishmack <mitch.tishmack_at_gmail.com>
Date: Thu, 14 Jul 2016 21:53:21 -0500

---
 testing/ghc/APKBUILD | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100755 testing/ghc/APKBUILD
diff --git a/testing/ghc/APKBUILD b/testing/ghc/APKBUILD
new file mode 100755
index 0000000..4b405a1
--- /dev/null
+++ b/testing/ghc/APKBUILD
_at_@ -0,0 +1,105 @@
+#-*-mode: Shell-script; coding: utf-8;-*-
+# Contributor: Mitch Tishmack <mitch.tishmack_at_gmail.com>
+# Maintainer: Mitch Tishmack <mitch.tishmack_at_gmail.com>
+pkgname=ghc
+pkgdesc="The Glasgow haskell compiler 8.0.1"
+url="http://haskell.org"
+subpackages="$pkgname-doc $pkgname-dev"
+arch="x86_64 armhf"
+apkgver=8.0.1
+pkgver=$(echo ${apkgver} | tr -d '[a-z]')
+# setting _date to YYYmmDD will activate build from git behavior
+_date=
+if [ ${_date} != "" ]; then
+  pkgrel=${_date}
+  _builddir="$srcdir/$pkgname-${apkgver}.${_date}"
+  source="
+	https://s3-us-west-2.amazonaws.com/alpine-ghc/next/ghc-${apkver}.${_date}-src.tar.xz
+	"
+else
+  pkgrel=0
+  _builddir="$srcdir/$pkgname-$apkgver"
+  source="
+	http://downloads.haskell.org/~ghc/${apkgver}/ghc-${apkgver}-src.tar.xz
+	"
+fi
+inst_prefix=/usr
+# Note ghc's license is basically bsd3. If you'd like to know more visit:
+# https://www.haskell.org/ghc/license
+# https://ghc.haskell.org/trac/ghc/wiki/Licensing
+#
+# Note also that ghc is sensitive to the version of llvm used, hence the
+# llvm3.7 package.
+#
+# Ref: https://ghc.haskell.org/trac/ghc/wiki/Status/GHC-8.0.1
+#      https://ghc.haskell.org/trac/ghc/wiki/ImprovedLLVMBackend
+license="custom:bsd3"
+depends="bash gmp-dev libffi musl zlib ncurses perl gcc llvm3.7"
+install=""
+dev_depends="
+	$depends
+	linux-headers
+	musl-dev
+	ncurses-dev
+	gmp-dev
+	libffi-dev
+	zlib-dev
+	binutils-dev
+	"
+# ghc build dependencies
+makedepends="
+	$dev_depends
+	ghc-bootstrap
+	"
+
+_ghc_build_tmp="$_builddir/tmp"
+
+# Allow for multiple installs, intentionally not default.
+if [ ! -z $MULTI ]; then
+	inst_prefix="/opt/ghc/${pkgver}"
+	pkgname="ghc-${pkgver}"
+	depends="${depends}-37"
+fi
+
+build() {
+	cd "$_builddir"
+	cp mk/build.mk.sample mk/build.mk || return 1
+	echo "BuildFlavour         = perf-llvm" >> mk/build.mk || return 1
+	echo "SRC_HC_OPTS         += -fPIC" >> mk/build.mk || return 1
+	echo "SRC_HC_OPTS         += -fllvm" >> mk/build.mk || return 1
+	echo "SRC_CC_OPTS         += -fPIC" >> mk/build.mk || return 1
+	echo "GhcLibHcOpts        += -fPIC" >> mk/build.mk || return 1
+	echo "GhcRtsCcOpts        += -fPIC" >> mk/build.mk || return 1
+	echo "INTEGER_LIBRARY      = integer-gmp" >> mk/build.mk || return 1
+	echo "BeConservative       = YES" >> mk/build.mk || return 1
+	echo "GhcLibWays           = v" >> mk/build.mk || return 1
+	echo "GhcLibWays          += dyn" >> mk/build.mk || return 1
+	echo "GhcLibWays          += p"  >> mk/build.mk || return 1
+	echo "BUILD_SPHINX_HTML    = NO" >> mk/build.mk  || return 1
+	echo "BUILD_SPHINX_PS      = NO" >> mk/build.mk || return 1
+	echo "BUILD_SPHINX_PDF     = NO" >> mk/build.mk || return 1
+	echo "HADDOCK_DOCS         = NO" >> mk/build.mk || return 1
+	./configure \
+		--prefix="${inst_prefix}" \
+		--with-ld=ld.gold || return 1
+	make || return 1
+}
+
+dev() {
+	depends="$dev_depends"
+	cd "$_builddir"
+	pkgdesc="Packages necessary for general ghc development"
+	install -Dm644 LICENSE "$subpkgdir/usr/share/licenses/$subpkgname/LICENSE" || return 1
+}
+
+# Note, -nopie due to this bug, and must remain until fixed.
+# https://ghc.haskell.org/trac/ghc/ticket/9007
+package() {
+	cd "$_builddir"
+	make -j1 DESTDIR="$pkgdir" install || return 1
+	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
+	perl -pi -e 's/.*C compiler link flags.*/ \(\"C compiler link flags\"\, \"-nopie\"\)\,/' "$(find $pkgdir -name settings -type f)"
+}
+md5sums="c185b8a1f3e67e43533ec590b751c2ff  ghc-8.0.1-src.tar.xz"
+sha256sums="90fb20cd8712e3c0fbeb2eac8dab6894404c21569746655b9b12ca9684c7d1d2  ghc-8.0.1-src.tar.xz"
+sha512sums="5fa69fd0f7a639a10221a35e16c30b00e801644fcb8581903d3e215ecc0b3bd67960fc07a23d84d083b25e17024c69824fc21925cf82c26d8b36ee6c1fc9d28d  ghc-8.0.1-src.tar.xz"
-- 
2.8.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Thu Jul 14 2016 - 21:53:21 GMT