summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD26
1 files changed, 20 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index f87765a8833b..cc07574f17fa 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -4,21 +4,35 @@
pkgname=ccat
pkgver=1.1.0
-pkgrel=3
+pkgrel=4
pkgdesc="Colorizes output for cat."
arch=('any')
url="https://github.com/jingweno/ccat"
-license=('CUSTOM')
-makedepends=('go' 'git')
+license=('MIT')
+makedepends=('go')
conflicts=('ccat-git' 'ccrypt')
-options=('!strip' '!emptydirs')
source=("${url}/archive/v${pkgver}.tar.gz")
sha256sums=('b02d2c8d573f5d73595657c7854c9019d3bd2d9e6361b66ce811937ffd2bfbe1')
+prepare() {
+ cd "${pkgname}-${pkgver}"
+ go mod init "${url#https://}" # strips https:// from URL
+ go mod tidy
+}
+
build() {
cd "${pkgname}-${pkgver}"
- msg2 'Building...'
- ./script/build
+ 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}-${pkgver}"
+ go test ./...
}
package() {