mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-25 04:05:40 +03:00
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.
50 lines
1.4 KiB
Text
50 lines
1.4 KiB
Text
# Contributor: Leo <thinkabit.ukim@gmail.com>
|
|
# Maintainer: omni <omni+alpine@hack.org>
|
|
pkgname=onefetch
|
|
pkgver=2.15.1
|
|
pkgrel=0
|
|
pkgdesc="Git repository summary on your terminal"
|
|
url="https://github.com/o2sh/onefetch"
|
|
arch="all !s390x !riscv64" # limiteed by rust/cargo
|
|
license="MIT"
|
|
makedepends="cargo cmake libgit2-dev zlib-dev"
|
|
checkdepends="bash"
|
|
subpackages="
|
|
$pkgname-doc
|
|
$pkgname-bash-completion
|
|
$pkgname-fish-completion
|
|
$pkgname-zsh-completion
|
|
"
|
|
source="$pkgname-$pkgver.tar.gz::https://crates.io/api/v1/crates/onefetch/$pkgver/download"
|
|
|
|
# Reduce binary size
|
|
export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
}
|
|
|
|
build() {
|
|
cargo build --frozen --release
|
|
for shellcomp in bash fish zsh; do
|
|
./target/release/onefetch --generate "$shellcomp" > onefetch."$shellcomp"
|
|
done
|
|
}
|
|
|
|
check() {
|
|
cargo test --frozen
|
|
}
|
|
|
|
package() {
|
|
install -Dm0755 target/release/onefetch "$pkgdir"/usr/bin/onefetch
|
|
install -Dm0644 docs/onefetch.1 "$pkgdir"/usr/share/man/man1/onefetch.1
|
|
install -Dm0644 onefetch.bash "$pkgdir"/usr/share/bash-completion/completions/onefetch
|
|
install -Dm0644 onefetch.fish "$pkgdir"/usr/share/fish/completions/onefetch.fish
|
|
install -Dm0644 onefetch.zsh "$pkgdir"/usr/share/zsh/site-functions/_onefetch
|
|
}
|
|
|
|
sha512sums="
|
|
7bdd18f3c82fddbf40279625e4a3f75beb66675e71b001262656d58e3efff597de2f5166a40310c8e1263d388db35d2cc7a1c7314a321345c2c71730ea6ac9bb onefetch-2.15.1.tar.gz
|
|
"
|