summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Szuba <marecki@gentoo.org>2020-11-30 23:10:35 +0100
committerMarek Szuba <marecki@gentoo.org>2020-11-30 23:50:42 +0100
commit4ee08e4fc5b4df91f99f96f734a00aaeb95c98d5 (patch)
treec7e927b2a894d2c47de98a2507bea17fba1ef558 /games-rpg
parentdev-games/cegui: migrate to lua-single.eclass (diff)
downloadgentoo-4ee08e4fc5b4df91f99f96f734a00aaeb95c98d5.tar.gz
gentoo-4ee08e4fc5b4df91f99f96f734a00aaeb95c98d5.tar.bz2
gentoo-4ee08e4fc5b4df91f99f96f734a00aaeb95c98d5.zip
games-rpg/sumwars: migrate to lua-single.eclass
Set LUA_COMPAT to lua5-{1..2} because when left to its own devices, upstream build scripts select 5.2 at most even when newer versions of Lua are present in the system. Builds without errors also when forced to use 5.3, then again the bunded data scripts may or may not be compatible with that version so let's err on the side of caution. This version of sumwars does not use the CEGUI Lua-scripting module (CEGUILua is mentioned exactly once in the source code, in a commented-out #include line) and does not link against the relevant CEGUI library. Therefore, the value of LUA_SINGLE_TARGET used during the building of dev-games/cegui can safely be disregarded. Closes: https://bugs.gentoo.org/752702 Signed-off-by: Marek Szuba <marecki@gentoo.org>
Diffstat (limited to 'games-rpg')
-rw-r--r--games-rpg/sumwars/files/sumwars-0.5.8-cmake_lua_version.patch11
-rw-r--r--games-rpg/sumwars/sumwars-0.5.8-r100.ebuild101
2 files changed, 112 insertions, 0 deletions
diff --git a/games-rpg/sumwars/files/sumwars-0.5.8-cmake_lua_version.patch b/games-rpg/sumwars/files/sumwars-0.5.8-cmake_lua_version.patch
new file mode 100644
index 000000000000..eed17e93dcd5
--- /dev/null
+++ b/games-rpg/sumwars/files/sumwars-0.5.8-cmake_lua_version.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -179,7 +179,7 @@
+ FIND_PACKAGE(GNUWIN REQUIRED)
+ ENDIF (WIN32)
+ FIND_PACKAGE(OIS REQUIRED)
+-FIND_PACKAGE(Lua REQUIRED)
++FIND_PACKAGE(Lua ${LUA_VERSION} EXACT REQUIRED)
+ FIND_PACKAGE(CEGUI REQUIRED)
+ SET(CEGUI_VERSION_RESOURCES "gui_0.8")
+
diff --git a/games-rpg/sumwars/sumwars-0.5.8-r100.ebuild b/games-rpg/sumwars/sumwars-0.5.8-r100.ebuild
new file mode 100644
index 000000000000..f6f1badd5aec
--- /dev/null
+++ b/games-rpg/sumwars/sumwars-0.5.8-r100.ebuild
@@ -0,0 +1,101 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+LUA_COMPAT=( lua5-{1..2} )
+
+inherit cmake desktop flag-o-matic lua-single xdg-utils
+
+DESCRIPTION="a multi-player, 3D action role-playing game"
+HOMEPAGE="http://sumwars.org"
+SRC_URI="mirror://sourceforge/sumwars/${P//_/-}-src.tar.bz2"
+
+LICENSE="GPL-3 CC-BY-SA-3.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="+tools debug"
+
+LANGS="de en it pl pt ru uk"
+for L in ${LANGS} ; do
+ IUSE="${IUSE} l10n_${L}"
+done
+unset L
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+RDEPEND="${LUA_DEPS}
+ >=dev-games/cegui-0.8[ogre]
+ >=dev-games/ogre-1.7.4-r1[freeimage,opengl]
+ dev-games/ois
+ dev-games/physfs
+ >=dev-libs/tinyxml-2.6.2-r2
+ media-libs/freealut
+ media-libs/openal
+ media-libs/libogg
+ media-libs/libvorbis
+ >=net-libs/enet-1.3.0
+ x11-libs/libX11
+ x11-libs/libXrandr
+ tools? ( dev-libs/boost )"
+DEPEND=${RDEPEND}
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.5.8-cmake_lua_version.patch
+)
+CMAKE_REMOVE_MODULES_LIST="FindLua FindLua51"
+
+S=${WORKDIR}/${PN}-${PV%_*}
+
+src_configure() {
+ # QA
+ append-flags -fno-strict-aliasing
+
+ use debug && CMAKE_BUILD_TYPE=Debug
+
+ local l langs
+ for l in ${LANGS}; do
+ if use l10n_${l}; then
+ langs="${langs} ${l}"
+ fi
+ done
+
+ [[ -z "${langs}" ]] && langs="en"
+
+ # configure sumwars with cmake
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_PREFIX=""
+ -DLUA_VERSION="$(lua_get_version)"
+ -DSUMWARS_BUILD_TOOLS="$(usex tools)"
+ -DSUMWARS_DOC_DIR="/usr/share/doc/${PF}"
+ -DSUMWARS_EXECUTABLE_DIR="/usr/bin"
+ -DSUMWARS_LANGUAGES="${langs}"
+ -DSUMWARS_NO_ENET=ON
+ -DSUMWARS_NO_TINYXML=ON
+ -DSUMWARS_PORTABLE_MODE=OFF
+ -DSUMWARS_POST_BUILD_COPY=OFF
+ -DSUMWARS_RANDOM_REGIONS=ON
+ -DSUMWARS_SHARE_DIR="/usr/share/${PN}"
+ -DSUMWARS_STANDALONE_MODE=OFF
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile
+}
+
+src_install() {
+ cmake_src_install
+ newicon -s 128 share/icon/SumWarsIcon_128x128.png ${PN}.png
+ make_desktop_entry ${PN} "Summoning Wars"
+}
+
+pkg_postinst() {
+ xdg_icon_cache_update
+}
+
+pkg_postrm() {
+ xdg_icon_cache_update
+}