summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: baf054483ce85be40a7d2ec5c5186dda22d92d84 (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
# Maintainer: Gesh <gesh@gesh.uni.cx>
# Contributor: Dino Morelli <dino@ui3.info>

pkgname=hlint-static-git
pkgver=3.8.r57.g2a789a94
pkgrel=1
pkgdesc='Haskell source code suggestions'
arch=('x86_64')
url="https://github.com/ndmitchell/hlint"
license=('LicenseRef-BSD-3-Clause')
makedepends=('git' 'cabal-install')
optdepends=('haskell-apply-refact: automatically apply suggested refactorings')
depends=('gmp')
provides=('hlint')
conflicts=('hlint' 'hlint-bin')
source=("${pkgname}::git+${url}")
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 --prefix=/usr --docdir=/usr/share/doc/$pkgname
    cabal build --offline
}

check() {
    cd "$pkgname"
    cabal run -- hlint --test
}

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