path: root/PKGBUILD
diff options
authorPhil Ruffwind2017-08-27 17:32:26 -0400
committerPhil Ruffwind2017-08-27 19:14:03 -0400
commit98e9e09c6e3ca234bca6411f000fafad2c6087df (patch)
treec05061815e1a0c6e15b56a5f4f764679445b5464 /PKGBUILD
parent6fc57c8a7d9e140adb72f3f33b2e7718f99a7bb8 (diff)
TL;DR: Make sure your BUILDDIR has at least 8 GiB of space. Switched from cabal to stack because cabal lacks isolation. Cabal uses the global package database, so linking is affected by what packages the user has installed at the time of build. One can't exactly ignore the global database because the boot packages are needed. One could ask for all the haskell-* system packages to be installed, but that's a lot of tedious bookkeeping and we still have to deal with the packages that aren't available through pacman, which would be stuck inside the sandbox (unless one could somehow statically link those libraries and dynamically link the system packages). All in all, building using cabal sandboxes has become too complicated due to the presence of dynamic-only system libraries in Arch. Stack works out to be a bit simpler now, even though it involves reinstalling ghc, incurring a dependency on stack, and having a large BUILDDIR. Oh well.
Diffstat (limited to 'PKGBUILD')
1 files changed, 12 insertions, 18 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 82bfbed7097..f8e0bfbf4a3 100644
@@ -1,34 +1,28 @@
# Maintainer: Phil Ruffwind <>
pkgdesc="A wiki backed by a git, darcs, or mercurial filestore"
arch=(i686 x86_64)
+depends=(gmp zlib)
optdepends=("git: git support" "mercurial: mercurial support")
-makedepends=(ghc cabal-install)
+makedepends=(ncurses5-compat-libs stack)
build() {
+ if [ `df -P "$srcdir" | awk 'NR==2 {print $4}'` -lt 8388608 ]; then
+ echo >&2 "Error: need at least 8GiB of space in $srcdir"
+ return 1
+ fi
cd "$srcdir/$pkgname-$pkgver"
- cabal sandbox init
- cabal --require-sandbox update
- cabal --require-sandbox install \
- --force-reinstalls --reinstall --only-dependencies --enable-tests
- cabal --require-sandbox configure --prefix=/usr --enable-tests --ghc-options=-rtsopts
- cabal --require-sandbox build
-check() {
- cd "$srcdir/$pkgname-$pkgver"
- cabal --require-sandbox test
+ stack --stack-root "$srcdir/.stack" --install-ghc build --ghc-options=-rtsopts
package() {
cd "$srcdir/$pkgname-$pkgver"
- cabal --require-sandbox copy --destdir="$pkgdir"
+ stack --stack-root "$srcdir/.stack" install --local-bin-path "$pkgdir/usr/bin"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"