|
|
|
@ -8,10 +8,8 @@ package("libxmake") |
|
|
|
|
"https://github.com/xmake-io/xmake.git", |
|
|
|
|
"https://gitlab.com/tboox/xmake.git") |
|
|
|
|
|
|
|
|
|
add_versions("v2.5.9", "5b50e3f28956cabcaa153624c91781730387ceb7c056f3f9b5306b1c77460d8f") |
|
|
|
|
add_versions("v2.7.1", "e44085090641547d8814afcc345d641d8ce1e38b6e05fee7375fc88150c0803d") |
|
|
|
|
add_versions("v2.7.9", "9b42d8634833f4885b05b89429dd60044dca99232f6096320b8d857fb33d2aef") |
|
|
|
|
|
|
|
|
|
add_configs("readline", { description = "Enable readline library.", default = false, type = "boolean"}) |
|
|
|
|
add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true}) |
|
|
|
|
|
|
|
|
|
add_includedirs("include") |
|
|
|
@ -24,50 +22,41 @@ package("libxmake") |
|
|
|
|
elseif is_plat("android") then |
|
|
|
|
add_syslinks("m", "c") |
|
|
|
|
elseif is_plat("macosx") then |
|
|
|
|
add_ldflags("-all_load", "-pagezero_size 10000", "-image_base 100000000") |
|
|
|
|
add_frameworks("CoreFoundation", "CoreServices") |
|
|
|
|
else |
|
|
|
|
add_syslinks("pthread", "dl", "m", "c") |
|
|
|
|
end |
|
|
|
|
add_defines("LUA_COMPAT_5_1", "LUA_COMPAT_5_2", "LUA_COMPAT_5_3") |
|
|
|
|
|
|
|
|
|
on_load(function (package) |
|
|
|
|
package:add("links", "xmake", "tbox", "sv", "lcurses") |
|
|
|
|
if package:is_plat("windows") then |
|
|
|
|
package:add("links", "pdcurses") |
|
|
|
|
else |
|
|
|
|
if not package:is_plat("windows") then |
|
|
|
|
package:add("deps", "ncurses") |
|
|
|
|
end |
|
|
|
|
if package:config("readline") then |
|
|
|
|
package:add("links", "readline") |
|
|
|
|
end |
|
|
|
|
if package:debug() then |
|
|
|
|
package:add("defines", "__tb_debug__") |
|
|
|
|
end |
|
|
|
|
package:add("links", "lua-cjson", "lz4") |
|
|
|
|
if not package:gitref() and package:version():le("2.5.9") then |
|
|
|
|
package:add("includedirs", "include/luajit") |
|
|
|
|
package:add("links", "luajit") |
|
|
|
|
else |
|
|
|
|
package:add("includedirs", "include/lua") |
|
|
|
|
package:add("links", "lua") |
|
|
|
|
end |
|
|
|
|
package:add("links", "lua") |
|
|
|
|
package:add("includedirs", "include/lua") |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install("linux", "macosx", "windows", function (package) |
|
|
|
|
local configs = {"--onlylib=y"} |
|
|
|
|
if package:is_plat("windows") then |
|
|
|
|
table.insert(configs, "--pdcurses=" .. (package:config("curses") and "y" or "n")) |
|
|
|
|
else |
|
|
|
|
table.insert(configs, "--curses=" .. (package:config("curses") and "y" or "n")) |
|
|
|
|
end |
|
|
|
|
if not package:gitref() and package:version():le("2.5.9") then |
|
|
|
|
io.replace("core/src/luajit/xmake.lua", "set_default(false)", "", {plain = true}) |
|
|
|
|
end |
|
|
|
|
table.insert(configs, "--readline=" .. (package:config("readline") and "y" or "n")) |
|
|
|
|
os.cd("core") |
|
|
|
|
io.replace("xmake.lua", 'set_warnings("all", "error")', "", {plain = true}) |
|
|
|
|
io.replace("xmake.lua", [[option("pdcurses") |
|
|
|
|
set_default(true) |
|
|
|
|
]], 'option("pdcurses")\nset_default(false)', {plain = true}) |
|
|
|
|
io.replace("src/xmake/engine.c", 'sysarch = "arm64"', 'sysarch = "arm64";', {plain = true}) |
|
|
|
|
io.replace("src/xmake/engine.c", 'sysarch = "arm"', 'sysarch = "arm";', {plain = true}) |
|
|
|
|
io.replace("src/sv/sv/include/semver.h", [[#if defined(_MSC_VER) |
|
|
|
|
typedef __int8 int8_t;]], '#if defined(_MSC_VER) && (_MSC_VER < 1600)\ntypedef __int8 int8_t;', {plain = true}) |
|
|
|
|
import("package.tools.xmake").install(package, configs) |
|
|
|
|
os.cp("../xmake", package:installdir("share")) |
|
|
|
|
if package:is_plat("linux", "macosx") and package:has_cfuncs("readline", {links = "readline", includes = "readline/readline.h"}) then |
|
|
|
|
package:add("syslinks", "readline") |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_test(function (package) |
|
|
|
|