1 # Maintainer: Orhun Parmaksız <orhun@archlinux.org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
3 # Contributor: Wesley Moore <wes@wezm.net>
8 pkgdesc="Friendly and fast tool for sending HTTP requests"
10 url="https://github.com/ducaale/xh"
12 depends=('gcc-libs' 'openssl')
14 replaces=('ht-rs' 'ht')
15 source=("$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
16 sha256sums=('ed16781248d60a1f86d8da206440e9c761520bcd00917213dc6eb68fe357999e')
20 cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
25 CFLAGS+=" -ffat-lto-objects"
26 cargo build --frozen --release --features native-tls
31 cargo test --frozen --features native-tls
36 install -Dm 755 "target/release/$pkgname" -t "$pkgdir/usr/bin"
37 install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
38 install -Dm 644 LICENSE -t "$pkgdir/usr/share/licenses/$pkgname"
39 install -Dm 644 "doc/$pkgname.1" -t "$pkgdir/usr/share/man/man1"
40 install -Dm 644 "completions/$pkgname.bash" "${pkgdir}/usr/share/bash-completion/completions/$pkgname"
41 install -Dm 644 "completions/$pkgname.fish" -t "${pkgdir}/usr/share/fish/vendor_completions.d"
42 install -Dm 644 "completions/_$pkgname" -t "${pkgdir}/usr/share/zsh/site-functions"
43 # `xh` will default to HTTPS scheme if the binary name is one of `xhs`, `https`, or `xhttps`
44 ln -s "/usr/bin/$pkgname" "$pkgdir/usr/bin/${pkgname}s"