summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 23dc5b8bed6fbfaa264bb44284935491fb3f63e9 (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=godoctor-git
pkgver=520.20211103
pkgrel=1
pkgdesc="Go Doctor - The Golang Refactoring Engine"
arch=('i686' 'x86_64')
url="https://github.com/godoctor/godoctor"
license=('BSD')
depends=('glibc')
makedepends=('go' 'git')
source=('git+https://github.com/godoctor/godoctor')
md5sums=('SKIP')

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

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

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

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