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

pkgname=git-next
pkgver=0.13.11
pkgrel=1
pkgdesc='Trunk-based development manager for a solo developer'
url="https://git.kemitix.net/kemitix/$pkgname"
arch=(x86_64)
license=(MIT)
depends=(dbus
         gcc-libs
         glibc)
makedepends=(cargo
             clang)
checkdepends=(git)
options=(!lto)
_archive="$pkgname-$pkgver"
source=("$_archive.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('840c6fba983830aa39e9bb69e3c654e9b98b6f38b5785aac7dfdec6782e2f334')

prepare() {
	cd "$pkgname"
	cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
}

_srcenv() {
	cd "$pkgname"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
}

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

check() {
	_srcenv
	local skipped=(
		git::repository::open::tests::commit_log::should_return_5_in_commit_log_when_searching_for_5th_item
		git::repository::open::tests::commit_log::should_return_capacity_25_in_commit_log_when_searching_for_garbage
		git::repository::open::tests::commit_log::should_return_single_item_in_commit_log_when_not_searching
		git::repository::open::tests::read_file::should_error_on_missing_file
		git::repository::open::tests::read_file::should_return_file
		git::validation::tests::positions::validate::where_branches_are_all_valid_should_return_positions
		git::validation::tests::positions::validate::where_dev_branch_is_not_based_on_main_should_error
		git::validation::tests::positions::validate::where_dev_branch_is_not_based_on_next_should_reset_next_branch_to_next_commit_on_dev_and_retryable_error
		git::validation::tests::positions::validate::where_next_branch_is_not_based_on_main_and_reset_of_next_fails_should_error
		server::tests::gitdir_validate_should_fail_a_git_repo_with_wrong_remote
		server::tests::gitdir_validate_should_pass_a_valid_git_repo
		server::tests::repo_details_find_default_push_remote_finds_correct_remote
    )
	cargo test --frozen -- ${skipped[@]/#/--skip }
}

package() {
	cd "$pkgname"
	install -Dm0755 -t "$pkgdir/usr/bin/" "target/release/$pkgname"
	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}