Skip to content

Commit 063862d

Browse files
SirLynixc8ef
andauthored
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]>
1 parent ac88666 commit 063862d

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

packages/l/luau/xmake.lua

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package("luau")
2-
32
set_homepage("https://luau-lang.org/")
43
set_description("A fast, small, safe, gradually typed embeddable scripting language derived from Lua.")
54
set_license("MIT")
65

76
add_urls("https://github.com/Roblox/luau/archive/$(version).tar.gz",
87
"https://github.com/Roblox/luau.git")
98

9+
add_versions("0.638", "87ea29188f0d788e3b8649a063cda6b1e1804a648f425f4d0e65ec8449f2d171")
1010
add_versions("0.624", "6d5ce40a7dc0e17da51cc143d2ee1ab32727583c315938f5a69d13ef93ae574d")
1111
add_versions("0.623", "5a72f9e5b996c5ec44ee2c7bd9448d2b2e5061bdf7d057de7490f92fb3003f40")
1212
add_versions("0.538", "8a1240e02a7daacf1e5cff249040a3298c013157fc496c66adce6dcb21cc30be")
@@ -16,27 +16,43 @@ package("luau")
1616

1717
add_deps("cmake")
1818

19-
on_install("!bsd and !wasm", function(package)
19+
on_install(function(package)
20+
io.replace("extern/isocline/src/completers.c", "__finddata64_t", "_finddatai64_t", {plain = true})
21+
io.replace("CMakeLists.txt", [[cmake_policy(SET CMP0054 NEW)]], [[
22+
cmake_policy(SET CMP0054 NEW)
23+
cmake_policy(SET CMP0057 NEW)
24+
]], {plain = true})
25+
2026
local configs = {}
2127
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "RelWithDebInfo"))
2228
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
2329
table.insert(configs, "-DLUAU_BUILD_TESTS=OFF")
24-
table.insert(configs, "-DLUAU_BUILD_WEB=" .. (package:config("build_web") and "ON" or "OFF"))
30+
table.insert(configs, "-DLUAU_BUILD_WEB=" .. ((package:is_plat("wasm") or package:config("build_web")) and "ON" or "OFF"))
2531
table.insert(configs, "-DLUAU_EXTERN_C=" .. (package:config("extern_c") and "ON" or "OFF"))
26-
import("package.tools.cmake").install(package, configs, { buildir = "build" })
2732

28-
io.replace("CMakeLists.txt", ".lib", "", {plain = true})
29-
io.replace("Sources.cmake", ".lib", "", {plain = true})
33+
if package:is_plat("bsd") then
34+
io.replace("CMakeLists.txt", [[if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin|iOS")]], [[if(TRUE)]], {plain = true})
35+
end
36+
37+
if package:is_plat("wasm") then
38+
import("package.tools.cmake").build(package, configs, { target = "Luau.Web", buildir = "build" })
39+
else
40+
import("package.tools.cmake").install(package, configs, { buildir = "build" })
41+
end
3042

3143
local cmake_file = io.readfile("CMakeLists.txt")
3244

3345
local links = {}
34-
for library_name, library_type in string.gmatch(cmake_file, "add_library%(([%a|%.]+) ([STATIC|INTERFACE]+)") do
35-
if string.startswith(library_name, "Luau.") then
36-
if library_type == "STATIC" then
46+
for library_name, library_type in cmake_file:gmatch("add_library%(([%a|%.]+) (%w+)") do
47+
library_type = library_type:lower()
48+
if library_name:startswith("Luau.") and (library_type == "static" or library_type == "interface") then
49+
if library_name:endswith(".lib") then
50+
library_name = library_name:sub(1, -5)
51+
end
52+
if library_type == "static" then
3753
table.insert(links, library_name)
3854
end
39-
local include_dir = library_name:gsub("Luau%.", "")
55+
local include_dir = library_name:sub(6)
4056
include_dir = include_dir:gsub("%..*", "")
4157
os.trycp(include_dir .. "/include/*", package:installdir("include"))
4258
end

0 commit comments

Comments
 (0)