contrib/bat/Pkgfile

37 lines
1.3 KiB
Plaintext
Raw Normal View History

2020-07-21 19:23:48 +02:00
# Description: A cat(1) clone with wings
# URL: https://github.com/sharkdp/bat
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: rust
2023-02-25 20:07:58 +01:00
# Optional: libgit2
2020-07-21 19:23:48 +02:00
name=bat
2023-10-11 22:27:04 +02:00
version=0.24.0
2023-03-25 13:28:04 +01:00
release=1
2020-07-21 19:23:48 +02:00
source=(https://github.com/sharkdp/bat/archive/v$version/$name-$version.tar.gz)
build() {
2023-02-25 20:07:58 +01:00
prt-get isinst libgit2 && PKGMK_BAT+=' git'
2020-11-23 16:27:10 +01:00
2020-07-21 19:23:48 +02:00
prt-get isinst sccache && export RUSTC_WRAPPER=/usr/bin/sccache
2023-02-25 20:07:58 +01:00
[[ ! -e $PKGMK_SOURCE_DIR/rust ]] && mkdir $PKGMK_SOURCE_DIR/rust
2020-07-21 19:23:48 +02:00
2023-10-11 22:27:04 +02:00
# always build man files and completion files
sed -i -e '1,/cfg(feature = "application"/d' $name-$version/build.rs
export CFLAGS+=' -ffat-lto-objects -w'
2023-02-25 20:07:58 +01:00
cargo build --release --manifest-path $name-$version/Cargo.toml \
--no-default-features \
--features "bugreport build-assets minimal-application $PKGMK_BAT"
2023-10-11 22:27:04 +02:00
prt-get isinst bash-completion && install -Dm644 \
$name-$version/target/release/build/bat-*/out/assets/completions/bat.bash \
2023-10-11 22:37:07 +02:00
$PKG/usr/share/bash-completion/completions/bat
2023-10-11 22:27:04 +02:00
prt-get isinst zsh && install -Dm644 \
$name-$version/target/release/build/bat-*/out/assets/completions/bat.zsh \
$PKG/usr/share/zsh/site-functions/_bat
install -Dm644 $name-$version/target/release/build/bat-*/out/assets/manual/bat.1 \
$PKG/usr/share/man/man1/bat.1
2023-02-25 20:07:58 +01:00
install -Dt $PKG/usr/bin $name-$version/target/release/$name
2020-07-21 19:23:48 +02:00
}