summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 02feca49e203992b284400972c3011f9e505178d (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
# Maintainer: Kimiblock Moe
# Maintainer: JohanChane

pkgname=clashtui-git
pkgdesc="Mihomo (Clash.Meta) TUI Client"
url="https://github.com/JohanChane/clashtui"
license=("MIT")
arch=("any")
pkgver=0.2.0.r8.gd6e96fb0
pkgrel=1
makedepends=("rust" "cargo" "git")
depends=("gcc-libs" "glibc")
source=("git+https://github.com/JohanChane/clashtui.git#branch=main")
md5sums=("SKIP")
provides=("clashtui")
conflicts=("clashtui")
options=(!lto)

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

function prepare() {
	cd "${srcdir}/clashtui/clashtui"
	export RUSTUP_TOOLCHAIN=stable
	cargo fetch --target "$CARCH-unknown-linux-gnu"
}

function build() {
	cd "${srcdir}/clashtui/clashtui"
	export RUSTUP_TOOLCHAIN=stable
	export CARGO_TARGET_DIR=target
	cargo build --release --frozen --all-features --locked
}

function check() {
	cd "${srcdir}/clashtui/clashtui"
	export RUSTUP_TOOLCHAIN=stable
	cargo test --release --frozen --all-features --locked
}

function package() {
	install -Dm755 "${srcdir}/clashtui/clashtui/target/release/clashtui" "${pkgdir}/usr/bin/clashtui"
	install -Dm644 "${srcdir}/clashtui/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}