Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ports/lua/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ INSTALL ( TARGETS lua
ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/lib
)

IF (NOT DEFINED SKIP_INSTALL_TOOLS)
IF (INSTALL_TOOLS)
ADD_EXECUTABLE ( luac src/luac.c ${SRC_LIBLUA} ) # compiler uses non-exported APIs, so must include sources directly.
ADD_EXECUTABLE ( luai src/lua.c ) # interpreter
TARGET_LINK_LIBRARIES ( luai lua )
Expand Down
7 changes: 0 additions & 7 deletions ports/lua/CONTROL

This file was deleted.

29 changes: 29 additions & 0 deletions ports/lua/fix-ios-system.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
diff --git a/src/loslib.c b/src/loslib.c
index e65e188..3595601 100644
--- a/src/loslib.c
+++ b/src/loslib.c
@@ -3,7 +3,9 @@
** Standard Operating System library
** See Copyright Notice in lua.h
*/
-
+#if defined(__APPLE__)
+#include <TargetConditionals.h>
+#endif
#define loslib_c
#define LUA_LIB

@@ -143,7 +145,12 @@ static int os_execute (lua_State *L) {
const char *cmd = luaL_optstring(L, 1, NULL);
int stat;
errno = 0;
- stat = system(cmd);
+#if defined(__APPLE__) && !TARGET_OS_OSX
+ // system() is __IOS_PROHIBITED, __WATCHOS_PROHIBITED, and __TVOS_PROHIBITED.
+ stat = 127; // error: shell execution failed
+#else
+ stat = system(cmd);
+#endif
if (cmd != NULL)
return luaL_execresult(L, stat);
else {
24 changes: 16 additions & 8 deletions ports/lua/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,41 +6,49 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
PATCHES vs2015-impl-c99.patch
PATCHES
vs2015-impl-c99.patch
fix-ios-system.patch
)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools INSTALL_TOOLS
)
if(VCPKG_TARGET_IS_IOS AND "tools" IN_LIST FEATURES)
message(FATAL_ERROR "lua[tools] is not supported for iOS platform build")
endif()

set(ENABLE_LUA_CPP 0)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_RELEASE
${FEATURE_OPTIONS}
OPTIONS
-DCOMPILE_AS_CPP=OFF
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
-DSKIP_INSTALL_TOOLS=ON
)

vcpkg_install_cmake()

set(ENABLE_LUA_CPP 0)
if("cpp" IN_LIST FEATURES)
if("cpp" IN_LIST FEATURES) # lua[cpp] will create lua-c++, which uses C++ name mangling.
set(ENABLE_LUA_CPP 1)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DCOMPILE_AS_CPP=ON
OPTIONS_DEBUG
-DSKIP_INSTALL_HEADERS=ON
-DSKIP_INSTALL_TOOLS=ON
)

vcpkg_install_cmake()
endif()

vcpkg_copy_pdbs()

vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/lua)

if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
Expand Down
15 changes: 15 additions & 0 deletions ports/lua/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "lua",
"version-string": "5.4.3",
"port-version": 1,
"description": "A powerful, fast, lightweight, embeddable scripting language",
"homepage": "https://www.lua.org",
"features": {
"cpp": {
"description": "Builds Lua for C++ linkage"
},
"tools": {
"description": "Builds Lua compiler and interpreter"
}
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3734,7 +3734,7 @@
},
"lua": {
"baseline": "5.4.3",
"port-version": 0
"port-version": 1
},
"luabridge": {
"baseline": "2.6",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/lua.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "0e8966273a1a18cf591cf78046d345c74941a37d",
"version-string": "5.4.3",
"port-version": 1
},
{
"git-tree": "8a52fbd7ff551d4c1b7e6d308283cfe92ca81758",
"version-string": "5.4.3",
Expand Down