From fe8f7ab064b28ae4eb07ad5af69f263a927589ee Mon Sep 17 00:00:00 2001 From: Yingjie Wang Date: Sun, 11 Jan 2026 06:07:29 -0500 Subject: [PATCH] new bblfs: sys-apps/bat-0.26.1 --- sys-apps/bat-0.26.1.PKGBUILD | 54 ++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 sys-apps/bat-0.26.1.PKGBUILD diff --git a/sys-apps/bat-0.26.1.PKGBUILD b/sys-apps/bat-0.26.1.PKGBUILD new file mode 100644 index 0000000..a3c0a58 --- /dev/null +++ b/sys-apps/bat-0.26.1.PKGBUILD @@ -0,0 +1,54 @@ +pkgname=bat +pkgver=0.26.1 +pkgdesc='Cat clone with syntax highlighting and git integration' +arch=(x86_64) +homepage='https://github.com/sharkdp/bat' +license=('Apache-2.0 OR MIT') +depends=(gcc glibc libgit2 oniguruma zlib) +makedepends=(clang cmake rust) +sources=("${pkgname}-${pkgver}.tar.gz") +urls=("https://github.com/sharkdp/${pkgname}/archive/v${pkgver}.tar.gz") +sha512sums=("4b97c094922a750b61744fb9f54685554577d316074b52f5c9dd864fd3bfc91d9cf2fdc5fb7558aaf5c0277470fa40c551d3b284e989b46c3903442bc970b2f8") + +src_prepare() { + tar -xf ${distdir}/${sources[0]} --strip-components=1 + cargo fetch --locked --target "$(rustc --print host-tuple)" +} + +src_build() { + CFLAGS+=' -ffat-lto-objects -w' + CFLAGS=${CFLAGS/-O2/-O3} + export LIBGIT2_NO_VENDOR=1 + cargo build --frozen --release +} + +src_check() { + export LIBGIT2_NO_VENDOR=1 + cargo test --locked --release +} + +src_install() { + install -Dm755 "target/release/$pkgname" "$pkgdir/usr/bin/$pkgname" + + install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE-APACHE LICENSE-MIT + + cd target/release/build + + # Find and package the man page (because cargo --out-dir is too new) + find . -name bat.1 -type f -exec install -Dm644 {} \ + "$pkgdir/usr/share/man/man1/bat.1" \; + + # Find and package the bash completion file + find . -name bat.bash -type f -exec install -Dm644 {} \ + "$pkgdir/usr/share/bash-completion/completions/bat" \; + + # Find and package the zsh completion file (not in zsh-completions yet) + find . -name bat.zsh -type f -exec install -Dm644 {} \ + "$pkgdir/usr/share/zsh/site-functions/_bat" \; + + # Find and package the fish completion file + find . -name bat.fish -type f -exec install -Dm644 {} \ + "$pkgdir/usr/share/fish/vendor_completions.d/bat.fish" \; +} + +# vim:ft=sh syn=sh et sw=2: