1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-24 19:55:26 +03:00
aports/community/bat/APKBUILD
psykose 39f6fef713 */*: cargo fetch with --target
this does not download deps that won't be used for the default build
target (the ctarget we are building for implicitly).
this makes quite a few fetches faster.. because a ton of crates download
a 10mb "windows-sys" that is never used, amongst other things.

maybe breaks a thing or two.
2023-02-11 16:56:41 +01:00

66 lines
1.6 KiB
Text

# Contributor: Chloe Kudryavtsev <code@toast.bunkerlabs.net>
# Maintainer: psykose <alice@ayaya.dev>
pkgname=bat
pkgver=0.22.1
pkgrel=1
pkgdesc="cat(1) clone with wings"
url="https://github.com/sharkdp/bat"
# s390x: nix crate fails to build
# riscv64: textrels
arch="all !s390x !riscv64"
license="Apache-2.0"
depends="less" # Required for RAW-CONTROL-CHARS
makedepends="
cargo
libgit2-dev
oniguruma-dev
"
checkdepends="bash"
options="net"
subpackages="$pkgname-doc
$pkgname-bash-completion
$pkgname-fish-completion
$pkgname-zsh-completion
"
source="https://github.com/sharkdp/bat/archive/v$pkgver/bat-$pkgver.tar.gz"
# secfixes:
# 0.21.0-r0:
# - CVE-2022-24713
export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"
export RUSTONIG_DYNAMIC_LIBONIG=1 # use system libonig
prepare() {
default_prepare
cargo fetch --target="$CTARGET" --locked
}
build() {
cargo build --frozen --release
}
check() {
cargo test --frozen
}
package() {
install -Dm755 target/release/bat "$pkgdir"/usr/bin/bat
find "$srcdir" -name bat.1 -exec install -Dm644 {} \
"$pkgdir"/usr/share/man/man1/bat.1 \;
find "$srcdir" -name bat.bash -exec install -Dm644 {} \
"$pkgdir"/usr/share/bash-completion/completions/bat \;
find "$srcdir" -name bat.fish -exec install -Dm644 {} \
"$pkgdir"/usr/share/fish/completions/bat.fish \;
find "$srcdir" -name bat.zsh -exec install -Dm644 {} \
"$pkgdir"/usr/share/zsh/site-functions/_bat \;
}
sha512sums="
9d31ab4f5453c3806252bedad31809d296f1529e6086090ad9385adfd76c164a1e15031150c374076d5f689844276c8fae7087a9382154609870be8f4b80c8ad bat-0.22.1.tar.gz
"