summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: d6fd7885d8cf252a0a5345246ecb02e95da449f2 (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
# Maintainer: fuero <fuerob@gmail.com>

_branch=master
_pkgname=git-whoknows
# renovate: pkgName=https://github.com/Arrowbox/git-whoknows depName=git-whoknows-git
_commit=fd6b9c2f6e1c07dc8883ca241e985fa0baf2185a
pkgname="${_pkgname}-git"
pkgver=r33.fd6b9c2
pkgrel=1
pkgdesc="Describes who is likely familiar with a file"
arch=('any')
url="https://github.com/Arrowbox/git-whoknows"
license=('GPL3')
provides=(${_pkgname})
conflicts=(${_pkgname})
depends=('git')
makedepends=('rust')
source=(
	"${pkgname}::git+${url}#branch=${_branch}"
    cargo-update.patch
)
sha256sums=('SKIP'
            'ac19bf91ff544d84fd1553362d79992ee7f910a9ddabac57a2374ac80805d2ac')

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


prepare() {
    cd "${srcdir}/${pkgname}"
    patch -p1 < ${srcdir}/cargo-update.patch
}

build() {
    cd "${srcdir}/${pkgname}"
    cargo build --release
}

check() {
    cd "${srcdir}/${pkgname}"
    cargo test --release
}

package() {
    install -Dm0755 "${srcdir}/${pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
}