Mail archive
alpine-aports

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

From: Mitch Tishmack <mitch.tishmack_at_gmail.com>
Date: Tue, 1 Mar 2016 19:28:56 -0600

From: Mitch Tishmack <mitch.tishmack_at_gmail.com>

---
 testing/ghc/APKBUILD | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 87 insertions(+)
 create mode 100755 testing/ghc/APKBUILD
diff --git a/testing/ghc/APKBUILD b/testing/ghc/APKBUILD
new file mode 100755
index 0000000..284ed52
--- /dev/null
+++ b/testing/ghc/APKBUILD
_at_@ -0,0 +1,87 @@
+#-*-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"
+apkgver=7.10.3b
+pkgver=$(echo ${apkgver} | tr -d '[a-z]')
+pkgrel=1
+url="http://haskell.org"
+subpackages="$pkgname-doc $pkgname-dev"
+arch="x86_64"
+# 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-3.5"
+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
+	"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+
+# ghc source
+source="
+	https://www.haskell.org/ghc/dist/$pkgver/ghc-$apkgver-src.tar.bz2
+	"
+
+_ghc_build_tmp="$_builddir/tmp"
+
+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 "GhcRtsCcOpts        += -fPIC" >> mk/build.mk || return 1
+	echo "INTEGER_LIBRARY      = integer-gmp2" >> mk/build.mk || return 1
+	echo "BeConservative       = YES" >> mk/build.mk || return 1
+	echo "GhcLibWays           = v p dyn" >> mk/build.mk || return 1
+	echo "BUILD_DOCBOOK_HTML   = NO" >> mk/build.mk  || return 1
+	echo "BUILD_DOCBOOK_PS     = NO" >> mk/build.mk || return 1
+	echo "BUILD_DOCBOOK_PDF    = NO" >> mk/build.mk || return 1
+	./configure \
+		--prefix=/usr \
+		--sysconfdir=/etc \
+		--mandir=/usr/share/man \
+		--infodir=/usr/share/info \
+		--localstatedir=/var \
+		--with-ld=ld.gold \
+		--with-llc=/usr/lib/ghc/llc-3.5 \
+		--with-opt=/usr/lib/ghc/opt-3.5 || 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
+}
+
+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)"
+}
-- 
2.7.0
---
Unsubscribe:  alpine-aports+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-aports+help_at_lists.alpinelinux.org
---
Received on Tue Mar 01 2016 - 19:28:56 GMT