summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-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() {