summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorAdrian Perez de Castro2019-02-05 19:55:58 +0200
committerAdrian Perez de Castro2019-02-05 19:55:58 +0200
commite3d91ff8453fdc29a2ff28c926ea6f710e9c15d0 (patch)
treee2b591161426b5db8f35dd519744eb2025f51517 /PKGBUILD
parent872fb794c75f679803d50c510d797c4326b2d203 (diff)
downloadaur-e3d91ff8453fdc29a2ff28c926ea6f710e9c15d0.tar.gz
Package uses Go 1.11 modules, bring the build into the future
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD35
1 files changed, 24 insertions, 11 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6f96077bf7e3..768c96a944aa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,31 +1,44 @@
# Maintainer: Adrian Perez de Castro <aperez@igalia.com>
pkgname=gomuks-git
pkgdesc='A terminal based Matrix client written in Go'
-pkgver=r270.2fc3378
+pkgver=0.r280
pkgrel=1
url='https://github.com/tulir/gomuks'
license=(GPL3)
arch=(x86_64 i686)
depends=(glibc)
-makedepends=(go git)
+makedepends=(go-pie git)
provides=("${pkgname%-git}")
conflicts=("${provides[@]}")
+source=("${pkgname}::git+${url}")
+sha512sums=(SKIP)
-_gopkg='maunium.net/go/gomuks'
+prepare () {
+ cd "${pkgname}"
+
+ # The Go modules index has some replacements to use locally checked
+ # out modules; so remove those to make sure "go build" below will
+ # ensure that the correct version is always fetched.
+ sed -i -e '/^replace\s/d' go.mod
+}
pkgver () {
- GOPATH="${srcdir}" go get -v -u -d "${_gopkg}"
- cd "src/${_gopkg}"
- ( set -o pipefail
- git describe --long --tags 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
- printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
- )
+ cd "${pkgname}"
+ echo "0.r$(git rev-list --count HEAD)"
}
build () {
- GOPATH="${srcdir}" go get -v "${_gopkg}"
+ cd "${pkgname}"
+ local curdir=$(pwd)
+ go build \
+ -gcflags "all=-trimpath=${curdir}" \
+ -asmflags "all=-trimpath=${curdir}" \
+ -ldflags "-extldflags ${LDFLAGS}" \
+ .
}
package () {
- install -Dm755 "${srcdir}/bin/gomuks" "${pkgdir}/usr/bin/gomuks"
+ cd "${pkgname}"
+ install -Dm755 gomuks "${pkgdir}/usr/bin/gomuks"
+ install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md"
}