~alpine/aports

2

[alpine-aports] [PATCH 0/4] Add initial port of ghc 8.0.1 to testing for armhf/x86_64

Details
Message ID
<1463369418-51523-1-git-send-email-mitch.tishmack@gmail.com>
Sender timestamp
1463369414
DKIM signature
missing
Download raw message
This patch series adds the following 4 new aports:
- ghc-bootstrap
- ghc-llvm
- ghc
- cabal

ghc-bootstrap is the only apkbuild that is likely be the most questionable. It 
currently uses docker to build a ghc cross compiler that is then used 
by the ghc package to build natively on the correct alpine $CARCH. I
have left in links and checksums that I have validated but this specific
apkbuild would be the one that needs updating based on where bootstrapped
ghc installs end up.

Additionally, due to LLVM not providing a forward or backward guarantee
for generated IR, I compile LLVM 3.7.1 to ensure that system LLVM
upgrades do not affect ghc's ability to produce code on arm.

A better option here would be to have a community/llvm-3.N apk that could
be depended on by packages that cannot reasonably depend on system
llvm without breaking on version upgrades.

Only x86_64 and armhf are supported for now. Adding a new platform
wouldn't be too hard and would mostly mean updating ghc-bootstrap
and ensuring a cross compiled ghc functions to build a native
ghc.

Also include the cabal package tool used to install and build ghc
packages.

Mitch Tishmack (4):
  testing/ghc-llvm new aport
  testing/ghc-bootstrap new aport
  testing/ghc new aport
  testing/cabal new aport

 testing/cabal/APKBUILD                             |  53 +++++++
 testing/cabal/cabal-0001-force-ld.gold.patch       |  10 ++
 testing/ghc-bootstrap/APKBUILD                     |  50 ++++++
 testing/ghc-bootstrap/bootstrap/armhf/Dockerfile   | 154 +++++++++++++++++++
 .../ghc-bootstrap/bootstrap/armhf/bootstrap.patch  | 112 ++++++++++++++
 testing/ghc-bootstrap/bootstrap/armhf/settings     |  32 ++++
 testing/ghc-bootstrap/bootstrap/gmpurl.patch       |  22 +++
 testing/ghc-bootstrap/bootstrap/llvm-3.7.1.sh      |  88 +++++++++++
 testing/ghc-bootstrap/bootstrap/x86_64/Dockerfile  | 143 +++++++++++++++++
 .../ghc-bootstrap/bootstrap/x86_64/bootstrap.patch | 112 ++++++++++++++
 testing/ghc-bootstrap/bootstrap/x86_64/settings    |  32 ++++
 testing/ghc-llvm/APKBUILD                          | 169 +++++++++++++++++++++
 testing/ghc-llvm/llvm-0002-musl-triple.patch       |  90 +++++++++++
 testing/ghc-llvm/llvm-0003-musl-hacks.patch        | 114 ++++++++++++++
 testing/ghc/APKBUILD                               | 106 +++++++++++++
 15 files changed, 1287 insertions(+)
 create mode 100644 testing/cabal/APKBUILD
 create mode 100644 testing/cabal/cabal-0001-force-ld.gold.patch
 create mode 100755 testing/ghc-bootstrap/APKBUILD
 create mode 100644 testing/ghc-bootstrap/bootstrap/armhf/Dockerfile
 create mode 100644 testing/ghc-bootstrap/bootstrap/armhf/bootstrap.patch
 create mode 100644 testing/ghc-bootstrap/bootstrap/armhf/settings
 create mode 100644 testing/ghc-bootstrap/bootstrap/gmpurl.patch
 create mode 100755 testing/ghc-bootstrap/bootstrap/llvm-3.7.1.sh
 create mode 100644 testing/ghc-bootstrap/bootstrap/x86_64/Dockerfile
 create mode 100644 testing/ghc-bootstrap/bootstrap/x86_64/bootstrap.patch
 create mode 100644 testing/ghc-bootstrap/bootstrap/x86_64/settings
 create mode 100755 testing/ghc-llvm/APKBUILD
 create mode 100644 testing/ghc-llvm/llvm-0002-musl-triple.patch
 create mode 100644 testing/ghc-llvm/llvm-0003-musl-hacks.patch
 create mode 100755 testing/ghc/APKBUILD

-- 
2.8.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

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

Details
Message ID
<1463369418-51523-4-git-send-email-mitch.tishmack@gmail.com>
In-Reply-To
<1463369418-51523-1-git-send-email-mitch.tishmack@gmail.com> (view parent)
Sender timestamp
1463369417
DKIM signature
missing
Download raw message
Patch: +106 -0
---
 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
