summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8ff46af973e930fea9857619f1b817fda2828d4b (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@gesh.uni.cx>

pkgname=stack-clean-old-static-git
_pkgname="${pkgname%-static-git}"
pkgver=0.5.1.r1.g899235a
pkgrel=4
pkgdesc='Manage Haskell stack snapshot builds and ghc versions (static build)'
arch=('i686' 'x86_64')
url="https://github.com/juhp/${_pkgname}"
license=('BSD-3-Clause')
provides=("$_pkgname=${pkgver%%.r*}")
conflicts=("$_pkgname")
depends=('gmp' 'ncurses')
makedepends=('git' 'stack')
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"
  stack config set resolver lts-22.22 # ghc-9.6.5
}

build() {
  cd "$pkgname"
  stack build
}

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

package() {
  cd "$pkgname"
  stack install --local-bin-path "$pkgdir/usr/bin"
  install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}

# vim:set ts=2 sw=2 et