vinix-ports / ports / busybox-init / PKGBUILD.vile
22 lines · 21 sloc · 893 bytes · c33d8afc2906b8dd9a8b905224eccd49a44f7ad5
Raw
1selected := get-environment-variable("VPAC_TARGET_ARCH")
2host := if memq(string->symbol("aarch64"), features()) { "aarch64" } else { "x86_64" }
3arch := if string?(selected) { selected } else { host }
4runner := if string=?(host, arch) { list() } else { list(string-append("qemu-", arch)) }
5
6defpkgbuild(busybox-init,
7 #:pkgname, "busybox-init",
8 #:pkgver, "1.38.0",
9 #:pkgrel, 1,
10 #:pkgdesc, "BusyBox PID 1 for Vinix bootstrap images",
11 #:arch, [#:any],
12 #:license, "GPL-2.0-only",
13 #:url, "https://busybox.net/",
14 #:depends, ["busybox=1.38.0-5"],
15 #:check, fn() {
16 binary := string-append(get-environment-variable("VPAC_MAKEPKG_ROOT"), "/bin/busybox")
17 apply(run, append(runner, list(binary, "--help", "init")))
18 },
19 #:package, fn() {
20 run("install", "-d", string-append(pkgdir(), "/sbin"))
21 run("ln", "-s", "../bin/busybox", string-append(pkgdir(), "/sbin/init"))
22 })
23