airgap-ng/PKGBUILD.keyfork

46 lines
1.8 KiB
Plaintext
Raw Normal View History

2024-02-01 05:42:49 +00:00
pkgname='keyfork'
pkgver='0.0.0'
pkgrel=1
pkgdesc='The Kitchen Sink of Entropy'
arch=('x86_64')
url='https://git.distrust.co/public/keyfork'
license=('GPL-2.0')
makedepends=('cargo' 'clang' 'git' 'llvm' 'pkgconf') # + nettle + pcsclite
2024-02-03 03:07:27 +00:00
depends=('nettle' 'pcsclite' 'zbar')
2024-02-01 05:42:49 +00:00
source=('git+https://git.distrust.co/public/keyfork.git')
prepare() {
cd "$srcdir/$pkgname"
export RUSTUP_TOOLCHAIN=stable
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
cd -
}
build() {
export RUSTUP_TOOLCHAIN=stable
2024-02-03 03:07:27 +00:00
export CARGO_TARGET_DIR="$srcdir/$pkgname/target"
2024-02-01 05:42:49 +00:00
export RUSTFLAGS="-C codegen-units=1"
cd "$srcdir/$pkgname"
# NOTE: Do not use `--all-features` as features may be incomopatible with
# each other.
2024-02-03 03:07:27 +00:00
KEYFORK_FEATURES="--no-default-features --features completion,qrcode-decode-backend-zbar,sequoia-crypto-backend-nettle"
cargo build --frozen --release --bin keyfork-qrcode-scan --no-default-features --features decode-backend-zbar
cargo build --frozen --release --bin keyfork $KEYFORK_FEATURES
2024-02-03 03:07:27 +00:00
mkdir completions
cargo run --frozen --release --bin keyfork $KEYFORK_FEATURES completion bash > completions/bash
cargo run --frozen --release --bin keyfork $KEYFORK_FEATURES completion zsh > completions/zsh
cargo run --frozen --release --bin keyfork $KEYFORK_FEATURES completion fish > completions/fish
2024-02-01 05:42:49 +00:00
}
package() {
build="$srcdir/$pkgname/target/release"
target="$pkgdir/usr/bin"
install -Dm755 "$build/$pkgname" "$pkgdir/usr/bin/$pkgname"
install -Dm755 "$build/$pkgname-qrcode-scan" "$pkgdir/usr/bin/$pkgname-qrcode-scan"
2024-02-03 03:07:27 +00:00
install -Dm644 "$srcdir/$pkgname/completions/bash" "$pkgdir/usr/share/bash-completion/completions/$pkgname"
install -Dm644 "$srcdir/$pkgname/completions/zsh" "$pkgdir/usr/share/zsh/site-functions/_$pkgname"
install -Dm644 "$srcdir/$pkgname/completions/fish" "$pkgdir/usr/share/fish/vendor_completions.d/$pkgname"
2024-02-01 05:42:49 +00:00
}