local package = {} local lfs = require("lfs") package.name = "busybox" package.version = "1.38.0" package.description = "tiny single binary coreutils" package.arch = { "x86_64" } package.license = { "GPLv2" } package.deps = { build = { { provides = "cc" }, { provides = "make" }, }, } package.sources = { { path = "https://busybox.net/downloads/busybox-1.38.0.tar.bz2", hash = "71d1f0992bc99813e4e32d718004fadbd8315b300508094e37713555a2e394ca77f16874ec8be55961c0aa4141365dba27728e203895aadb2c112a84764a28d9", out = "source.tar.gz", }, } local function fix_config(path) path = path or ".config" local f = io.open(path, "r") if not f then return nil, "cannot open" end local s = f:read("*all") f:close() s = s:gsub("CONFIG_TC=y", "CONFIG_TC=n") f = io.open(path, "w") f:write(s) f:close() return true end -- tiny hack, disables TC to fix builds on kernel 6.8+ package.build = function() pow.extract("source.tar.gz", "source") lfs.chdir("source/busybox-1.38.0") os.execute("make defconfig") fix_config() local make_command = string.format("make %s", pow.config.makeopts) os.execute(make_command) end package.install = function() pow.install("busybox", "/bin/busybox") end return package