blob: cb38228d42655cece89f6d6aa6082761a187e8e7 (
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
|
# Maintainer : Kr1ss $(echo \<kr1ss+x-yandex+com\>|sed s/\+/./g\;s/\-/@/)
# Contributor : ccorn
pkgname=git-delta
pkgver=0.8.2
pkgrel=1
pkgdesc='Syntax-highlighting pager for git and diff output'
arch=('i686' 'x86_64' 'arm' 'armv7h' 'armv6h' 'aarch64')
url=https://github.com/dandavison/delta
license=('MIT')
makedepends=('rust')
depends=('git' 'libgit2')
source=("$pkgname-$pkgver.tgz::$url/archive/$pkgver.tar.gz")
sha256sums=('b29db829a22f77538ce2e291e4c1b8f9aa7e714dbe5200c6353670a888b746d3')
# lto fails, ref: https://aur.archlinux.org/packages/git-delta/#comment-811625
options=('!lto')
_setup_build_env() {
# Assist chroot builds with a persistent cargo cache
if [ -d "$startdir/.cargo" ]; then
export CARGO_HOME="${CARGO_HOME:-$startdir/.cargo}"
elif [ "$1" = "-v" ]; then
msg2 "NOTE : If you're building in a (clean) chroot and want a persistant
cargo cache folder specific for this package, you can create
an empty '.cargo' directory next to the PKGBUILD. This will
then be recognized and used as the CARGO_HOME cache. (Except
when the CARGO_HOME variable is already set in your environ-
ment.)"
fi
}
prepare() {
sed -i "/path *=/s|=.*|= /usr/share/$pkgname/gitconfig.delta|" "delta-$pkgver/themes.gitconfig"
}
build() {
_setup_build_env -v
cd "delta-$pkgver"
cargo build --release --locked --target-dir ./target
}
check() {
_setup_build_env
cd "delta-$pkgver"
cargo test --release --locked --target-dir ./target
}
package() {
cd "delta-$pkgver"
install -Dm755 "target/release/delta" -t"$pkgdir/usr/bin/"
install -Dm644 themes.gitconfig "$pkgdir/usr/share/$pkgname/gitconfig.delta"
install -Dm644 {README,CONTRIBUTING}.md -t"$pkgdir/usr/share/doc/$pkgname/"
install -Dm644 LICENSE -t"$pkgdir/usr/share/licenses/$pkgname/"
cd etc
install -Dm644 completion/completion.bash "$pkgdir/usr/share/bash-completion/completions/delta"
install -Dm644 completion/completion.zsh "$pkgdir/usr/share/zsh/site-functions/_delta"
install -Dm755 bin/* -t"$pkgdir/usr/lib/$pkgname/"
}
# vim: ts=2 sw=2 et ft=PKGBUILD:
|