summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 5832afea259302af4fc4e058e39446d00170226b (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
# Maintainer: fzerorubigd <fzero@rubi.gd>

pkgname=goimpl-git
pkgver=39.20220214
pkgrel=1
pkgdesc="impl generates method stubs for implementing an interface."
arch=('i686' 'x86_64')
url="https://github.com/josharian/impl"
license=('MIT')
depends=('glibc')
makedepends=('go' 'git')
source=('git+https://github.com/josharian/impl')
md5sums=('SKIP')

pkgver() {
    cd "${srcdir}/impl"
    printf "%s.%s" "$(git rev-list --count HEAD)" "$(git log -1 --format=%cd --date=short | tr -d -)"
}

prepare() {
    mkdir -p "${srcdir}/src/github.com/josharian/"
    ln -sf "${srcdir}/impl" "${srcdir}/src/github.com/josharian/"
}

build() {
    export GOPATH="${srcdir}"
    cd "${srcdir}/src/github.com/josharian/impl"
    go get -v
    go build -o impl
}

package() {
    cd "${srcdir}/src/github.com/josharian/impl"
    install -Dm755 impl "${pkgdir}/usr/bin/impl"
}