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

pkgname=clash-rs
pkgdesc="custom protocol network proxy"
url="https://github.com/Watfaq/clash-rs"
license=("Apache-2.0")
arch=("any")
pkgver=0.7.5
pkgrel=1
makedepends=("cargo-nightly" "git")
depends=("gcc-libs" "glibc" "xz" "protobuf")
source=("git+https://github.com/Watfaq/clash-rs.git#tag=v${pkgver}")
sha256sums=('4c6440628f0655c7ddc1a06205292a54518d5cf2a8c29ebdb8f7703d8a353f69')
provides=("clash-rs")
options=(!lto)

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

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

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