diff options
Diffstat (limited to 'xq/PKGBUILD')
-rw-r--r-- | xq/PKGBUILD | 46 |
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 <grawlinson@archlinux.org> | ||
3 | |||
4 | pkgname=xq | ||
5 | pkgver=1.2.5 | ||
6 | pkgrel=2 | ||
7 | pkgdesc='Command-line XML and HTML beautifier and content extractor' | ||
8 | arch=('x86_64') | ||
9 | url='https://github.com/sibprogrammer/xq' | ||
10 | license=('MIT') | ||
11 | makedepends=('go') | ||
12 | conflicts=('yq') | ||
13 | source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz") | ||
14 | sha256sums=('9432a992d2f0ab82a7350da6317e27f835713c340177518dd08581bd0e918365') | ||
15 | |||
16 | prepare() { | ||
17 | cd "${pkgname}-${pkgver}" | ||
18 | mkdir -p build/ | ||
19 | } | ||
20 | |||
21 | build() { | ||
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 | |||
31 | package() { | ||
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 | } | ||