diff options
author | Carter Green | 2021-09-21 09:18:31 -0500 |
---|---|---|
committer | Carter Green | 2021-09-21 09:18:31 -0500 |
commit | 602532e38bf09388df6e6463de9cd3794172bc6f (patch) | |
tree | 679d72d0a38f09066099d7af679aa19006b66df4 | |
parent | c34e3420853c9af81e48c3ea26ec56efd98ccaf1 (diff) | |
download | aur-602532e38bf09388df6e6463de9cd3794172bc6f.tar.gz |
Fix missing go module issue
-rw-r--r-- | .SRCINFO | 5 | ||||
-rw-r--r-- | PKGBUILD | 40 |
2 files changed, 23 insertions, 22 deletions
@@ -1,10 +1,10 @@ pkgbase = ccat-git pkgdesc = Colorizes output for cat. - pkgver = 1.1.0.r31.g7cf6d90 + pkgver = 1.1.0.r33.g27844a7 pkgrel = 1 url = https://github.com/jingweno/ccat arch = any - license = CUSTOM + license = MIT makedepends = go makedepends = git conflicts = ccat @@ -13,4 +13,3 @@ pkgbase = ccat-git sha256sums = SKIP pkgname = ccat-git - @@ -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" } |