summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: de45394cd80acfa65158dc6bb226e3f0e109eead (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
# Maintainer: bkfox
# Contributor: Vojtech Kral <vojtech_kral^hk>
# Contributor: FĂ©lix Saparelli <aur@passcod.name>
# Contributor: ask

pkgname=rust-bindgen-git
pkgver=0.53.2.63ae30b
pkgrel=1
pkgdesc="Binding generator for rust language"
arch=('i686' 'x86_64')
url="https://github.com/rust-lang-nursery/rust-bindgen"
license=('BSD')
makedepends=('rust')
depends=('clang>=4.0.0')
source=('git://github.com/rust-lang-nursery/rust-bindgen.git')
sha512sums=('SKIP')

pkgver() {
	cd "$srcdir/rust-bindgen"
    version=`grep version Cargo.toml -h --color=never | head -n 1 | sed "s/version = \"\([^\n]\+\)\"/\1/"`
	printf "%s.%s" "$version" "$(git log --pretty=format:%h --abbrev-commit -n1)"
}

build() {
	cd "$srcdir/rust-bindgen"
	cargo build --release
}

package() {
	cd "$srcdir/rust-bindgen/target/release"
	install -D 'bindgen' "${pkgdir}/usr/bin/rust-bindgen"
	libbindgen=$(ls libbindgen*.rlib)
	install -D "$libbindgen" "${pkgdir}/usr/lib/${libbindgen}"
}