Bladeren bron

Update luau to 0.638 (#4908)

* Update luau to 0.638

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

* Update xmake.lua

---------

Co-authored-by: c8ef <[email protected]>
Jérôme Leclercq 1 jaar geleden
bovenliggende
commit
063862d6bd
1 gewijzigde bestanden met toevoegingen van 26 en 10 verwijderingen
  1. 26 10
      packages/l/luau/xmake.lua

+ 26 - 10
packages/l/luau/xmake.lua

@@ -1,5 +1,4 @@
 package("luau")
 package("luau")
-
     set_homepage("https://luau-lang.org/")
     set_homepage("https://luau-lang.org/")
     set_description("A fast, small, safe, gradually typed embeddable scripting language derived from Lua.")
     set_description("A fast, small, safe, gradually typed embeddable scripting language derived from Lua.")
     set_license("MIT")
     set_license("MIT")
@@ -7,6 +6,7 @@ package("luau")
     add_urls("https://github.com/Roblox/luau/archive/$(version).tar.gz",
     add_urls("https://github.com/Roblox/luau/archive/$(version).tar.gz",
              "https://github.com/Roblox/luau.git")
              "https://github.com/Roblox/luau.git")
     
     
+    add_versions("0.638", "87ea29188f0d788e3b8649a063cda6b1e1804a648f425f4d0e65ec8449f2d171")
     add_versions("0.624", "6d5ce40a7dc0e17da51cc143d2ee1ab32727583c315938f5a69d13ef93ae574d")
     add_versions("0.624", "6d5ce40a7dc0e17da51cc143d2ee1ab32727583c315938f5a69d13ef93ae574d")
     add_versions("0.623", "5a72f9e5b996c5ec44ee2c7bd9448d2b2e5061bdf7d057de7490f92fb3003f40")
     add_versions("0.623", "5a72f9e5b996c5ec44ee2c7bd9448d2b2e5061bdf7d057de7490f92fb3003f40")
     add_versions("0.538", "8a1240e02a7daacf1e5cff249040a3298c013157fc496c66adce6dcb21cc30be")
     add_versions("0.538", "8a1240e02a7daacf1e5cff249040a3298c013157fc496c66adce6dcb21cc30be")
@@ -16,27 +16,43 @@ package("luau")
 
 
     add_deps("cmake")
     add_deps("cmake")
 
 
-    on_install("!bsd and !wasm", function(package)
+    on_install(function(package)
+        io.replace("extern/isocline/src/completers.c", "__finddata64_t", "_finddatai64_t", {plain = true})
+        io.replace("CMakeLists.txt", [[cmake_policy(SET CMP0054 NEW)]], [[
+            cmake_policy(SET CMP0054 NEW)
+            cmake_policy(SET CMP0057 NEW)
+        ]], {plain = true})
+
         local configs = {}
         local configs = {}
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "RelWithDebInfo"))
         table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "RelWithDebInfo"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         table.insert(configs, "-DLUAU_BUILD_TESTS=OFF")
         table.insert(configs, "-DLUAU_BUILD_TESTS=OFF")
-        table.insert(configs, "-DLUAU_BUILD_WEB=" .. (package:config("build_web") and "ON" or "OFF"))
+        table.insert(configs, "-DLUAU_BUILD_WEB=" .. ((package:is_plat("wasm") or package:config("build_web")) and "ON" or "OFF"))
         table.insert(configs, "-DLUAU_EXTERN_C=" .. (package:config("extern_c") and "ON" or "OFF"))
         table.insert(configs, "-DLUAU_EXTERN_C=" .. (package:config("extern_c") and "ON" or "OFF"))
-        import("package.tools.cmake").install(package, configs, { buildir = "build" })
 
 
-        io.replace("CMakeLists.txt", ".lib", "", {plain = true})
-        io.replace("Sources.cmake", ".lib", "", {plain = true})
+        if package:is_plat("bsd") then
+            io.replace("CMakeLists.txt", [[if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin|iOS")]], [[if(TRUE)]], {plain = true})
+        end
+
+        if package:is_plat("wasm") then
+            import("package.tools.cmake").build(package, configs, { target = "Luau.Web", buildir = "build" })
+        else
+            import("package.tools.cmake").install(package, configs, { buildir = "build" })
+        end
 
 
         local cmake_file = io.readfile("CMakeLists.txt")
         local cmake_file = io.readfile("CMakeLists.txt")
 
 
         local links = {}
         local links = {}
-        for library_name, library_type in string.gmatch(cmake_file, "add_library%(([%a|%.]+) ([STATIC|INTERFACE]+)") do
-            if string.startswith(library_name, "Luau.") then
-                if library_type == "STATIC" then
+        for library_name, library_type in cmake_file:gmatch("add_library%(([%a|%.]+) (%w+)") do
+            library_type = library_type:lower()
+            if library_name:startswith("Luau.") and (library_type == "static" or library_type == "interface") then
+                if library_name:endswith(".lib") then
+                    library_name = library_name:sub(1, -5)
+                end
+                if library_type == "static" then
                     table.insert(links, library_name)
                     table.insert(links, library_name)
                 end
                 end
-                local include_dir = library_name:gsub("Luau%.", "")
+                local include_dir = library_name:sub(6)
                 include_dir = include_dir:gsub("%..*", "")
                 include_dir = include_dir:gsub("%..*", "")
                 os.trycp(include_dir .. "/include/*", package:installdir("include"))
                 os.trycp(include_dir .. "/include/*", package:installdir("include"))
             end
             end