Mail archive
alpine-aports

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

From: Mitch Tishmack <mitch.tishmack_at_gmail.com>
Date: Sun, 15 May 2016 22:30:17 -0500

---
 testing/ghc/APKBUILD | 106 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 106 insertions(+)
 create mode 100755 testing/ghc/APKBUILD
diff --git a/testing/ghc/APKBUILD b/testing/ghc/APKBUILD
new file mode 100755
index 0000000..bf4ac0a
--- /dev/null
+++ b/testing/ghc/APKBUILD
_at_@ -0,0 +1,106 @@
+#-*-mode: Shell-script; coding: utf-8;-*-
+# Maintainer: Mitch Tishmack <mitch.tishmack_at_gmail.com>
+pkgname=ghc
+pkgdesc="The Glasgow haskell compiler 8.0.1 (git)"
+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
+# ghc-llvm-X.Y 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 ghc-llvm"
+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_CC_OPTS         += -fPIC" >> mk/build.mk || return 1
+	echo "GhcLibHcOpts        += -fPIC" >> mk/build.mk || return 1
+	echo "GhcStage2HcOpts     += -fllvm" >> 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 \
+		--with-llc=/usr/lib/ghc/llc-3.7 \
+		--with-opt=/usr/lib/ghc/opt-3.7 || 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="94da3386c0de519eeea37586edd90187  ghc-8.0.1-src.tar.xz"
+sha256sums="eee2339f6f9cff50c2232306a491139c97730d8f31e1c02ba9d3284384cf3e66  ghc-8.0.1-src.tar.xz"
+sha512sums="412412dee67e081fa8fdaa0fed79bce914e61e26f7fe5042fc942b21982c9189b3ea1b9d2c5e11b951a1c27ceaa92b69e22f9999a414385cfb6981ffcb0a01a3  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 Sun May 15 2016 - 22:30:17 GMT