summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 858674d28cd7293640606db8c536651f40074ae8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# Maintainer:  Tristan Webb <tristan@fpcomplete.com>
pkgname=haskell-stack-git
_pkgname=stack
pkgver=1.0.2.r2.gdca69c6
pkgrel=1
pkgdesc="The Haskell Tool Stack"
arch=('i686' 'x86_64')
url="https://www.github.com/commercialhaskell/stack"
license=('BSD3')
depends=('libtinfo')
makedepends=('gcc' 'stack')
optdepends=('docker: Use Docker images to build your project in a temporary container')
provides=('stack')
conflicts=('stack')
# install=
source=("${_pkgname}::git+https://github.com/commercialhaskell/stack.git")
md5sums=('SKIP')


prepare() {
  STACK_ROOT=$srcdir
  cd "$srcdir/${_pkgname}"
  stack setup
}

build() {
  STACK_ROOT=$srcdir
  cd "$srcdir/${_pkgname}"
  pwd
  stack build --no-system-ghc
}

check() {
  STACK_ROOT=$srcdir
  cd "$srcdir/${_pkgname}"
  stack test stack:test:stack-test
}

package() {
  cd "$srcdir/${_pkgname}"
  BIN_DIR=`stack path | grep "local-install-root" | cut -d ' ' -f2`/bin
  STACK_BIN=$BIN_DIR/stack
  install -Dm755 $STACK_BIN "$pkgdir/usr/bin/stack"
  BASH_COMPLETION_DIR=etc/bash_completion.d
  mkdir -p $pkgdir/$BASH_COMPLETION_DIR
  $BIN_DIR/stack --bash-completion-script /usr/bin/stack >$pkgdir/$BASH_COMPLETION_DIR/stack
}

pkgver() {
cd "${srcdir}/${_pkgname}"
  git describe --long | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

# vim:set ts=2 sw=2 et: