summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ac9cccd639cae18dbb4fb99744a4eeecaea3e771 (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
55
56
57
# Maintainer: 0x9fff00 <0x9fff00+git@protonmail.ch>
# Contributor: Alexander Schmidt <zyeryi@gmail.com>

_name=erd
pkgname=erd-git
pkgver=0.2.1.0.r19.gd18075d
pkgrel=12
pkgdesc='A utility for generating entity-relationship diagrams from plain-text descriptions - git version'
arch=('x86_64')
url="https://github.com/BurntSushi/$_name"
license=('Unlicense')
depends=('ghc-libs' 'haskell-gitrev' 'haskell-graphviz' 'haskell-raw-strings-qq' 'haskell-yaml')
makedepends=('ghc' 'git' 'uusi')
checkdepends=('haskell-tasty' 'haskell-tasty-hunit')
provides=('erd')
conflicts=('erd')
source=("git+$url.git")
sha256sums=('SKIP')
options=('!emptydirs')

pkgver() {
  cd "$_name"

  git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
  cd "$_name"

  # allow bytestring 0.11
  uusi -u bytestring
}

build() {
  cd "$_name"

  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
    --prefix=/usr --docdir="/usr/share/doc/$pkgname" --datasubdir=$pkgname --enable-tests \
    --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
    --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
    --ghc-option='-pie'

  runhaskell Setup build $MAKEFLAGS
}

check() {
  cd "$_name"

  runhaskell Setup test
}

package() {
  cd "$_name"

  runhaskell Setup copy --destdir="$pkgdir"
  rm -f "$pkgdir/usr/share/doc/$pkgname/UNLICENSE"
}