void-packages/srcpkgs/toybox/template
mobinmob 9bd1d90db0 toybox: update to 0.8.5.
By ericonr:
- factor out test removal into its own function to avoid repetition

Closes: #31045 [via git-merge-pr]
2021-06-12 01:01:43 -03:00

69 lines
1.4 KiB
Bash

# Template file for 'toybox'
pkgname=toybox
version=0.8.5
revision=1
create_wrksrc=yes
short_desc="BSD-licensed alternative to busybox"
maintainer="Steve Prybylski <sa.prybylx@gmail.com>"
license="0BSD"
homepage="http://www.landley.net/toybox"
distfiles="http://www.landley.net/toybox/downloads/toybox-${version}.tar.gz"
checksum=bfd230c187726347f7e31a1fc5841705871dfe4f3cbc6628f512b54e57360949
post_extract() {
mv toybox-${version} toybox
cp -r toybox toybox-static
}
do_build() {
export NOSTRIP=1
# toybox
cd toybox
make defconfig
make ${makejobs} toybox
# toybox-static
cd ../toybox-static
make defconfig
make ${makejobs} LDFLAGS="-static" toybox
}
_rm_failing_tests() {
# XXX: Some tests for du, find and grep fail
rm tests/du.test
rm tests/find.test
rm tests/grep.test
[ "$XBPS_BUILD_ENVIRONMENT" != void-packages-ci ] && return 0
# XXX: chattr, hostname,losetup, rmdir tests fail on CI
rm tests/chattr.test
rm tests/hostname.test
rm tests/losetup.test
rm tests/rmdir.test
}
do_check() {
msg_normal "Running tests for toybox...\n"
cd toybox
_rm_failing_tests
make tests
msg_normal "Running tests for toybox-static...\n"
cd ../toybox-static
_rm_failing_tests
make tests
}
do_install() {
vbin toybox/toybox
vlicense toybox/LICENSE
}
toybox-static_package() {
short_desc+=" - statically linked"
pkg_install() {
vbin toybox-static/toybox toybox.static
vlicense toybox-static/LICENSE
}
}