diff options
-rw-r--r-- | .SRCINFO | 19 | ||||
-rw-r--r-- | PKGBUILD | 40 |
2 files changed, 59 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..e4b1db6c08f0 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,19 @@ +pkgbase = clash-rs + pkgdesc = custom protocol network proxy + pkgver = 0.1.17 + pkgrel = 1 + url = https://github.com/Watfaq/clash-rs + arch = any + license = Apache-2.0 + makedepends = rust + makedepends = cargo + makedepends = git + depends = gcc-libs + depends = glibc + depends = xz + provides = clash-rs + options = !lto + source = git+https://github.com/Watfaq/clash-rs.git#tag=v0.1.17 + md5sums = SKIP + +pkgname = clash-rs diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..5352ce7d75aa --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,40 @@ +# 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.1.17 +pkgrel=1 +makedepends=("rust" "cargo" "git") +depends=("gcc-libs" "glibc" "xz") +source=("git+https://github.com/Watfaq/clash-rs.git#tag=v${pkgver}") +md5sums=("SKIP") +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 check() { + cd "${srcdir}/clash-rs" + export RUSTUP_TOOLCHAIN=stable + cargo test --release --frozen --all-features --locked +} + +function package() { + install -Dm755 "${srcdir}/clash-rs/target/release/clash" "${pkgdir}/usr/bin/clash-rs" + install -Dm644 "${srcdir}/clash-rs/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" +} + |