Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 955988

Summary: games-strategy/wesnoth: uses bundled Lua
Product: Gentoo Linux Reporter: Sam James <sam>
Component: Current packagesAssignee: Gentoo Games <games>
Status: CONFIRMED ---    
Severity: normal CC: esigra
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 251464    

Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-15 09:45:26 UTC
Wesnoth appears to use bundled Lua, at least in 1.18.4 and 1.19.11.

The last mention of the dev-lang/lua dep seems to be in:

commit 9320a11fecbd758ca073072ebc06750313fbcdbb
Author: Andreas Sturmlechner <asturm@gentoo.org>
Date:   Sun Jun 3 15:54:54 2018 +0200

    games-strategy/wesnoth: Drop old

    Package-Manager: Portage-2.3.40, Repoman-2.3.9

But it takes ages and ages after that to get to the commit which *dropped* dev-lang/lua, which is weird, as I was expecting to find some commit dropping it (rather than just a cleanup of old). It looks like it actually never got propagated to the newer version for bug 299068:

commit 97a77fda06586b1d1a42b6a707bd603d61ed24c1
Author: Michael Sterrett <mr_bones_@gentoo.org>
Date:   Thu Dec 31 17:04:21 2009 +0000

    needs lua to build as well (bug #299068)
    (Portage version: 2.1.6.13/cvs/Linux i686)

which added it to 1.7.x, but not 1.6.x actually? Whatever.

Anyway, CMakeLists.txt on master has:
```
if(NOT WIN32)
	set(Lua_FIND_VERSION_MAJOR 5)
	set(Lua_FIND_VERSION_MINOR 4)
	option(ENABLE_SYSTEM_LUA "Enable use of system Lua ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR} (compiled as C++)" OFF)
endif()
if(ENABLE_SYSTEM_LUA)
	set(Lua_FIND_VERSION_EXACT ON)
	set(Lua_FIND_VERSION_COUNT 2)
	include(FindLua)
	if(NOT LUA_FOUND)
		message(FATAL_ERROR "Lua ${Lua_FIND_VERSION_MAJOR}.${Lua_FIND_VERSION_MINOR} C++ not found. Try setting 'LUA_DIR'.")
	endif()
else()
	if(NOT EXISTS "${CMAKE_SOURCE_DIR}/src/modules/lua/.git")
		message(FATAL_ERROR "Lua submodule does not exist. You must run 'git submodule update --init --recursive' to initialize it.")
	else()
		message("-- Lua submodule found.")
	endif()
endif()
```

We should set ENABLE_SYSTEM_LUA and wire up use of the lua-* eclass.