summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2021-05-12 14:22:58 +0200
committerMarek Szuba <marecki@gentoo.org>2021-05-12 14:40:16 +0200
commitc6d606c90397919c91e51daf3f0f0557727f1271 (patch)
tree2fd21e656e4cfe0af63f6db91a39c6712717a413 /games-action
parentmedia-gfx/brscan4: QA_PREBUILT is a relative path (diff)
downloadgentoo-c6d606c90397919c91e51daf3f0f0557727f1271.tar.gz
gentoo-c6d606c90397919c91e51daf3f0f0557727f1271.tar.bz2
gentoo-c6d606c90397919c91e51daf3f0f0557727f1271.zip
games-action/minetest: support lua5-1 target
Minetest *does* support PUC Lua 5.1, it's just that upstream build scripts only account for using the bundled sources. Patch the upstream FindLua.cmake so that unless LuaJIT support is requested, the system version of PUC Lua is used. Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'games-action')
-rw-r--r--games-action/minetest/files/minetest-5.4.1-system_puc_lua.patch39
-rw-r--r--games-action/minetest/minetest-5.4.1.ebuild8
2 files changed, 45 insertions, 2 deletions
diff --git a/games-action/minetest/files/minetest-5.4.1-system_puc_lua.patch b/games-action/minetest/files/minetest-5.4.1-system_puc_lua.patch
new file mode 100644
index 000000000000..7f49b427e8ee
--- /dev/null
+++ b/games-action/minetest/files/minetest-5.4.1-system_puc_lua.patch
@@ -0,0 +1,39 @@
+Upstream build scripts use either system LuaJIT or bundled PUC Lua 5.1.
+Make it possible to use the system version of the latter too.
+
+--- a/cmake/Modules/FindLua.cmake
++++ b/cmake/Modules/FindLua.cmake
+@@ -2,27 +2,12 @@
+ # This selects LuaJIT by default
+
+ option(ENABLE_LUAJIT "Enable LuaJIT support" TRUE)
+-set(USE_LUAJIT FALSE)
+-option(REQUIRE_LUAJIT "Require LuaJIT support" FALSE)
+-if(REQUIRE_LUAJIT)
+- set(ENABLE_LUAJIT TRUE)
+-endif()
+ if(ENABLE_LUAJIT)
+- find_package(LuaJIT)
+- if(LUAJIT_FOUND)
+- set(USE_LUAJIT TRUE)
+- message (STATUS "Using LuaJIT provided by system.")
+- elseif(REQUIRE_LUAJIT)
+- message(FATAL_ERROR "LuaJIT not found whereas REQUIRE_LUAJIT=\"TRUE\" is used.\n"
+- "To continue, either install LuaJIT or do not use REQUIRE_LUAJIT=\"TRUE\".")
+- endif()
++ find_package(LuaJIT REQUIRED)
++ set(USE_LUAJIT TRUE)
++ message (STATUS "Using LuaJIT provided by system.")
+ else()
+- message (STATUS "LuaJIT detection disabled! (ENABLE_LUAJIT=0)")
+-endif()
+-
+-if(NOT USE_LUAJIT)
+- message(STATUS "LuaJIT not found, using bundled Lua.")
+- set(LUA_LIBRARY lua)
+- set(LUA_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/lua/src)
+- add_subdirectory(lib/lua)
++ find_package(Lua51 REQUIRED)
++ set(USE_LUAJIT FALSE)
++ message(STATUS "Using Lua5.1 provided by system.")
+ endif()
diff --git a/games-action/minetest/minetest-5.4.1.ebuild b/games-action/minetest/minetest-5.4.1.ebuild
index 6304747349ed..453757efe399 100644
--- a/games-action/minetest/minetest-5.4.1.ebuild
+++ b/games-action/minetest/minetest-5.4.1.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-LUA_COMPAT=( luajit )
+LUA_COMPAT=( lua5-1 luajit )
inherit cmake lua-single xdg
@@ -62,6 +62,10 @@ BDEPEND="
)
nls? ( sys-devel/gettext )"
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.4.1-system_puc_lua.patch
+)
+
src_prepare() {
cmake_src_prepare
@@ -91,7 +95,7 @@ src_configure() {
-DENABLE_GETTEXT=$(usex nls)
-DENABLE_GLES=0
-DENABLE_LEVELDB=$(usex leveldb)
- -DENABLE_LUAJIT=1
+ -DENABLE_LUAJIT=$(usex lua_single_target_luajit)
-DENABLE_POSTGRESQL=$(usex postgres)
-DENABLE_PROMETHEUS=$(usex prometheus)
-DENABLE_REDIS=$(usex redis)