Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-rpg/sumwars/, profiles/, games-rpg/sumwars/files/
Date: Mon, 30 Nov 2020 22:51:04
Message-Id: 1606776642.4ee08e4fc5b4df91f99f96f734a00aaeb95c98d5.marecki@gentoo
1 commit: 4ee08e4fc5b4df91f99f96f734a00aaeb95c98d5
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Mon Nov 30 22:10:35 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 30 22:50:42 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ee08e4f
7
8 games-rpg/sumwars: migrate to lua-single.eclass
9
10 Set LUA_COMPAT to lua5-{1..2} because when left to its own devices,
11 upstream build scripts select 5.2 at most even when newer versions of
12 Lua are present in the system. Builds without errors also when
13 forced to use 5.3, then again the bunded data scripts may or may not be
14 compatible with that version so let's err on the side of caution.
15
16 This version of sumwars does not use the CEGUI Lua-scripting module
17 (CEGUILua is mentioned exactly once in the source code, in a
18 commented-out #include line) and does not link against the relevant
19 CEGUI library. Therefore, the value of LUA_SINGLE_TARGET used during the
20 building of dev-games/cegui can safely be disregarded.
21
22 Closes: https://bugs.gentoo.org/752702
23 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
24
25 .../files/sumwars-0.5.8-cmake_lua_version.patch | 11 +++
26 games-rpg/sumwars/sumwars-0.5.8-r100.ebuild | 101 +++++++++++++++++++++
27 profiles/package.mask | 1 +
28 3 files changed, 113 insertions(+)
29
30 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
31 new file mode 100644
32 index 00000000000..eed17e93dcd
33 --- /dev/null
34 +++ b/games-rpg/sumwars/files/sumwars-0.5.8-cmake_lua_version.patch
35 @@ -0,0 +1,11 @@
36 +--- a/CMakeLists.txt
37 ++++ b/CMakeLists.txt
38 +@@ -179,7 +179,7 @@
39 + FIND_PACKAGE(GNUWIN REQUIRED)
40 + ENDIF (WIN32)
41 + FIND_PACKAGE(OIS REQUIRED)
42 +-FIND_PACKAGE(Lua REQUIRED)
43 ++FIND_PACKAGE(Lua ${LUA_VERSION} EXACT REQUIRED)
44 + FIND_PACKAGE(CEGUI REQUIRED)
45 + SET(CEGUI_VERSION_RESOURCES "gui_0.8")
46 +
47
48 diff --git a/games-rpg/sumwars/sumwars-0.5.8-r100.ebuild b/games-rpg/sumwars/sumwars-0.5.8-r100.ebuild
49 new file mode 100644
50 index 00000000000..f6f1badd5ae
51 --- /dev/null
52 +++ b/games-rpg/sumwars/sumwars-0.5.8-r100.ebuild
53 @@ -0,0 +1,101 @@
54 +# Copyright 1999-2020 Gentoo Authors
55 +# Distributed under the terms of the GNU General Public License v2
56 +
57 +EAPI=7
58 +
59 +LUA_COMPAT=( lua5-{1..2} )
60 +
61 +inherit cmake desktop flag-o-matic lua-single xdg-utils
62 +
63 +DESCRIPTION="a multi-player, 3D action role-playing game"
64 +HOMEPAGE="http://sumwars.org"
65 +SRC_URI="mirror://sourceforge/sumwars/${P//_/-}-src.tar.bz2"
66 +
67 +LICENSE="GPL-3 CC-BY-SA-3.0"
68 +SLOT="0"
69 +KEYWORDS="~amd64 ~x86"
70 +IUSE="+tools debug"
71 +
72 +LANGS="de en it pl pt ru uk"
73 +for L in ${LANGS} ; do
74 + IUSE="${IUSE} l10n_${L}"
75 +done
76 +unset L
77 +
78 +REQUIRED_USE="${LUA_REQUIRED_USE}"
79 +
80 +RDEPEND="${LUA_DEPS}
81 + >=dev-games/cegui-0.8[ogre]
82 + >=dev-games/ogre-1.7.4-r1[freeimage,opengl]
83 + dev-games/ois
84 + dev-games/physfs
85 + >=dev-libs/tinyxml-2.6.2-r2
86 + media-libs/freealut
87 + media-libs/openal
88 + media-libs/libogg
89 + media-libs/libvorbis
90 + >=net-libs/enet-1.3.0
91 + x11-libs/libX11
92 + x11-libs/libXrandr
93 + tools? ( dev-libs/boost )"
94 +DEPEND=${RDEPEND}
95 +
96 +PATCHES=(
97 + "${FILESDIR}"/${PN}-0.5.8-cmake_lua_version.patch
98 +)
99 +CMAKE_REMOVE_MODULES_LIST="FindLua FindLua51"
100 +
101 +S=${WORKDIR}/${PN}-${PV%_*}
102 +
103 +src_configure() {
104 + # QA
105 + append-flags -fno-strict-aliasing
106 +
107 + use debug && CMAKE_BUILD_TYPE=Debug
108 +
109 + local l langs
110 + for l in ${LANGS}; do
111 + if use l10n_${l}; then
112 + langs="${langs} ${l}"
113 + fi
114 + done
115 +
116 + [[ -z "${langs}" ]] && langs="en"
117 +
118 + # configure sumwars with cmake
119 + local mycmakeargs=(
120 + -DCMAKE_INSTALL_PREFIX=""
121 + -DLUA_VERSION="$(lua_get_version)"
122 + -DSUMWARS_BUILD_TOOLS="$(usex tools)"
123 + -DSUMWARS_DOC_DIR="/usr/share/doc/${PF}"
124 + -DSUMWARS_EXECUTABLE_DIR="/usr/bin"
125 + -DSUMWARS_LANGUAGES="${langs}"
126 + -DSUMWARS_NO_ENET=ON
127 + -DSUMWARS_NO_TINYXML=ON
128 + -DSUMWARS_PORTABLE_MODE=OFF
129 + -DSUMWARS_POST_BUILD_COPY=OFF
130 + -DSUMWARS_RANDOM_REGIONS=ON
131 + -DSUMWARS_SHARE_DIR="/usr/share/${PN}"
132 + -DSUMWARS_STANDALONE_MODE=OFF
133 + )
134 +
135 + cmake_src_configure
136 +}
137 +
138 +src_compile() {
139 + cmake_src_compile
140 +}
141 +
142 +src_install() {
143 + cmake_src_install
144 + newicon -s 128 share/icon/SumWarsIcon_128x128.png ${PN}.png
145 + make_desktop_entry ${PN} "Summoning Wars"
146 +}
147 +
148 +pkg_postinst() {
149 + xdg_icon_cache_update
150 +}
151 +
152 +pkg_postrm() {
153 + xdg_icon_cache_update
154 +}
155
156 diff --git a/profiles/package.mask b/profiles/package.mask
157 index 805b9bbefe5..4335da53185 100644
158 --- a/profiles/package.mask
159 +++ b/profiles/package.mask
160 @@ -568,6 +568,7 @@ dev-lua/luacrypto
161 >=games-roguelike/crossfire-client-1.71.0-r100
162 >=games-roguelike/stone-soup-0.25.1-r100
163 >=games-rpg/kqlives-0.99-r100
164 +>=games-rpg/sumwars-0.5.8-r100
165 >=mail-filter/imapfilter-2.6.16-r100
166 >=media-gfx/geeqie-1.5.1-r1
167 >=media-sound/aqualung-1.1-r100