mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-25 12:15:32 +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.
78 lines
2.2 KiB
Text
78 lines
2.2 KiB
Text
# Maintainer: omni <omni+alpine@hack.org>
|
|
pkgname=uutils-coreutils
|
|
_pkgname=coreutils
|
|
pkgver=0.0.17
|
|
pkgrel=0
|
|
pkgdesc="coreutils rewritten in Rust"
|
|
# s390x: some endianness failure
|
|
# riscv64: rust broken
|
|
arch="all !s390x !riscv64"
|
|
url="https://github.com/uutils/coreutils"
|
|
license="MIT"
|
|
makedepends="cargo help2man oniguruma-dev"
|
|
checkdepends="coreutils" # test_ls.rs incompatible with busybox truncate
|
|
subpackages="$pkgname-doc"
|
|
source="$pkgname-$pkgver.tar.gz::https://github.com/uutils/coreutils/archive/$pkgver.tar.gz"
|
|
builddir="$srcdir/$_pkgname-$pkgver"
|
|
options="!check" # package builder file descriptor issues
|
|
|
|
export RUSTONIG_DYNAMIC_LIBONIG=1
|
|
|
|
case "$CARCH" in
|
|
armhf)
|
|
# various failures
|
|
options="$options !check"
|
|
;;
|
|
esac
|
|
|
|
prepare() {
|
|
default_prepare
|
|
|
|
cargo fetch --target="$CTARGET" --locked
|
|
}
|
|
|
|
build() {
|
|
cargo build --release --frozen
|
|
|
|
mkdir bin
|
|
cp target/release/"$_pkgname" bin/uutils
|
|
|
|
mkdir man1
|
|
help2man --no-info --name=uutils --manual=uutils \
|
|
--version-string="$pkgver" bin/uutils > man1/uutils.1
|
|
|
|
# create symlinks and individual man pages
|
|
for uutil in $(./bin/uutils | tail -n +7 | tr -d '\n' | sed -e 's/,//g' -e 's/sha3-\s*512sum/sha3-512sum/'); do
|
|
ln -s uutils bin/uutils-$uutil
|
|
case "$uutil" in
|
|
test) ;; # helpless
|
|
\[) help2man --no-info --name=uutils-test --manual=uutils \
|
|
bin/uutils-"$uutil" > man1/uutils-test.1 ;;
|
|
cp) help2man --no-info --name=uutils-"$uutil" --manual=uutils \
|
|
--no-discard-stderr bin/uutils-"$uutil" > man1/uutils-"$uutil".1 ;;
|
|
yes) help2man --no-info --name=uutils-"$uutil" --manual=uutils \
|
|
--version-string="$pkgver" bin/uutils-"$uutil" > man1/uutils-"$uutil".1 ;;
|
|
*) help2man --no-info --name=uutils-"$uutil" --manual=uutils \
|
|
bin/uutils-"$uutil" > man1/uutils-"$uutil".1 ;;
|
|
esac
|
|
done
|
|
}
|
|
|
|
check() {
|
|
ulimit -n 4096 # running out of file descriptors
|
|
|
|
cargo test --release --frozen
|
|
}
|
|
|
|
package() {
|
|
mkdir -p "$pkgdir"/usr
|
|
mv bin "$pkgdir"/usr
|
|
|
|
mkdir -p "$pkgdir"/usr/share/man
|
|
mv man1 "$pkgdir"/usr/share/man
|
|
install -Dm0644 LICENSE -t "$pkgdir"/usr/share/licenses/"$pkgname"
|
|
}
|
|
|
|
sha512sums="
|
|
41a7a6350bfcae4a90b07989e4eca371188ef3f61d253f7c3ad61777282b49efa9b52e433e40a38952a1662f1c8bbf3ec1c14cdb29e53b0a2e91c019828e714c uutils-coreutils-0.0.17.tar.gz
|
|
"
|