summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8ae59c6b82f5de3b5ef188dd9803b3e3f282576a (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
# Maintainer: thynkon <thynkon at protonmail dot com>
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=gitui-git
pkgver=0.23.0.r17.gc1e20958
pkgrel=1
pkgdesc='Blazing fast terminal-ui for git written in Rust'
url='https://github.com/extrawurst/gitui'
arch=('x86_64' 'i686')
license=('MIT')
depends=('gcc-libs' 'libgit2>=1.2.0' 'libgit2.so' 'libxcb' 'zlib')
makedepends=('git' 'cargo' 'python') # xcb crate needs python
provides=("gitui=$pkgver")
conflicts=('gitui')
source=("$pkgname::git+$url.git")
sha256sums=('SKIP')
options=(!lto)

prepare() {
  cd "${pkgname}"
  cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}

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

build() {
  cd "${pkgname}"
  export RUSTUP_TOOLCHAIN=stable
  export CARGO_TARGET_DIR=target
  export LIBGIT2_SYS_USE_PKG_CONFIG=1
  cargo build --frozen --release
}

check() {
  cd "${pkgname}"
  export RUSTUP_TOOLCHAIN=stable
  export LIBGIT2_SYS_USE_PKG_CONFIG=1
  cargo test --frozen --release
}

package() {
  cd "$pkgname"
  install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/${pkgname%-git}"
  install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname" {KEY_CONFIG,README,THEMES}.md
  install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE.md
}