Skip to content

Commit cda2aae

Browse files
luau: add version 0.700, cleanup, modernize (conan-io#28927)
1 parent fb02a78 commit cda2aae

File tree

4 files changed

+56
-88
lines changed

4 files changed

+56
-88
lines changed

recipes/luau/all/CMakeLists.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ add_subdirectory(${LUAU_SRC_DIR})
88
## installer
99
include(GNUInstallDirs)
1010

11+
install(
12+
TARGETS Luau.Common
13+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
14+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
15+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
16+
)
17+
install(DIRECTORY "${LUAU_SRC_DIR}/Common/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
18+
19+
1120
install(
1221
TARGETS Luau.Ast
1322
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -16,6 +25,15 @@ install(
1625
)
1726
install(DIRECTORY "${LUAU_SRC_DIR}/Ast/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
1827

28+
29+
install(
30+
TARGETS Luau.Config
31+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
32+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
33+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
34+
)
35+
install(DIRECTORY "${LUAU_SRC_DIR}/Config/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
36+
1937
install(
2038
TARGETS Luau.Compiler
2139
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
@@ -59,6 +77,15 @@ install(FILES
5977
"${LUAU_SRC_DIR}/VM/include/lualib.h"
6078
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
6179

80+
install(
81+
TARGETS Luau.Require
82+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
83+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
84+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
85+
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
86+
)
87+
install(DIRECTORY "${LUAU_SRC_DIR}/Require/include/Luau" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
88+
6289
if(LUAU_BUILD_CLI)
6390
install(
6491
TARGETS Luau.Repl.CLI

recipes/luau/all/conandata.yml

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,4 @@
11
sources:
2-
"0.667":
3-
url: "https://github.com/Roblox/luau/archive/0.667.tar.gz"
4-
sha256: "a8ffc0c8505fb0546f9d0007f3a2c74b08e602f5a6b864381e3a24fd74e936bc"
5-
"0.655":
6-
url: "https://github.com/Roblox/luau/archive/0.655.tar.gz"
7-
sha256: "1c0ff05ce18493d6c83062a17cf6822a71ce254bfa0db41dd086d313b674ca33"
8-
"0.650":
9-
url: "https://github.com/Roblox/luau/archive/0.650.tar.gz"
10-
sha256: "a605ae7a188455844ab131ff0d2df6f38c088142d6bd5eebb87795e619c3d7aa"
11-
"0.645":
12-
url: "https://github.com/Roblox/luau/archive/0.645.tar.gz"
13-
sha256: "28aaa3e57e7adc44debedc6be9802f2625334eef0124ff722c8ab340dc6bbe1c"
14-
"0.640":
15-
url: "https://github.com/Roblox/luau/archive/0.640.tar.gz"
16-
sha256: "63ada3e4c8c17e5aff8964b16951bfd1b567329dd81c11ae1144b6e95f354762"
17-
"0.635":
18-
url: "https://github.com/Roblox/luau/archive/0.635.tar.gz"
19-
sha256: "b2ec66070bb53ab9c26e41608dd75c9672c942cf0738c4b965c5eb956a954910"
20-
"0.630":
21-
url: "https://github.com/Roblox/luau/archive/0.630.tar.gz"
22-
sha256: "601938ebd428d37c2bb10697500bff4fe304f7c0651cf64721b9dc5600a30ed9"
23-
"0.625":
24-
url: "https://github.com/Roblox/luau/archive/0.625.tar.gz"
25-
sha256: "4dd9295a67c2de6536b6e1208ea81cebfc5caefadcdacd7e09341c7a1dbbb9e2"
26-
"0.620":
27-
url: "https://github.com/Roblox/luau/archive/0.620.tar.gz"
28-
sha256: "a6ae1f0396334e72b1241dabb73aa123037613f3276bf2e71d0dc75568b1eb52"
2+
"0.700":
3+
url: "https://github.com/Roblox/luau/archive/0.700.tar.gz"
4+
sha256: "e0dffe07a4b27c568b9688916e1d97ba7204b7a4d487d0a03648c99b88fc8df8"

recipes/luau/all/conanfile.py

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
from conan.errors import ConanInvalidConfiguration
33
from conan.tools.files import get, copy
44
from conan.tools.build import check_min_cppstd
5-
from conan.tools.scm import Version
65
from conan.tools.cmake import CMake, CMakeToolchain, cmake_layout
76

87
import os
98

10-
required_conan_version = ">=1.53.0"
9+
required_conan_version = ">=2"
1110

1211
class LuauConan(ConanFile):
1312
name = "luau"
@@ -29,34 +28,14 @@ class LuauConan(ConanFile):
2928
"native_code_gen": False,
3029
}
3130

32-
@property
33-
def _minimum_cpp_standard(self):
34-
return 17
35-
36-
@property
37-
def _compilers_minimum_version(self):
38-
return {
39-
"gcc": "9",
40-
"clang": "7",
41-
"apple-clang": "12",
42-
"Visual Studio": "15",
43-
"msvc": "191",
44-
}
45-
4631
def export_sources(self):
4732
copy(self, "CMakeLists.txt", self.recipe_folder, self.export_sources_folder)
4833

4934
def layout(self):
5035
cmake_layout(self, src_folder="src")
5136

5237
def validate(self):
53-
if self.settings.compiler.cppstd:
54-
check_min_cppstd(self, self._minimum_cpp_standard)
55-
minimum_version = self._compilers_minimum_version.get(str(self.settings.compiler), False)
56-
if minimum_version and Version(self.settings.compiler.version) < minimum_version:
57-
raise ConanInvalidConfiguration(
58-
f"{self.ref} requires C++{self._minimum_cpp_standard}, which your compiler does not support."
59-
)
38+
check_min_cppstd(self, 17)
6039

6140
def source(self):
6241
get(self, **self.conan_data["sources"][self.version], strip_root=True)
@@ -85,40 +64,42 @@ def package(self):
8564
def package_info(self):
8665
self.cpp_info.set_property("cmake_file_name", "Luau")
8766
self.cpp_info.set_property("cmake_target_name", "Luau::Luau")
88-
89-
self.cpp_info.filenames["cmake_find_package"] = "Luau"
90-
self.cpp_info.filenames["cmake_find_package_multi"] = "Luau"
91-
self.cpp_info.names["cmake_find_package_multi"] = "Luau"
92-
self.cpp_info.names["cmake_find_package"] = "Luau"
93-
67+
# Common
68+
self.cpp_info.components["Common"].libs = ["Luau.Common"]
69+
self.cpp_info.components["Common"].set_property("cmake_target_name", "Luau::Common")
70+
# Ast
9471
self.cpp_info.components["Ast"].libs = ["Luau.Ast"]
9572
self.cpp_info.components["Ast"].set_property("cmake_target_name", "Luau::Ast")
96-
73+
self.cpp_info.components["Ast"].requires = ["Common"]
74+
# VM
9775
self.cpp_info.components["VM"].libs = ["Luau.VM"]
9876
self.cpp_info.components["VM"].set_property("cmake_target_name", "Luau::VM")
99-
self.cpp_info.components["VM"].requires = ["Ast"]
77+
self.cpp_info.components["VM"].requires = ["Common"]
10078
if self.settings.os in ["Linux", "FreeBSD"]:
10179
self.cpp_info.components["VM"].system_libs = ["m"]
102-
80+
# Analysis
10381
self.cpp_info.components["Analysis"].libs = ["Luau.Analysis"]
10482
self.cpp_info.components["Analysis"].set_property("cmake_target_name", "Luau::Analysis")
105-
self.cpp_info.components["Analysis"].requires = ["Ast"]
106-
83+
self.cpp_info.components["Analysis"].requires = ["Ast", "Config", "Compiler", "VM"]
84+
# Config
85+
self.cpp_info.components["Config"].libs = ["Luau.Config"]
86+
self.cpp_info.components["Config"].set_property("cmake_target_name", "Luau::Config")
87+
self.cpp_info.components["Config"].requires = ["Ast", "Compiler", "VM"]
88+
# Compiler
10789
self.cpp_info.components["Compiler"].libs = ["Luau.Compiler"]
10890
self.cpp_info.components["Compiler"].set_property("cmake_target_name", "Luau::Compiler")
10991
self.cpp_info.components["Compiler"].requires = ["Ast"]
110-
92+
# CodeGen
11193
self.cpp_info.components["CodeGen"].libs = ["Luau.CodeGen"]
11294
self.cpp_info.components["CodeGen"].set_property("cmake_target_name", "Luau::CodeGen")
113-
self.cpp_info.components["CodeGen"].requires = ["Ast"]
114-
self.cpp_info.components["CodeGen"].requires.append("VM")
115-
116-
if self.options.with_cli:
117-
bin_path = os.path.join(self.package_folder, "bin")
118-
self.output.info(f"Appending PATH environment variable: {bin_path}")
119-
self.env_info.PATH.append(bin_path)
120-
95+
self.cpp_info.components["CodeGen"].requires = ["VM", "Common"]
96+
# Require
97+
self.cpp_info.components["Require"].libs = ["Luau.Require"]
98+
self.cpp_info.components["Require"].set_property("cmake_target_name", "Luau::Require")
99+
self.cpp_info.components["Require"].requires = ["Config", "VM"]
100+
# Web
121101
if self.options.with_web:
122102
self.cpp_info.components["Web"].libs = ["Luau.Web"]
123103
self.cpp_info.components["Web"].set_property("cmake_target_name", "Luau::Web")
124-
self.cpp_info.components["Web"].requires = ["Compiler", "VM"]
104+
self.cpp_info.components["Web"].requires = ["Compiler", "VM", "Analysis"]
105+

recipes/luau/config.yml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,3 @@
11
versions:
2-
"0.667":
3-
folder: all
4-
"0.655":
5-
folder: all
6-
"0.650":
7-
folder: all
8-
"0.645":
9-
folder: all
10-
"0.640":
11-
folder: all
12-
"0.635":
13-
folder: all
14-
"0.630":
15-
folder: all
16-
"0.625":
17-
folder: all
18-
"0.620":
2+
"0.700":
193
folder: all

0 commit comments

Comments
 (0)