diff --git a/extras/PKGBUILD b/extras/PKGBUILD index 8baa1b9..7a6ad4b 100644 --- a/extras/PKGBUILD +++ b/extras/PKGBUILD @@ -1,21 +1,34 @@ # Maintainer: aditya-K2 +# Contributor: Luis Martinez + pkgname=gomp-git -pkgver=0.1 +pkgver=r196.0db49ca pkgrel=1 pkgdesc='MPD client inspired by ncmpcpp written in GO.' -arch=('any') +arch=('x86_64') url="https://github.com/aditya-K2/gomp" -license=('GPL') -makedepends=('go') -source=("https://github.com/aditya-K2/gomp/archive/refs/heads/master.zip") +license=('GPL3') +makedepends=('git' 'go') +source=("$pkgname::git+$url") sha256sums=('SKIP') +pkgver() { + cd "$pkgname" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +prepare() { + cd "$pkgname" + mkdir -p build +} + build() { - cd "${pkgname%-git}-master" - go build + export GOFLAGS="-buildmode=pie -trimpath -mod=readonly -modcacherw" + cd "$pkgname" + go build -o build } package() { - cd "${pkgname%-git}-master" - install -Dm 655 gomp -t "${pkgdir}/usr/bin" + cd "$pkgname" + install -D build/gomp -t "$pkgdir/usr/bin/" }