add premake5@{linux, mac, win} (#1294)
* add premake5 * support linux, mac, win * add path * set binary kind; rename to premake5 * rename * fix tag error in archlinux * fedora add deps uuid * on_install match host plat * fix fedora * fix typo * format according to package:mold * try fix fedora * try fix fedora * try fix fedora * temp save * ??? * test fedora replace makefile whether success * io.gsub * ??? * try to fix fukcing fedora * fuck * add plain * test * rm patch * hope it workspull/1299/head
parent
10af7342db
commit
a98347c883
1 changed files with 41 additions and 0 deletions
@ -0,0 +1,41 @@ |
||||
package("premake5") |
||||
set_kind("binary") |
||||
set_homepage("https://premake.github.io/") |
||||
set_description("Premake") |
||||
|
||||
set_urls("https://github.com/premake/premake-core.git") |
||||
add_versions("2022.06.21", "1c22240cc86cc3a12075cc0fc8b07ab209f99dd3") |
||||
|
||||
if is_plat("linux") and linuxos.name() == "fedora" then |
||||
add_deps("libuuid") |
||||
end |
||||
|
||||
on_install("@linux", "@macosx", "@windows", function (package) |
||||
local configs = {"-f", "Bootstrap.mak", package:plat()} |
||||
if package:is_plat("linux", "macosx") then |
||||
if linuxos.name() == "fedora" then |
||||
local cflags = {} |
||||
local ldflags = {} |
||||
local depinfo = package:dep("libuuid"):fetch() |
||||
for _, includedir in ipairs(depinfo.includedirs or depinfo.sysincludedirs) do |
||||
table.insert(cflags, "-I" .. includedir) |
||||
end |
||||
for _, linkdir in ipairs(depinfo.linkdirs) do |
||||
table.insert(ldflags, "-L" .. linkdir) |
||||
end |
||||
io.replace("Bootstrap.mak", "-luuid", table.concat(table.join(cflags, ldflags), " ") .. " -luuid") |
||||
io.replace("Bootstrap.mak", "$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)", "", {plain = true}) |
||||
import("package.tools.make").build(package, configs) |
||||
import("package.tools.make").build(package, {"-C", "build/bootstrap", "configs=release", "CPPFLAGS=" .. table.concat(cflags, " "), "LDFLAGS=" .. table.concat(ldflags, " ")}) |
||||
else |
||||
import("package.tools.make").build(package, configs) |
||||
end |
||||
else |
||||
import("package.tools.nmake").build(package, configs) |
||||
end |
||||
os.mv("bin/release/premake5" .. (package:is_plat("windows") and ".exe" or ""), package:installdir("bin")) |
||||
end) |
||||
|
||||
on_test(function (package) |
||||
os.vrun("premake5 --version") |
||||
end) |
Loading…
Reference in new issue