From 9daa93a17741f9cdef10c64ea7364f02e6f513a6 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sun, 18 Jan 2026 10:44:01 +0200 Subject: [PATCH] Add lua 5.5 support --- pkg.info | 2 +- source-files/lua5.5-support.patch | 94 +++++++++++++++++++++++++++++++ source.sh | 7 +++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100644 source-files/lua5.5-support.patch diff --git a/pkg.info b/pkg.info index 3b7061f..8985507 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: cmake description: A Powerful Software Build System version: 4.2.1 -revision: 1 +revision: 2 url: https://cmake.org/ license: BSD-3-Clause architecture: any diff --git a/source-files/lua5.5-support.patch b/source-files/lua5.5-support.patch new file mode 100644 index 0000000..7926fa3 --- /dev/null +++ b/source-files/lua5.5-support.patch @@ -0,0 +1,94 @@ +From 261b7b933c6604095687d473503e24bae6ec0d6f Mon Sep 17 00:00:00 2001 +From: Anton Melnikov +Date: Mon, 22 Dec 2025 13:55:41 -0500 +Subject: [PATCH] FindLua: Add support for Lua 5.5 + +Fixes: #27476 + +Co-authored-by: Tyler Yankee +--- + Modules/FindLua.cmake | 11 +++++++---- + Tests/RunCMake/FindLua/FindLuaTest.cmake | 8 ++++---- + Tests/RunCMake/FindLua/prefix2/include/lua5.5/lua.h | 10 ++++++++++ + 3 files changed, 21 insertions(+), 8 deletions(-) + create mode 100644 Tests/RunCMake/FindLua/prefix2/include/lua5.5/lua.h + +diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake +index 33fd8fde9f5..d37ad81a924 100644 +--- a/Modules/FindLua.cmake ++++ b/Modules/FindLua.cmake +@@ -16,6 +16,9 @@ Lua is a embeddable scripting language. + .. versionadded:: 3.18 + Support for Lua 5.4. + ++.. versionadded:: 4.3 ++ Support for Lua 5.5. ++ + When working with Lua, its library headers are intended to be included in + project source code as: + +@@ -144,7 +147,7 @@ unset(_lua_append_versions) + + # this is a function only to have all the variables inside go away automatically + function(_lua_get_versions) +- set(LUA_VERSIONS5 5.4 5.3 5.2 5.1 5.0) ++ set(LUA_VERSIONS5 5.5 5.4 5.3 5.2 5.1 5.0) + + if (Lua_FIND_VERSION_EXACT) + if (Lua_FIND_VERSION_COUNT GREATER 1) +@@ -214,11 +217,11 @@ function(_lua_get_header_version) + file(STRINGS "${_hdr_file}" lua_version_strings + REGEX "^#define[ \t]+LUA_(RELEASE[ \t]+\"Lua [0-9]|VERSION([ \t]+\"Lua [0-9]|_[MR])).*") + +- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" Lua_VERSION_MAJOR ";${lua_version_strings};") ++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MAJOR(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" Lua_VERSION_MAJOR ";${lua_version_strings};") + + if (Lua_VERSION_MAJOR MATCHES "^[0-9]+$") +- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" Lua_VERSION_MINOR ";${lua_version_strings};") +- string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE[ \t]+\"([0-9])\"[ \t]*;.*" "\\1" Lua_VERSION_PATCH ";${lua_version_strings};") ++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_MINOR(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" Lua_VERSION_MINOR ";${lua_version_strings};") ++ string(REGEX REPLACE ".*;#define[ \t]+LUA_VERSION_RELEASE(_N)?[ \t]+\"?([0-9])\"?[ \t]*;.*" "\\2" Lua_VERSION_PATCH ";${lua_version_strings};") + set(Lua_VERSION "${Lua_VERSION_MAJOR}.${Lua_VERSION_MINOR}.${Lua_VERSION_PATCH}") + else () + string(REGEX REPLACE ".*;#define[ \t]+LUA_RELEASE[ \t]+\"Lua ([0-9.]+)\"[ \t]*;.*" "\\1" Lua_VERSION ";${lua_version_strings};") +diff --git a/Tests/RunCMake/FindLua/FindLuaTest.cmake b/Tests/RunCMake/FindLua/FindLuaTest.cmake +index df3fc567415..da29d06f58b 100644 +--- a/Tests/RunCMake/FindLua/FindLuaTest.cmake ++++ b/Tests/RunCMake/FindLua/FindLuaTest.cmake +@@ -64,13 +64,13 @@ endfunction() + # Simple test + test_path(prefix1 prefix1/include 5.3) + # Find highest version +-test_path(prefix2 prefix2/include/lua5.3 5.3) +-foreach(ver 5.3 5.2 5.1) ++test_path(prefix2 prefix2/include/lua5.5 5.5) ++foreach(ver 5.5 5.3 5.2 5.1) + # At least X or X.0 -> Highest + set(VERSION "${ver}") +- test_path(prefix2 prefix2/include/lua5.3 5.3) ++ test_path(prefix2 prefix2/include/lua5.5 5.5) + set(VERSION "${ver}.0") +- test_path(prefix2 prefix2/include/lua5.3 5.3) ++ test_path(prefix2 prefix2/include/lua5.5 5.5) + # Exactly X/X.0 + set(VERSION "${ver}" EXACT) + test_path(prefix2 prefix2/include/lua${ver} ${ver}) +diff --git a/Tests/RunCMake/FindLua/prefix2/include/lua5.5/lua.h b/Tests/RunCMake/FindLua/prefix2/include/lua5.5/lua.h +new file mode 100644 +index 00000000000..1588b480d33 +--- /dev/null ++++ b/Tests/RunCMake/FindLua/prefix2/include/lua5.5/lua.h +@@ -0,0 +1,10 @@ ++ ++#define LUA_VERSION_MAJOR_N 5 ++#define LUA_VERSION_MINOR_N 5 ++#define LUA_VERSION_RELEASE_N 0 ++ ++#define LUA_VERSION_NUM (LUA_VERSION_MAJOR_N * 100 + LUA_VERSION_MINOR_N) ++#define LUA_VERSION_RELEASE_NUM (LUA_VERSION_NUM * 100 + LUA_VERSION_RELEASE_N) ++ ++#define LUA_VERSION "Lua " LUA_VERSION_MAJOR "." LUA_VERSION_MINOR ++#define LUA_RELEASE LUA_VERSION "." LUA_VERSION_RELEASE +-- +GitLab + diff --git a/source.sh b/source.sh index e96548f..0fae596 100644 --- a/source.sh +++ b/source.sh @@ -2,6 +2,13 @@ # BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE # BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + patch -Np1 -i "$BPM_WORKDIR"/lua5.5-support.patch +} + # The build function is executed in the source directory # This function is used to compile the source code build() {