aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
authorMitch Tishmack <mitch.tishmack@gmail.com>2017-02-19 14:39:48 -0600
committerTimo Teräs <timo.teras@iki.fi>2017-02-21 13:50:32 +0000
commitf18fdcb41ea0524542edea6c3053197394403919 (patch)
tree6e062815799386e40bb4133a84e1b341db062e37 /testing
parent2e1bdd7a3cdd8f6f393422962e9c0a8bff59210f (diff)
downloadaports-f18fdcb41ea0524542edea6c3053197394403919.tar.bz2
aports-f18fdcb41ea0524542edea6c3053197394403919.tar.xz
testing/ghc: Split ghc into ghc and ghc-dev, add post-install script
While here ensure that strip --strip-unneeded is called on all shared libraries and static archives. This reduces the overall install sizes a skosh. The larger win here, is stripping out the profiled debugging libraries from the default ghc package. If someone wanted to debug now they will need to install ghc-dev to get that RTS and debug libraries. Realistically this only affects those users that are building packages that need to debug. As well as future enhancements to the ghc/haskell which will build packages with profiled libraries as well. But this compromise for the overall install size is preferable to users installing libraries they likely won't need/use and overal bandwidth that consumes. Since we install via make install DESTDIR=... we need to regenerate the ghc pkg db at post install time. [TT: flatten commits]
Diffstat (limited to 'testing')
-rw-r--r--testing/ghc/APKBUILD50
-rwxr-xr-xtesting/ghc/ghc.post-install5
2 files changed, 48 insertions, 7 deletions
diff --git a/testing/ghc/APKBUILD b/testing/ghc/APKBUILD
index f59bfa0219..d1d0bb873e 100644
--- a/testing/ghc/APKBUILD
+++ b/testing/ghc/APKBUILD
@@ -2,10 +2,10 @@
# Maintainer: Mitch Tishmack <mitch.tishmack@gmail.com>
pkgname=ghc
pkgver=8.0.2
-pkgrel=0
+pkgrel=1
pkgdesc="The Glasgow Haskell Compiler"
url="http://haskell.org"
-subpackages="$pkgname-doc"
+subpackages="$pkgname-doc $pkgname-dev"
arch="x86_64"
builddir="$srcdir/$pkgname-$pkgver"
source="http://downloads.haskell.org/~ghc/${pkgver}/ghc-${pkgver}-src.tar.xz
@@ -32,17 +32,42 @@ license="custom:bsd3"
# that version as it greatly simplifies the apkbuild process. The
# apks built on 3.5 will not work on any prior version of alpine linux.
depends="gmp-dev perl gcc>=6.2.1 llvm3.7"
-provides="ghc-bootstrap=$pkgver-r$pkgrel"
-install=""
+provides="ghc-bootstrap=$pkgver-r$pkgrel
+ haskell-cabal=1.24.2.0
+ haskell-bytestring=0.10.8.1
+ haskell-containers=0.5.7.1
+ haskell-deepseq=1.4.2.0
+ haskell-directory=1.3.0.0
+ haskell-filepath=1.4.1.1
+ haskell-ghc=8.0.2
+ haskell-ghc-boot=8.0.2
+ haskell-ghc-boot-th=8.0.2
+ haskell-ghc-prim=0.5.0.0
+ haskell-ghci=8.0.2
+ haskell-haskeline=0.7.3.0
+ haskell-hoopl=3.10.2.1
+ haskell-hpc=0.6.0.3
+ haskell-integer-gmp=1.0.0.1
+ haskell-pretty=1.1.3.3
+ haskell-process=1.4.3.0
+ haskell-rts=1.0
+ haskell-template-haskell=2.11.1.0
+ haskell-terminfo=0.4.0.2
+ haskell-time=1.6.0.1
+ haskell-transformers=0.5.2.0
+ haskell-unix=2.7.2.1
+ haskell-xhtml=3000.2.1
+ "
+install="$pkgname.post-install"
# ghc build dependencies
makedepends="
$depends
autoconf
+ cpio
linux-headers
musl-dev
ncurses-dev
- gmp-dev
libffi-dev
zlib-dev
binutils-dev
@@ -51,8 +76,6 @@ makedepends="
ghc-bootstrap
"
-_ghc_build_tmp="$builddir/tmp"
-
build() {
cd "$builddir"
cp mk/build.mk.sample mk/build.mk || return 1
@@ -82,12 +105,25 @@ doc() {
package() {
cd "$builddir"
make -j1 DESTDIR="$pkgdir" install || return 1
+ # Can't do a full strip on archives.
+ find "$pkgdir" -type f \( -name "*.so" -o -name "*.a" \) -exec strip --strip-unneeded {} \;
+ find "$pkgdir/usr/lib/ghc-$pkgver/bin" -type f -exec strip {} \;
paxmark -m "$pkgdir/usr/lib/ghc-$pkgver/bin/ghc"
paxmark -m "$pkgdir/usr/lib/ghc-$pkgver/bin/ghc-iserv"
paxmark -m "$pkgdir/usr/lib/ghc-$pkgver/bin/ghc-iserv-dyn"
paxmark -m "$pkgdir/usr/lib/ghc-$pkgver/bin/ghc-iserv-prof"
}
+dev() {
+ # Like debian, we split apart the profiled archives/etc...
+ # This drastically reduces the install size of the ghc pkg.
+ cd "${pkgdir}" || return 1
+ install -dm755 "${subpkgdir}" || return 1
+ local PFILES=$(find . \( -type f -o -type l \) \( -name "*.p_*" -o -name "lib*_p.a" \))
+ echo "${PFILES}" | cpio -pamVd "${subpkgdir}" || return 1
+ echo "${PFILES}" | xargs rm -fr || return 1
+}
+
sha512sums="58ea3853cd93b556ecdc4abd0be079b2621171b8491f59004ea4e036a4cba4470aaafe6591b942e0a50a64bdc47540e01fe6900212a1ef7087850112d9bfc5ef ghc-8.0.2-src.tar.xz
128eece1b103f286b915a1563a628b638f03509d18cdb2e6510957d26eb56a4ae66e33c946c0e6c2aac2f947b9646dc88c1f390c69ea21f9dc64e0bef4de4e97 0001-rm-ghc-pwd.patch
6f90b0de1e34c286e54ef14514ffabe17f9012fbc5448b4aacb3687aac065942e0a3a2c1c57b6338121140369a8870b4ce2a6b355c83c43344d4de8909a253a4 0002-Correct-issue-with-libffi-and-glibc.patch
diff --git a/testing/ghc/ghc.post-install b/testing/ghc/ghc.post-install
new file mode 100755
index 0000000000..43a1034bf6
--- /dev/null
+++ b/testing/ghc/ghc.post-install
@@ -0,0 +1,5 @@
+#!/bin/sh
+# Force ghc-pkg to recache the base installed packages. Necessary as we
+# did make install DESTDIR=... so the cache has invalid locations.
+
+ghc-pkg recache