summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1f9e847e2eaf0e7c24ad32982493da8838598e5c (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
# Maintainer: gesh <gesh AT gesh DOT uni DOT cx>

pkgname=ghcid-static-git
_pkgname="${pkgname%-static-git}"
pkgver=0.8.9.r1.gb7dc5c4
pkgrel=2
pkgdesc="GHCi based bare bones IDE"
arch=('i686' 'x86_64')
url="https://github.com/ndmitchell/$_pkgname"
license=('BSD-3-Clause')
provides=("$_pkgname")
depends=('gmp')
makedepends=('git' 'cabal-install')
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')

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

prepare() {
  cd "$pkgname"
  cabal update
  cabal build --only-dependencies
}

build() {
  cd "$pkgname"
  cabal configure \
    -O --jobs --prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests
  cabal build --offline
}

check() {
  cd "$pkgname"
  cabal test
}

package() {
  cd "$pkgname"
  mkdir -p "$pkgdir/usr/bin"
  cabal install --install-method=copy --installdir "$pkgdir/usr/bin"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}