keyfork: use zbar, add completions
This commit is contained in:
parent
a2de2b68c1
commit
4d58ba2d22
|
@ -6,7 +6,7 @@ arch=('x86_64')
|
|||
url='https://git.distrust.co/public/keyfork'
|
||||
license=('GPL-2.0')
|
||||
makedepends=('cargo' 'clang' 'git' 'llvm' 'pkgconf') # + nettle + pcsclite
|
||||
depends=('nettle' 'pcsclite')
|
||||
depends=('nettle' 'pcsclite' 'zbar')
|
||||
source=('git+https://git.distrust.co/public/keyfork.git')
|
||||
|
||||
prepare() {
|
||||
|
@ -18,16 +18,24 @@ prepare() {
|
|||
|
||||
build() {
|
||||
export RUSTUP_TOOLCHAIN=stable
|
||||
export CARGO_TARGET_DIR=target
|
||||
export CARGO_TARGET_DIR="$srcdir/$pkgname/target"
|
||||
export RUSTFLAGS="-C codegen-units=1"
|
||||
cd "$srcdir/$pkgname"
|
||||
# NOTE: Do not use `--all-features` as features may be incomopatible with
|
||||
# each other.
|
||||
cargo build --frozen --release -p keyfork
|
||||
KEYFORK_FEATURES="--no-default-features --features completion,qrcode-decode-backend-zbar,sequoia-crypto-backend-nettle"
|
||||
cargo build --frozen --release -p keyfork $KEYFORK_FEATURES
|
||||
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
|
||||
}
|
||||
|
||||
package() {
|
||||
build="$srcdir/$pkgname/target/release"
|
||||
target="$pkgdir/usr/bin"
|
||||
install -Dm755 "$build/$pkgname" "$pkgdir/usr/bin/$pkgname"
|
||||
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"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue