#-*-mode: Shell-script; coding: utf-8;-*- # Maintainer: Mitch Tishmack # # Build/bootstrap ghc similarly to the go package. # Caveat: bootstrapping isn't a commonly tested piece of ghc. pkgname=ghc-bootstrap pkgver=8.0.1 pkgrel=0 pkgdesc="The Glasgow haskell compiler (bootstrapped)" arch="x86_64 armhf" license="custom:bsd3" url='https://github.com/mitchty/alpine-linux-ghc-bootstrap' depends="bash libffi musl zlib gcc binutils-gold llvm3.7" install="" subpackages="" makedepends="" source=" http://dev.alpinelinux.org/archive/ghc-bootstrap/ghc-$pkgver-x86_64-unknown-linux-musl.tar.xz http://dev.alpinelinux.org/archive/ghc-bootstrap/ghc-$pkgver-arm-unknown-linux-musleabihf.tar.xz " # The bootstrap process uses docker to build ghc from a debian glibc host # then upload the bootstrap compiler to where that source url is. # # Ensure that docker is running prior to calling this. # # Note, these docker images are large, ~10G the dockerfiles weren't built # to be small. Once built the containers should likely be removed. snapshot() { local x86_64_tar="ghc-${pkgver}-x86_64-pc-linux-musl.tar.xz" local arm_tar="ghc-${pkgver}-arm-unknown-linux-musleabihf.tar.xz" docker build -t alpine-ghc-bootstrap:x86_64 \ -f bootstrap/x86_64/Dockerfile . docker run -a stdout alpine-ghc-bootstrap:x86_64 \ /bin/cat "/tmp/$x86_64_tar" > $x86_64_tar docker build -t alpine-ghc-bootstrap:armhf \ -f bootstrap/armhf/Dockerfile . docker run -a stdout alpine-ghc-bootstrap:armhf \ /bin/cat "/tmp/$arm_tar" > $arm_tar } package() { cd "$srcdir/$CARCH" install -d "$pkgdir" || return 1 mv usr "$pkgdir" || return 1 settings=$(find "$pkgdir" -name settings -type f) } md5sums="ec34cc6bebe490f765bc73961fd72460 ghc-8.0.1-x86_64-unknown-linux-musl.tar.xz b0901df3305b49b6044607b5ccde5f03 ghc-8.0.1-arm-unknown-linux-musleabihf.tar.xz" sha256sums="b917c130597ed7a5dcf2d387c1b598b088f644566fc47f95d859a03a55529bd2 ghc-8.0.1-x86_64-unknown-linux-musl.tar.xz 54d5e8067b087b1d426e01469162749f1f2c417dc2b8b0f6577acbf0c19aba5e ghc-8.0.1-arm-unknown-linux-musleabihf.tar.xz" sha512sums="4214ab4b3431c695b91429de6a7359cd607c4ca2d04e51afa111757da41b97912d46d3b4b251b717e175baf11186023c133af1ce1d5b95299bd34a85dd9f40b3 ghc-8.0.1-x86_64-unknown-linux-musl.tar.xz ab920e198a2c779e8ad3f6e3f9e9485c8742254c5a914875a6cd106957bb6e0720e90707aabe822295535922d55fc66898660bf7cbf8a7c88c231eceafe358e4 ghc-8.0.1-arm-unknown-linux-musleabihf.tar.xz"