summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Martí2021-07-26 11:01:38 +0100
committerDaniel Martí2021-07-26 11:01:38 +0100
commit512d946290226631da34b61204323b58f4bc3bcd (patch)
treefce9690333e3e50d9175929af137975fad27b5eb
parentcfc74a1a958fa7b89f7c24de4136d16b47d15e46 (diff)
downloadaur-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--.SRCINFO7
-rw-r--r--PKGBUILD34
2 files changed, 27 insertions, 14 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b09c773cb666..dfac991959c1 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -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
-
diff --git a/PKGBUILD b/PKGBUILD
index eb6c0a51bcd0..a782575c17ae 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -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"
}