commit:     1bebdf7b67974441a745e299d644dbf7f1c96eb3
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Sun Jul 11 23:34:09 2021 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Jul 14 05:46:21 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1bebdf7b

games-engines/openmw: add lua support

Package-Manager: Portage-3.0.20, Repoman-3.0.2
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/21606
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 games-engines/openmw/openmw-9999.ebuild | 25 ++++++++++++++++++++++---
 1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/games-engines/openmw/openmw-9999.ebuild 
b/games-engines/openmw/openmw-9999.ebuild
index 9b13f4d95f9..82aa73331fd 100644
--- a/games-engines/openmw/openmw-9999.ebuild
+++ b/games-engines/openmw/openmw-9999.ebuild
@@ -3,7 +3,8 @@
 
 EAPI=7
 
-inherit cmake flag-o-matic xdg-utils readme.gentoo-r1
+LUA_COMPAT=( lua5-{1,3,4} luajit )
+inherit cmake flag-o-matic lua-single xdg-utils readme.gentoo-r1
 
 DESCRIPTION="Open source reimplementation of TES III: Morrowind"
 HOMEPAGE="https://openmw.org/ https://gitlab.com/OpenMW/openmw";
@@ -20,12 +21,13 @@ fi
 LICENSE="GPL-3 MIT BitstreamVera ZLIB"
 SLOT="0"
 IUSE="doc devtools +osg-fork test +qt5"
+REQUIRED_USE="${LUA_REQUIRED_USE}"
 RESTRICT="!test? ( test )"
 
 # FIXME: Unbundle dev-games/openscenegraph-qt in extern/osgQt directory,
 # used when BUILD_OPENCS flag is enabled. See bug #676266.
 
-RDEPEND="
+RDEPEND="${LUA_DEPS}
        app-arch/lz4
        dev-games/mygui
        dev-games/recastnavigation
@@ -48,7 +50,9 @@ RDEPEND="
        )
 "
 
-DEPEND="${RDEPEND}"
+DEPEND="${RDEPEND}
+       dev-cpp/sol2
+"
 
 BDEPEND="
        virtual/pkgconfig
@@ -70,6 +74,7 @@ src_prepare() {
 
        # Use the system tinyxml headers
        rm -v extern/oics/tiny{str,xml}* || die
+       rm -rv extern/sol3.2.2 || die
 }
 
 src_configure() {
@@ -96,6 +101,20 @@ src_configure() {
                -DBULLET_USE_DOUBLES=ON
        )
 
+       if [[ ${ELUA} == luajit ]]; then
+               mycmakeargs+=(
+                       -DUSE_LUAJIT=ON
+               )
+       else
+               mycmakeargs+=(
+                       -DUSE_LUAJIT=OFF
+                       -DLua_FIND_VERSION_MAJOR=$(ver_cut 1 $(lua_get_version))
+                       -DLua_FIND_VERSION_MINOR=$(ver_cut 2 $(lua_get_version))
+                       -DLua_FIND_VERSION_COUNT=2
+                       -DLua_FIND_VERSION_EXACT=ON
+               )
+       fi
+
        cmake_src_configure
 }
 

Reply via email to