# toybox - the BSD-licensed userland.
# This is what makes Arctic's userland BSD rather than GNU: ls, cp, mv, cat,
# sed, grep, tar and friends all come from here under the 0BSD licence.
name=toybox
version=0.8.14
release=1
desc="The classic Unix commands, 0BSD licensed"
url="https://landley.net/toybox/"
license="0BSD"
depend="glibc"
provides="coreutils"
source="https://landley.net/toybox/downloads/toybox-$version.tar.gz"
sha256="SKIP"

build() {
	cd "toybox-$version"
	make defconfig >/dev/null
	make -j"$JOBS" CFLAGS="$CFLAGS -Wno-error" toybox
}

package() {
	cd "toybox-$version"
	install -Dm755 toybox "$pkgdir/usr/bin/toybox"
	# Link every command toybox provides, except the few busybox owns.
	for a in $(./toybox); do
		case "$a" in toybox|init|sh|ash|getty|mdev|login|su|passwd) continue ;; esac
		ln -sf toybox "$pkgdir/usr/bin/$a"
	done
	install -Dm644 README "$pkgdir/usr/share/doc/toybox/README"
}
