diff options
author | Mark Wagie | 2020-07-04 10:56:30 -0600 |
---|---|---|
committer | Mark Wagie | 2020-07-04 10:56:30 -0600 |
commit | 59f914aca7d53f55c4c151892a2ff450fc016848 (patch) | |
tree | 571af561fedd699d083404145fe499f9c30d6ee6 | |
parent | 350933be84fe5f44fd27bbe5a365e44ed38a50b0 (diff) | |
download | aur-59f914aca7d53f55c4c151892a2ff450fc016848.tar.gz |
use local GOPATH
-rw-r--r-- | PKGBUILD | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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() { |