diff options
-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() { |