summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wagie2020-07-04 10:56:30 -0600
committerMark Wagie2020-07-04 10:56:30 -0600
commit59f914aca7d53f55c4c151892a2ff450fc016848 (patch)
tree571af561fedd699d083404145fe499f9c30d6ee6
parent350933be84fe5f44fd27bbe5a365e44ed38a50b0 (diff)
downloadaur-59f914aca7d53f55c4c151892a2ff450fc016848.tar.gz
use local GOPATH
-rw-r--r--PKGBUILD11
1 files changed, 11 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 6512baec1ffd..43178c6c61bb 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,6 +11,14 @@ optdepends=('bash-completion')
source=("$pkgname-$pkgver.tar.gz::https://github.com/dim-an/cod/archive/v$pkgver.tar.gz")
sha256sums=('6f773358f363141dcd1bbdffaaa5dea0a40ae7a84d5fc55fd453302de8493c20')
+prepare() {
+ # Prevent creation of a `go` directory in one's home.
+ # Sometimes this directory cannot be removed with even `rm -rf` unless
+ # one becomes root or changes the write permissions.
+ export GOPATH="$srcdir/gopath"
+ go clean -modcache
+}
+
build() {
cd "$pkgname-$pkgver"
go build \
@@ -20,6 +28,9 @@ build() {
-modcacherw \
-ldflags "-extldflags \"${LDFLAGS}\"" \
-o "$pkgname" .
+
+ # Clean now to ensure makepkg --clean works
+ go clean -modcache
}
package() {