defpkgbuild(busybox, #:pkgname, "busybox", #:pkgver, "1.38.0", #:pkgrel, 1, #:pkgdesc, "Static musl shell and bootstrap utilities for Vinix", #:arch, [#:x86-64], #:url, "https://busybox.net/", #:license, "GPL-2.0-only", #:source, ["https://busybox.net/downloads/busybox-1.38.0.tar.bz2", "bootstrap.config"], #:sha256sums, ["34f9ea6ff8636f2c9241153b9114eefa9e65674a45318ae1ef95bb5f31c53bb2", "9d8c4fb8ebad6ddbf058e151d807a90ce7687643626e0e4b5357e587718dec00"], #:prepare, fn() { ; Start with everything disabled. BusyBox allnoconfig overrides explicit ; KCONFIG_ALLCONFIG selections, so enable the selected options afterwards. run("make", "-C", "busybox-1.38.0", "allnoconfig") run("cp", "bootstrap.config", "enable.sed") run("sed", "-i", "-e", "/^#/d", "-e", "s/^\\(CONFIG_[A-Z0-9_]*\\)=y$/s|^# \\1 is not set$|\\1=y|/", "enable.sed") run("cp", "busybox-1.38.0/.config", "busybox-1.38.0/vinix.defconfig") run("sed", "-i", "-f", "enable.sed", "busybox-1.38.0/vinix.defconfig") run("make", "-C", "busybox-1.38.0", "KBUILD_DEFCONFIG=vinix.defconfig", "defconfig") ; The musl-gcc wrapper uses its own libc headers. Only the kernel UAPI ; directories are needed from linux-libc-dev on the x86-64 builder. run("mkdir", "uapi") run("ln", "-s", "/usr/include/linux", "uapi/linux") run("ln", "-s", "/usr/include/asm-generic", "uapi/asm-generic") if file-exists?("/usr/include/asm") { run("ln", "-s", "/usr/include/asm", "uapi/asm") } else { run("ln", "-s", "/usr/include/x86_64-linux-gnu/asm", "uapi/asm") } }, #:build, fn() { run("make", "-C", "busybox-1.38.0", "CC=musl-gcc", "EXTRA_CFLAGS=-I../uapi") }, #:check, fn() { run("busybox-1.38.0/busybox", "ash", "-n", "/dev/null") run("busybox-1.38.0/busybox", "true") }, #:package, fn() { run("make", "-C", "busybox-1.38.0", "CC=musl-gcc", "EXTRA_CFLAGS=-I../uapi", string-append("CONFIG_PREFIX=", pkgdir()), "install") run("install", "-Dm644", "busybox-1.38.0/LICENSE", string-append(pkgdir(), "/usr/share/licenses/busybox/LICENSE")) })