aboutsummaryrefslogtreecommitdiffstats
path: root/community/bat/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/bat/APKBUILD')
-rw-r--r--community/bat/APKBUILD47
1 files changed, 33 insertions, 14 deletions
diff --git a/community/bat/APKBUILD b/community/bat/APKBUILD
index 4b220fef62b..e748d880117 100644
--- a/community/bat/APKBUILD
+++ b/community/bat/APKBUILD
@@ -1,14 +1,20 @@
-# Contributor: Chloe Kudryavtsev <toast@toast.cafe>
-# Maintainer: Chloe Kudryavtsev <toast@toast.cafe>
+# Contributor: Chloe Kudryavtsev <code@toast.bunkerlabs.net>
+# Maintainer: omni <omni+alpine@hack.org>
pkgname=bat
-pkgver=0.21.0
-pkgrel=0
+pkgver=0.24.0
+pkgrel=1
pkgdesc="cat(1) clone with wings"
url="https://github.com/sharkdp/bat"
-arch="x86_64 x86 armhf armv7 aarch64 ppc64le" # limited by rust/cargo
+# s390x: nix crate fails to build
+arch="all !s390x"
license="Apache-2.0"
depends="less" # Required for RAW-CONTROL-CHARS
-makedepends="cargo libgit2-dev"
+makedepends="
+ cargo
+ cargo-auditable
+ libgit2-dev
+ oniguruma-dev
+ "
checkdepends="bash"
options="net"
subpackages="$pkgname-doc
@@ -16,21 +22,34 @@ subpackages="$pkgname-doc
$pkgname-fish-completion
$pkgname-zsh-completion
"
-source="https://github.com/sharkdp/bat/archive/v$pkgver/bat-$pkgver.tar.gz
- minimize-size.patch
- "
+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 --locked
+
+ # Rust target triple.
+ local target=$(rustc -vV | sed -n 's/host: //p')
+
+ # Build against system-provided libs
+ mkdir -p .cargo
+ cat >> .cargo/config.toml <<-EOF
+ [target.$target]
+ git2 = { rustc-link-lib = ["git2"] }
+ EOF
+
+ cargo fetch --target="$CTARGET" --locked
}
build() {
- cargo build --frozen --release
+ cargo auditable build --frozen --release
}
check() {
@@ -39,6 +58,7 @@ check() {
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 \;
@@ -46,13 +66,12 @@ package() {
"$pkgdir"/usr/share/bash-completion/completions/bat \;
find "$srcdir" -name bat.fish -exec install -Dm644 {} \
- "$pkgdir"/usr/share/fish/completions/bat.fish \;
+ "$pkgdir"/usr/share/fish/vendor_completions.d/bat.fish \;
find "$srcdir" -name bat.zsh -exec install -Dm644 {} \
"$pkgdir"/usr/share/zsh/site-functions/_bat \;
}
sha512sums="
-113a8225bd297d9a18ad620c5509db1c4028d92387b70fb3eacc34b0ab9dabdd01a206d1b3062632830d8cf34cb12ea8ca6788a8ea985c5e5de57bf71306be70 bat-0.21.0.tar.gz
-efa83937c5704bfa91d3d12a31aa2a798279ce4572259eb3b87ffdbb7dd873a9a480626f01db2aeac489c277d9fc64a97938ca4bcc5d964951f1f52c752556fb minimize-size.patch
+bcb3f818150283ac8d9195175517b17d7de0727604de3e34fc51b168507e8e22ecf91dcb60e12a53cb2f8385dc07fbe5c8123d48bf0dc3a7868a3ae9295da5c4 bat-0.24.0.tar.gz
"