summaryrefslogtreecommitdiffstats
path: root/xq/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'xq/PKGBUILD')
-rw-r--r--xq/PKGBUILD46
1 files changed, 46 insertions, 0 deletions
diff --git a/xq/PKGBUILD b/xq/PKGBUILD
new file mode 100644
index 0000000..5a4f12c
--- /dev/null
+++ b/xq/PKGBUILD
@@ -0,0 +1,46 @@
1# Maintainer: Yigit Sever <yigit at yigitsever dot com>
2# Contributor: George Rawlinson <[email protected]>
3
4pkgname=xq
5pkgver=1.2.5
6pkgrel=2
7pkgdesc='Command-line XML and HTML beautifier and content extractor'
8arch=('x86_64')
9url='https://github.com/sibprogrammer/xq'
10license=('MIT')
11makedepends=('go')
12conflicts=('yq')
13source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
14sha256sums=('9432a992d2f0ab82a7350da6317e27f835713c340177518dd08581bd0e918365')
15
16prepare() {
17 cd "${pkgname}-${pkgver}"
18 mkdir -p build/
19}
20
21build() {
22 cd "${pkgname}-${pkgver}"
23 export CGO_CPPFLAGS="${CPPFLAGS}"
24 export CGO_CFLAGS="${CFLAGS}"
25 export CGO_CXXFLAGS="${CXXFLAGS}"
26 export CGO_LDFLAGS="${LDFLAGS}"
27 export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw"
28 go build -o build .
29}
30
31package() {
32 cd "${pkgname}-${pkgver}"
33
34 #binary
35 install -Dm755 build/$pkgname "$pkgdir/usr/bin/$pkgname"
36
37 # documentation
38 install -vDm644 -t "$pkgdir/usr/share/doc/$pkgname" README.md
39 cp -vr assets "$pkgdir/usr/share/doc/$pkgname"
40
41 # man
42 install -vDm644 docs/xq.man "$pkgdir/usr/share/man/man1/$pkgname.1"
43
44 # license
45 install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
46}