summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 439f39c4449ad1cace2bf07aa9c7075b68ec83cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Maintainer: orhun <orhunparmaksiz@gmail.com>
# https://github.com/orhun/pkgbuilds

pkgname=html-query
pkgver=1.2.2
pkgrel=1
pkgdesc="jq, but for HTML"
arch=('x86_64')
url="https://github.com/orf/html-query"
license=('MIT')
depends=('gcc-libs')
makedepends=('cargo')
source=("$url/archive/$pkgname-v$pkgver.tar.gz")
sha512sums=('d008c8e99ffffc7db7e4dcf01c0baf721576461d3d59976f6810772455b791805839351e2319641ce3580936448064e6affccb853e139c1d1162e2b0a6f92e4d')

prepare() {
  mv "$pkgname-$pkgname-v$pkgver" "$pkgname-$pkgver"
  cd "$pkgname-$pkgver"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
  cd "$pkgname-$pkgver"
  cargo build --release --frozen
}

check() {
  cd "$pkgname-$pkgver"
  cargo test --frozen
}

package() {
  cd "$pkgname-$pkgver"
  install -Dm 755 "target/release/hq" -t "$pkgdir/usr/bin"
  install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
  install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
}