summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAdam Goldsmith2024-03-23 16:52:45 -0400
committerAdam Goldsmith2024-03-23 16:52:45 -0400
commit1c59f3929770c1f41011d3672758e2d2fd6424c9 (patch)
treec521c728a84a28c92d5983502c58b3f0a98ea480 /PKGBUILD
parent37ed2c175e512f5f83c4787106569976ce1e131d (diff)
downloadaur-rtlamr-collect-git.tar.gz
Update to use current Go package guidelines
per https://wiki.archlinux.org/title/Go_package_guidelines
Diffstat (limited to 'PKGBUILD')
-rwxr-xr-xPKGBUILD40
1 files changed, 19 insertions, 21 deletions
diff --git a/PKGBUILD b/PKGBUILD
index ad3378abcb89..741152165818 100755
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,51 +1,49 @@
# Maintainer: Adam Goldsmith <contact@adamgoldsmith.name>
-_pkgname=rtlamr-collect
pkgname=rtlamr-collect-git
-pkgver=r31.7951486
+_pkgname=${pkgname%%-git}
+pkgver=1.0.3.r0.g7951486
pkgrel=1
-pkgdesc=" Data aggregation for rtlamr."
+pkgdesc="Data aggregation for rtlamr."
arch=('any')
url="https://github.com/bemasher/rtlamr-collect"
-source=("git+https://github.com/bemasher/rtlamr-collect.git")
-md5sums=('SKIP')
license=('AGPL3')
depends=('rtl-sdr')
makedepends=('go' 'git')
provides=('rtlamr-collect')
conflicts=('rtlamr-collect')
-options=('!strip' '!emptydirs')
-_gourl=github.com/bemasher/rtlamr-collect
+source=("git+https://github.com/bemasher/rtlamr-collect.git")
+md5sums=('SKIP')
pkgver() {
- cd $_pkgname
- printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ cd "$_pkgname"
+ git describe --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare(){
- mkdir -p gopath/src/${_gourl%/*}
- ln -rTsf $_pkgname gopath/src/$_gourl
+ cd "$_pkgname"
+ mkdir -p build
}
build() {
- export GOPATH="$srcdir"/gopath
- cd gopath/src/$_gourl
- go install \
- -trimpath \
- -modcacherw \
- -ldflags "-extldflags $LDFLAGS" \
- -v ./...
+ cd "$_pkgname"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build -o build .
}
check() {
- export GOPATH="$srcdir"/gopath
- cd gopath/src/$_gourl
+ cd "$_pkgname"
go test ./...
}
package() {
- install -p -Dm755 gopath/bin/rtlamr-collect "$pkgdir/usr/bin/rtlamr-collect"
+ cd "$_pkgname"
+ install -p -Dm755 build/$_pkgname "$pkgdir"/usr/bin/$_pkgname
}
# vim:set ts=2 sw=2 et: