summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorCarter Green2021-09-21 09:18:31 -0500
committerCarter Green2021-09-21 09:18:31 -0500
commit602532e38bf09388df6e6463de9cd3794172bc6f (patch)
tree679d72d0a38f09066099d7af679aa19006b66df4 /PKGBUILD
parentc34e3420853c9af81e48c3ea26ec56efd98ccaf1 (diff)
downloadaur-602532e38bf09388df6e6463de9cd3794172bc6f.tar.gz
Fix missing go module issue
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD40
1 files changed, 21 insertions, 19 deletions
diff --git a/PKGBUILD b/PKGBUILD
index bd6c378d0248..29b7c8297534 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,12 +3,12 @@
_pkgname=ccat
pkgname=ccat-git
-pkgver=1.1.0.r31.g7cf6d90
+pkgver=1.1.0.r33.g27844a7
pkgrel=1
pkgdesc="Colorizes output for cat."
arch=('any')
url="https://github.com/jingweno/ccat"
-license=('CUSTOM')
+license=('MIT')
makedepends=('go' 'git')
conflicts=('ccat' 'ccrypt')
source=("${_pkgname}::git+${url}.git")
@@ -18,28 +18,30 @@ pkgver() {
git -C "${_pkgname}" describe --long --tags | sed "s/-/.r/;s/-/./g;s/^v//"
}
-check() {
- cd "${srcdir}/${_pkgname}"
- ./bin/test
+prepare() {
+ cd "${_pkgname}"
+ go mod init "${url#https://}" # strips https:// from URL
+ go mod tidy
}
build() {
- cd "${srcdir}/${_pkgname}"
- mkdir -p "${srcdir}/go"
- export GOPATH="${srcdir}/go"
- msg2 "Getting dependencies..."
- go get github.com/mattn/go-colorable
- go get github.com/spf13/cobra
- go get github.com/mattn/go-isatty
- go get github.com/sourcegraph/syntaxhighlight
- msg2 "Building..."
- ./bin/build
+ cd "${_pkgname}"
+ export CGO_CPPFLAGS="${CPPFLAGS}"
+ export CGO_CFLAGS="${CFLAGS}"
+ export CGO_CXXFLAGS="${CXXFLAGS}"
+ export CGO_LDFLAGS="${LDFLAGS}"
+ export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
+ go build -o ccat .
+}
+
+check() {
+ cd "${_pkgname}"
+ go test ./...
}
package() {
- cd "${srcdir}/${_pkgname}"
- install -Dm755 "bin/${_pkgname}" "$pkgdir/usr/bin/${_pkgname}"
- mkdir -p "$pkgdir/usr/share/licenses/${_pkgname}"
- install -m 0644 LICENSE "$pkgdir/usr/share/licenses/${_pkgname}/"
+ cd "${_pkgname}"
+ install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname"
+ install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE"
}