summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorVasilii Novikov2022-12-10 00:21:57 +0000
committerVasilii Novikov2022-12-10 00:21:57 +0000
commit2ac1d1ea298df2896dd568526d6b5087c36ada5b (patch)
tree2557129826abcb3761757fa3500d223dcfb3092b /PKGBUILD
parent4bb742e081e39dc414eb4c3acdffffdf73672995 (diff)
downloadaur-2ac1d1ea298df2896dd568526d6b5087c36ada5b.tar.gz
Make build reproducible
Also, standardize with https://wiki.archlinux.org/title/Rust_package_guidelines
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD24
1 files changed, 18 insertions, 6 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 0f400153134f..402cd19ec90c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Vasili Novikov (replace "nnn" with "n" in email) <nnn1dr+cmarchlinux@yandex.com>
pkgname=rua
pkgver=0.19.3
-pkgrel=1
+pkgrel=2
pkgdesc='AUR helper in Rust providing control, review, patch application and safe build options'
url='https://github.com/vn971/rua'
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/vn971/rua/archive/v${pkgver}.tar.gz")
@@ -24,19 +24,31 @@ b2sums=(16b82524f26dbd5c97a6cedfd04179043c6f39d5f268f087c526a95614d53caa8d115ec8
#options+=(!strip) # uncomment if you want readable stack traces
+prepare() {
+ cd "$srcdir/$pkgname-$pkgver"
+ cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
+}
+
build () {
cd "$srcdir/$pkgname-$pkgver"
mkdir -p target/completions
+ # RUSTUP_TOOLCHAIN is specified in project's .rust-toolchain.toml
COMPLETIONS_DIR=target/completions \
- cargo build --release
+ CARGO_TARGET_DIR=target \
+ cargo build --frozen --release
+}
+
+check() {
+ cd "$srcdir/$pkgname-$pkgver"
+ cargo test --frozen
}
package() {
cd "$srcdir/$pkgname-$pkgver"
- install -Dm755 target/release/rua "${pkgdir}/usr/bin/rua"
+ install -Dm0755 target/release/rua "${pkgdir}/usr/bin/rua"
- install -Dm644 target/completions/rua.bash "${pkgdir}/usr/share/bash-completion/completions/rua.bash"
- install -Dm644 target/completions/rua.fish "${pkgdir}/usr/share/fish/completions/rua.fish"
- install -Dm644 target/completions/_rua "${pkgdir}/usr/share/zsh/functions/Completion/Linux/_rua"
+ install -Dm0644 target/completions/rua.bash "${pkgdir}/usr/share/bash-completion/completions/rua.bash"
+ install -Dm0644 target/completions/rua.fish "${pkgdir}/usr/share/fish/completions/rua.fish"
+ install -Dm0644 target/completions/_rua "${pkgdir}/usr/share/zsh/functions/Completion/Linux/_rua"
}