summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorrmorgans2020-09-03 07:37:57 +0930
committerGitHub2020-09-03 07:37:57 +0930
commita7d0f5673e729683b6fb76b36e08d21c1257321e (patch)
tree5f6d8d8a6d37f8aac98d74213ee164f562a698ce
parentc263e0d2f363f4348da6d139eae873c3d9a13a29 (diff)
parent688b0ce44bb982d1059824fa3d829430880a35f0 (diff)
downloadaur-a7d0f5673e729683b6fb76b36e08d21c1257321e.tar.gz
Merge pull request #15 from nightuser/master
Change build process to meet Arch's guidelines
-rw-r--r--PKGBUILD26
1 files changed, 14 insertions, 12 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 622e1f96c54..943c78dec64 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,23 +14,25 @@ sha256sums=('bf35d267a28dcace4109c3256f2cd7cb0ca3b8d461d2fbf848db3f65b809befd')
_gopackagepath=github.com/direnv/direnv
-prepare() {
- [[ -f /etc/profile.d/go.sh ]] && source /etc/profile.d/go.sh
- export GOPATH="$srcdir/go"
-
- mkdir -p "$GOPATH/src/$(dirname "$_gopackagepath")"
- mv "$srcdir/$pkgname-$pkgver" "$GOPATH/src/$_gopackagepath"
+build() {
+ cd "$pkgname-$pkgver"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -mod=vendor -modcacherw"
+ go build -o $pkgname
}
-build() {
- export GOPATH="$srcdir/go"
- cd "$GOPATH/src/$_gopackagepath"
- make
+check() {
+ cd "$pkgname-$pkgver"
+ go test -v
+ bash ./test/direnv-test.bash
+ ./test/stdlib.bash
}
package() {
- export GOPATH="$srcdir/go"
- cd "$GOPATH/src/$_gopackagepath"
+ cd "$pkgname-$pkgver"
make install DESTDIR="$pkgdir/usr"
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}