-
Notifications
You must be signed in to change notification settings - Fork 2.1k
/
template
75 lines (65 loc) · 1.54 KB
/
template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# Template file for 'toybox'
pkgname=toybox
version=0.8.10
revision=2
create_wrksrc=yes
short_desc="BSD-licensed alternative to busybox"
maintainer="Orphaned <orphan@voidlinux.org>"
license="0BSD"
homepage="http://www.landley.net/toybox"
distfiles="http://www.landley.net/toybox/downloads/toybox-${version}.tar.gz"
checksum=d3afee05ca90bf425ced73f527e418fecd626c5340b5f58711a14531f8d7d108
if [ "$XBPS_TARGET_LIBC" = "glibc" ]; then
makedepends+=" libxcrypt-devel"
fi
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, grep, sed and tar fail
rm tests/du.test
rm tests/find.test
rm tests/grep.test
rm tests/sed.test
rm tests/tar.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
rm tests/rm.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
}
}