summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3b7f03f4b043c0a8da93d7d5a92e92470410c23e (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
38
39
40
41
42
43
44
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: pinks <aur at papepati dot page>

pkgname=xee
pkgver=0.1.5
pkgrel=1
pkgdesc='CLI frontent to XML Execution Engine, a modern XPath and XSLT processor'
arch=(x86_64)
url=https://github.com/Paligo/xee
license=(MIT)
depends=(gcc-libs
         glibc)
makedepends=(cargo
             git)
source=("git+$url.git#tag=xee-v$pkgver")
sha256sums=('d27d5791258d5e8737923b8265f53c2b3a33be62a1ae811c6d6f34a88fb2ad4d')

prepare() {
	cd "$pkgname"
	cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

_srcenv() {
	cd "$pkgname"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	CFLAGS+=' -ffat-lto-objects'
}

build() {
	_srcenv
	cargo build --frozen --release --all-features
}

check() {
	_srcenv
	cargo test --frozen --all-features
}

package() {
	cd "$pkgname"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE-MIT
}