From 9dc6e236688ed7f12ba8e5244034e54270126979 Mon Sep 17 00:00:00 2001 From: Yigit Sever Date: Wed, 23 Oct 2024 09:23:10 +0200 Subject: upgpkg: xq 1.2.5-1 upstream release --- xq/PKGBUILD | 85 +++++++++++++------------------------------------------------ 1 file changed, 18 insertions(+), 67 deletions(-) (limited to 'xq/PKGBUILD') diff --git a/xq/PKGBUILD b/xq/PKGBUILD index 3d7c110..ed49aeb 100644 --- a/xq/PKGBUILD +++ b/xq/PKGBUILD @@ -1,86 +1,37 @@ -# Maintainer: George Rawlinson +# Maintainer: Yigit Sever +# Contributor: George Rawlinson pkgname=xq -pkgver=1.2.3 +pkgver=1.2.5 pkgrel=1 pkgdesc='Command-line XML and HTML beautifier and content extractor' arch=('x86_64') url='https://github.com/sibprogrammer/xq' license=('MIT') -depends=('glibc') -makedepends=('git' 'go') -conflicts=('yq') -options=('!lto') -_commit='2842ec90a2d8143dd90211b083ace7325e6a3a8f' -source=( - "$pkgname::git+$url#commit=$_commit" - 'manpage-template.patch' -) -b2sums=('SKIP' - 'f2448e22798e018d6962016dc800ff96ae9c23b776742348a7036d613efa8c37e5c8c7a539804f2daebc4c152495cc1cbbcb2635fcf223e958596333cab1b843') - -pkgver() { - cd "$pkgname" - - git describe --tags | sed 's/^v//' -} +makedepends=('go') +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz") +sha256sums=('9432a992d2f0ab82a7350da6317e27f835713c340177518dd08581bd0e918365') prepare() { - cd "$pkgname" - - # create directory for build output - mkdir build - - # download dependencies - go mod download - - # turn man page into a template - patch -p1 -i "$srcdir/manpage-template.patch" + cd "${pkgname}-${pkgver}" + mkdir -p build/ } build() { - cd "$pkgname" - - # set Go flags - export CGO_CPPFLAGS="${CPPFLAGS}" - export CGO_CFLAGS="${CFLAGS}" - export CGO_CXXFLAGS="${CXXFLAGS}" - export GOPATH="${srcdir}" - - # commit date for binary & man page - local _commit_date=$(git show --no-patch --format=%cd --date=format:%Y-%m-%d) - - go build -v \ - -buildmode=pie \ - -mod=readonly \ - -modcacherw \ - -ldflags "-compressdwarf=false \ - -linkmode external \ - -extldflags ${LDFLAGS} \ - -X main.commit=$_commit \ - -X main.date=$_commit_date \ - -X main.version=$pkgver" \ - -o build \ - . - - # template-ify man page - sed \ - -e "s/@DATE@/$_commit_date/" \ - -e "s/@VERSION@/$pkgver/" \ - -i docs/xq.man -} - -check() { - cd "$pkgname" - - go test -v ./... + 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 . } package() { - cd "$pkgname" + cd "${pkgname}-${pkgver}" - # binary - install -vDm755 -t "$pkgdir/usr/bin" build/xq + #binary + install -Dm755 build/$pkgname "$pkgdir/usr/bin/$pkgname" # documentation install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md -- cgit v1.2.3-70-g09d2