summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dbfa8b3bcd79f56ed7d2f2136e84a5056c7ab0ff (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
pkgname=rustfmt-nightly-git
_pkgname=rustfmt-nightly
pkgdesc="Format Rust code"
pkgrel=1
pkgver=0.99.6.4082
arch=('i686' 'x86_64')
conflicts=("rustfmt")
provides=("rustfmt")
url="https://github.com/rust-lang-nursery/rustfmt"
license=('Apache' 'MIT')
depends=('rust' 'cargo')
makedepends=('rust' 'cargo')
source=("$_pkgname::git+https://github.com/rust-lang-nursery/rustfmt")
sha256sums=('SKIP')

pkgver() {
	cd $_pkgname
	echo "$(grep '^version =' Cargo.toml|head -n1|cut -d\" -f2).$(git rev-list --count HEAD)"
}

build() {
	cd $_pkgname
	env CARGO_INCREMENTAL=0 cargo build --release
}

package() {
	cd $_pkgname
	install -D -m755 "$srcdir/$_pkgname/target/release/rustfmt" "$pkgdir/usr/bin/rustfmt"
	install -D -m755 "$srcdir/$_pkgname/target/release/cargo-fmt" "$pkgdir/usr/bin/cargo-fmt"
	install -D -m755 "$srcdir/$_pkgname/target/release/rustfmt-format-diff" "$pkgdir/usr/bin/rustfmt-format-diff"
	install -D -m755 "$srcdir/$_pkgname/target/release/git-rustfmt" "$pkgdir/usr/bin/git-rustfmt"
}