local package = {} local lfs = require("lfs") package.name = "gmake" package.version = "4.4.1" package.description = "the gnu implementation of make" package.arch = { "x86_64" } package.license = { "GPLv3" } package.deps = { build = { "dev-lang/clang" "sys-build/autoconf", }, } package.sources = { { path = "https://ftp.nluug.nl/pub/gnu/make/make-4.4.1.tar.gz", hash = "09a4ad8060259e36854b525ab610fd317a86f4926e44e3ab8adba75dccc8d4b445df9dd25ccfb4c25a54bc0e98238a9127e36401d74cbc3503a329eadcdf4995", out = "source.tar.gz", }, } -- shitty hack to remove version pinning and allow building on new autoconf versions local function process_file(path) local f = io.open(path, "r") if not f then return end local content = f:read("*a") f:close() if content:find("1[.-]16") then content = content:gsub("1([.-])16", "1%118") f = assert(io.open(path, "w")) f:write(content) f:close() print("Updated: " .. path) end end local function walk(dir) for entry in lfs.dir(dir) do if entry ~= "." and entry ~= ".." then local path = dir .. "/" .. entry local attr = lfs.attributes(path) if attr and attr.mode == "directory" then if entry ~= ".git" then walk(path) end elseif attr and attr.mode == "file" then process_file(path) end end end end package.build = function() print(lfs.currentdir()) pow.extract("source.tar.gz", "source") lfs.chdir("source/make-4.4.1") walk(".") os.execute("./configure") os.execute("make") end return package