summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 30970296459f9b4f7a76a244ef645af06cf227f9 (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
# Maintainer: Jonne Haß <me@jhass.eu>
pkgname=shards-git
pkgver=v0.17.3.r2.geac9adf
pkgrel=1
pkgdesc="The package manager for the Crystal language (git version)"
arch=('x86_64' 'aarch64')
url="https://github.com/crystal-lang/shards"
license=('Apache')
conflicts=('shards')
provides=('shards')
depends=('libyaml' 'git' 'libevent' 'gc')
optdepends=('fossil')
makedepends=('crystal')
checkdepends=('fossil')
source=("git+https://github.com/crystal-lang/shards.git")

pkgver() {
  cd "$srcdir/${pkgname/-git/}"
  ( set -o pipefail
    git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
    printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
  )
}

build() {
  cd "${pkgname/-git/}"

  make CRYSTAL_OPTS="--release" 
}

check() {
  cd "${pkgname/-git/}"
  ./bin/shards install
  make test
}

package() {
  cd "${pkgname/-git/}"
  
  make install PREFIX="$pkgdir/usr"
  install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}
sha256sums=('SKIP')