Sfoglia il codice sorgente

update genie (#3264)

* update genie

* fix msys

* fix debug mode
Hoildkv 1 anno fa
parent
commit
f3e279819d
2 ha cambiato i file con 39 aggiunte e 13 eliminazioni
  1. 30 0
      packages/g/genie/port/xmake.lua
  2. 9 13
      packages/g/genie/xmake.lua

+ 30 - 0
packages/g/genie/port/xmake.lua

@@ -0,0 +1,30 @@
+add_rules("mode.release")
+target("genie")
+    set_kind("binary")
+    on_load(function (target)
+        local lua_ver
+        for _, dir in ipairs(os.dirs("src/host/*")) do
+            if dir:find("lua-", 1, true) then
+                lua_ver = dir:match("lua%-(%d+%.%d+%.%d+)")
+                break
+            end
+        end
+        assert(lua_ver, "lua directory not found!")
+        local lua_src = "src/host/lua-" .. lua_ver .. "/src"
+        target:add("includedirs", lua_src)
+        target:add("files", lua_src .. "/*.c|lua.c|luac.c")
+    end)
+    add_files("src/host/*.c")
+    add_defines("LUA_COMPAT_MODULE")
+    if is_plat("windows", "mingw", "msys") then
+        add_syslinks("ole32")
+    elseif is_plat("macosx") then
+        add_defines("LUA_USE_MACOSX")
+        add_frameworks("CoreServices")
+    elseif is_plat("linux") then
+        add_defines("LUA_USE_POSIX", "LUA_USE_DLOPEN", "_FILE_OFFSET_BITS=64")
+        add_syslinks("dl", "m")
+    elseif is_plat("bsd") then
+        add_defines("LUA_USE_POSIX", "LUA_USE_DLOPEN")
+        add_syslinks("m")
+    end

+ 9 - 13
packages/g/genie/xmake.lua

@@ -3,22 +3,18 @@ package("genie")
     set_kind("binary")
     set_homepage("https://github.com/bkaradzic/GENie")
     set_description("GENie - Project generator tool")
+    set_license("BSD-3-Clause")
 
-    if is_host("windows") then
-        add_urls("https://raw.githubusercontent.com/bkaradzic/bx/aa5090bbd8c39e84d483f4850a7d9ca7ff9241ed/tools/bin/windows/genie.exe")
-        add_versions("1160.0", "a1226a0098f6ff4895a423df17737af90cc0af9effce7cc81fe904c9b2e02e8f")
-    else
-        add_urls("https://github.com/bkaradzic/GENie.git")
-        add_versions("1160.0", "0f5133b66d103efbcdf7c0d23f6cb6b353282e38")
-    end
+    add_urls("https://github.com/bkaradzic/GENie.git")
+    add_versions("1160", "f9bd455a8439dbcb807816c0be9e4aedf5991bc3")
+    add_versions("1165", "5461c5ab94d0365c40031fef8f459b9c21b4d37a")
+    add_versions("1170", "22cc907a4351db46c55f73e6aa901f1b2f0c52ad")
 
-    on_install("@windows", function (package)
-        os.cp(package:originfile(), package:installdir("bin"))
-    end)
+    add_configs("debug", {description = "Enable debug scripts.", default = false, type = "boolean", readonly = true})
 
-    on_install("@macosx", "@linux", function (package)
-        import("package.tools.make").build(package, configs)
-        os.cp("bin/*/genie", package:installdir("bin"))
+    on_install("@windows", "@msys", "@macosx", "@linux", function (package)
+        os.cp(path.join(os.scriptdir(), "port", "xmake.lua"), "xmake.lua")
+        import("package.tools.xmake").install(package)
     end)
 
     on_test(function (package)