summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 2601d4f050b2c0fbd27429c2d0e93cd62bfad332 (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
pkgname=ydcv-rs-git
_gitname="ydcv-rs"
pkgdesc="A Rust version of ydcv."
pkgver=0.3.1.55
pkgrel=3
arch=('i686' 'x86_64')
conflicts=("ydcv")
provides=("ydcv")
url="https://github.com/farseerfc/ydcv-rs"
license=('MIT' 'GPL2')
depends=("openssl" "readline" "libdbus")
optdepends=("xsel: for X selection")
makedepends=('git' 'cargo' 'python-pytoml')
source=('git://github.com/farseerfc/ydcv-rs.git')
sha256sums=('SKIP')

pkgver() {
	cd $_gitname
	echo "$(python -c "print(__import__('pytoml').loads(open('Cargo.toml').read())['package']['version'])").$(git rev-list --count HEAD)"
}

build() {
	cd $_gitname
	cargo build --no-default-features --features "hyper notify-rust" --release
}

check() {
	cd $_gitname
	cargo test --release
}

package() {
	cd $_gitname
	export PATH="$PATH:$pkgdir/usr/bin"
	cargo install --root "$pkgdir/usr"
	mv "$pkgdir/usr/bin/ydcv-rs" "$pkgdir/usr/bin/ydcv"
	rm "$pkgdir/usr/.crates.toml"
}