diff options
author | Daniel Martí | 2021-07-26 11:01:38 +0100 |
---|---|---|
committer | Daniel Martí | 2021-07-26 11:01:38 +0100 |
commit | 512d946290226631da34b61204323b58f4bc3bcd (patch) | |
tree | fce9690333e3e50d9175929af137975fad27b5eb | |
parent | cfc74a1a958fa7b89f7c24de4136d16b47d15e46 (diff) | |
download | aur-512d946290226631da34b61204323b58f4bc3bcd.tar.gz |
update to 2.3.0
While at it, revamp the PKGBUILD as per the latest Go guidelines.
We also build from a tar.gz archive with a checksum, which should be
slightly faster and more secure.
-rw-r--r-- | .SRCINFO | 7 | ||||
-rw-r--r-- | PKGBUILD | 34 |
2 files changed, 27 insertions, 14 deletions
@@ -1,6 +1,6 @@ pkgbase = xurls pkgdesc = Extract urls from plain text - pkgver = 2.2.0 + pkgver = 2.3.0 pkgrel = 1 url = https://github.com/mvdan/xurls arch = i686 @@ -8,8 +8,7 @@ pkgbase = xurls license = BSD makedepends = git makedepends = go - source = git+https://github.com/mvdan/xurls#tag=v2.2.0 - sha1sums = SKIP + source = xurls-2.3.0::https://github.com/mvdan/xurls/archive/refs/tags/v2.3.0.tar.gz + sha256sums = c4a5451eab432f6ac4c033fc197b7ceb947910bc1eae0db750b7c5c5ad703c46 pkgname = xurls - @@ -1,24 +1,38 @@ # Maintainer: Daniel Martí <mvdan@mvdan.cc> pkgname=xurls -_name="${pkgname}" -pkgver=2.2.0 +pkgver=2.3.0 pkgrel=1 pkgdesc="Extract urls from plain text" -url="https://github.com/mvdan/${_name}" -license=('BSD') arch=('i686' 'x86_64') +url="https://github.com/mvdan/${pkgname}" +license=('BSD') makedepends=('git' 'go') -source=("git+${url}#tag=v${pkgver}") -sha1sums=('SKIP') +source=("$pkgname-$pkgver::${url}/archive/refs/tags/v${pkgver}.tar.gz") +sha256sums=('c4a5451eab432f6ac4c033fc197b7ceb947910bc1eae0db750b7c5c5ad703c46') + +prepare(){ + cd "$pkgname-$pkgver" + mkdir -p build/ +} build() { - cd "${srcdir}/${_name}" - GO111MODULES=on go build -ldflags='-w -s' ./cmd/${_name} + cd "$pkgname-$pkgver" + 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 build ./cmd/... +} + +check() { + cd "$pkgname-$pkgver" + go test ./... } package() { - cd "${srcdir}/${_name}" - install -Dm755 "${_name}" "${pkgdir}/usr/bin/${_name}" + cd "$pkgname-$pkgver" + install -Dm755 build/$pkgname "$pkgdir"/usr/bin/$pkgname install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" } |