summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 07477d41b7c684e65d8bfab593736fc0ea63b989 (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>

pkgname=gitopolis
pkgver=1.13.0
pkgrel=1
pkgdesc='CLI tool to manage multiple git repositories; run commands, clone, and organize repos with tags'
arch=(x86_64)
url="https://github.com/timabell/$pkgname"
license=(AGPL-3.0-only)
depends=(gcc-libs
         glibc
         libgit2 libgit2.so
         openssl libcrypto.so libssl.so)
makedepends=(cargo)
checkdepends=(git)
_archive="$pkgname-$pkgver"
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('d27ef8c7e87de052bdb70c82c3275b9c201c6dde348136304f3871a37ebdcc9d')

prepare() {
	cd "$_archive"
	cargo fetch --locked --target "$(rustc --print host-tuple)"
}

_srcenv() {
	cd "$_archive"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	export LIBGIT2_NO_VENDOR=1
	export LIBGIT2_SYS_USE_PKG_CONFIG=1
	export OPENSSL_NO_VENDOR=true
	CFLAGS+=' -ffat-lto-objects'
}

build() {
	_srcenv
	cargo build --frozen --release --all-features
}

check() {
	_srcenv
	cargo test --frozen --all-features
}

package() {
	cd "$_archive"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
}