@@ -0,0 +1,106 @@
#-*-mode: Shell-script; coding: utf-8;-*-
# Maintainer: Mitch Tishmack <mitch.tishmack@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@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---

[alpine-aports] [PATCH 4/4] testing/cabal new aport

Details
Message ID
<1463369418-51523-5-git-send-email-mitch.tishmack@gmail.com>
In-Reply-To
<1463369418-51523-1-git-send-email-mitch.tishmack@gmail.com> (view parent)
Sender timestamp
1463369418
DKIM signature
missing
Download raw message
Patch: +63 -0
---
 testing/cabal/APKBUILD                       | 53 ++++++++++++++++++++++++++++
 testing/cabal/cabal-0001-force-ld.gold.patch | 10 ++++++
 2 files changed, 63 insertions(+)
 create mode 100644 testing/cabal/APKBUILD
 create mode 100644 testing/cabal/cabal-0001-force-ld.gold.patch

diff --git a/testing/cabal/APKBUILD b/testing/cabal/APKBUILD
new file mode 100644
index 0000000..2b6a389
--- /dev/null
+++ b/testing/cabal/APKBUILD
@@ -0,0 +1,53 @@
# Maintainer: Mitch Tishmack <mitch.tishmack@gmail.com>
pkgname=cabal
pkgver=1.24.0.0
pkgrel=0
pkgdesc="The Haskell Cabal"
url="http://haskell.org"
arch="x86_64 armhf"
license="bsd3"
depends="musl zlib gmp"
makedepends="ghc ghc-dev binutils-gold chrpath"
install=""
subpackages=""
source="
	https://www.haskell.org/$pkgname/release/$pkgname-install-$pkgver/$pkgname-install-$pkgver.tar.gz
	cabal-0001-force-ld.gold.patch
"
_builddir="$srcdir/$pkgname-install-$pkgver"

prepare() {                         
        cd "$_builddir" || return 1
        for i in $source; do         
                case $i in        
                cabal-*.patch)
                        msg "Applying $i..."         
                        patch -s -p0 -N -i "$srcdir"/$i || return 1
                        ;;
                esac                                           
        done                                                    
}    

build() {
	cd "$_builddir"
	(
		export HOME="$_builddir"
		export NO_DOCUMENTATION=1
		export EXTRA_BUILD_OPTS="--ghc-option=-fPIC"
		./bootstrap.sh || return 1
	) || return 1
}

package() {
	cd "$_builddir"
	install -d "$pkgdir/usr/bin" || return 1
	install -m755 "$_builddir/dist/build/cabal/cabal" "$pkgdir/usr/bin/cabal" || return 1
	chrpath -d "$pkgdir/usr/bin/cabal" || return 1
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" || return 1
}
md5sums="beb998cdc385523935620381abe393f4  cabal-install-1.24.0.0.tar.gz
e64c6868b8696f8d49945900af80b30c  cabal-0001-force-ld.gold.patch"
sha256sums="d840ecfd0a95a96e956b57fb2f3e9c81d9fc160e1fd0ea350b0d37d169d9e87e  cabal-install-1.24.0.0.tar.gz
74a2516bbcb5c7a5a9c8d7633630ce5b3397e160bd0e0c06fd10f104ac08002f  cabal-0001-force-ld.gold.patch"
sha512sums="0bbd217259e6cd953731179e89dd0b9c972e8634c78d1270c9141daf8be4c53f4817812c93bec86c3cbaf5cc3467497137a4d30c0c594cc27204f0e9aebe6830  cabal-install-1.24.0.0.tar.gz
35a9127f9aa5689047fbb3ad8757c3c0a3834c15f90d764edcb9ca24652f271c180458715c447d550f5329c0e2368207502318e4ae31292e593c667eeb79d386  cabal-0001-force-ld.gold.patch"
diff --git a/testing/cabal/cabal-0001-force-ld.gold.patch b/testing/cabal/cabal-0001-force-ld.gold.patch
new file mode 100644
index 0000000..86ed3a3
--- /dev/null
+++ b/testing/cabal/cabal-0001-force-ld.gold.patch
@@ -0,0 +1,10 @@
--- bootstrap.sh.original	2016-02-10 06:45:52.000000000 -0600
+++ bootstrap.sh	2016-03-18 23:28:06.000000000 -0500
@@ -74,6 +74,7 @@
 
 # Fall back to "ld"... might work.
 [ -$LINK- = -""- ] && LINK=ld
+LINK="ld.gold"
 
 # And finally, see if we can compile and link something.
   echo 'int main(){}' | $CC -xc - -o /dev/null ||
-- 
2.8.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---
Reply to thread Export thread (mbox)