summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6ec7388b60c0e816adf135535f28882d39b2632b (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
45
# Maintainer: Alex Henrie <alexhenrie24@gmail.com>
pkgname=git-cinnabar-git
pkgver=0.5.0.r1739.g63d5747
pkgrel=3
pkgdesc="Git remote helper to interact with Mercurial repositories"
arch=(x86_64)
url='https://github.com/glandium/git-cinnabar'
license=(GPL2)
depends=(git mercurial)
makedepends=(cargo)
provides=('git-cinnabar')
conflicts=('git-cinnabar')
options=('!lto')
source=('git+https://github.com/glandium/git-cinnabar.git')
sha256sums=('SKIP')

pkgver() {
	cd "$srcdir/git-cinnabar"
	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd git-cinnabar
	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

build() {
	cd git-cinnabar
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --frozen --release
}

check() {
	cd git-cinnabar
	export RUSTUP_TOOLCHAIN=stable
	cargo test --frozen
}

package() {
	cd git-cinnabar
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/git-cinnabar"
	ln -s git-cinnabar "$pkgdir/usr/bin/git-remote-hg"
}