Gentoo Archives: gentoo-commits

From: "Vadim A. Misbakh-Soloviov" <mva@×××.name>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/gamerlay:master commit in: games-engines/bbge/, games-arcade/aquaria/, games-engines/bbge/files/
Date: Fri, 02 Jun 2017 13:02:31
Message-Id: 1496408537.de131984cda6e4c9097ee02ebcb38eb581f6db40.mva@gentoo
1 commit: de131984cda6e4c9097ee02ebcb38eb581f6db40
2 Author: Vadim A. Misbakh-Soloviov <git <AT> mva <DOT> name>
3 AuthorDate: Fri Jun 2 13:02:17 2017 +0000
4 Commit: Vadim A. Misbakh-Soloviov <mva <AT> mva <DOT> name>
5 CommitDate: Fri Jun 2 13:02:17 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/gamerlay.git/commit/?id=de131984
7
8 aquaria/bbge semi-fix: chewi said there is new repo + needs to finish porting to EAPI6 (no gamesdir)
9
10 games-arcade/aquaria/aquaria-9999.ebuild | 72 ++++++++++++++++---------
11 games-engines/bbge/bbge-9999.ebuild | 43 ++++++++-------
12 games-engines/bbge/files/gentoo-data-path.patch | 40 --------------
13 3 files changed, 73 insertions(+), 82 deletions(-)
14
15 diff --git a/games-arcade/aquaria/aquaria-9999.ebuild b/games-arcade/aquaria/aquaria-9999.ebuild
16 index 7cbdc7d..2e1283e 100644
17 --- a/games-arcade/aquaria/aquaria-9999.ebuild
18 +++ b/games-arcade/aquaria/aquaria-9999.ebuild
19 @@ -1,11 +1,10 @@
20 -# Copyright 1999-2011 Gentoo Foundation
21 +# Copyright 1999-2016 Gentoo Foundation
22 # Distributed under the terms of the GNU General Public License v2
23 -# $Header: $
24
25 -EAPI="2"
26 +EAPI=6
27 EHG_REPO_URI="http://hg.icculus.org/icculus/aquaria"
28
29 -inherit eutils flag-o-matic games cmake-utils mercurial
30 +inherit eutils flag-o-matic cmake-utils mercurial versionator
31
32 DESCRIPTION="A 2D scroller set in a massive ocean world"
33 HOMEPAGE="http://www.bit-blot.com/aquaria/"
34 @@ -14,14 +13,24 @@ SRC_URI="aquaria-lnx-humble-bundle.mojo.run"
35 LICENSE="GPL-2"
36 SLOT="0"
37 KEYWORDS=""
38 -IUSE=""
39 +IUSE="luajit"
40 RESTRICT="fetch"
41
42 -RDEPEND="dev-lang/lua
43 +RDEPEND="
44 + luajit? (
45 + dev-lang/luajit:2
46 + )
47 + !luajit? (
48 + || (
49 + dev-lang/lua:5.1
50 + dev-lang/lua:0
51 + )
52 + )
53 >=dev-libs/tinyxml-2.6.1-r1[stl]
54 games-engines/bbge
55 media-libs/glpng
56 - media-libs/libsdl"
57 + media-libs/libsdl
58 +"
59
60 DEPEND="${RDEPEND}
61 app-arch/unzip"
62 @@ -30,7 +39,8 @@ S="${WORKDIR}/${PN}"
63
64 pkg_nofetch() {
65 echo
66 - elog "Download ${A} from ${HOMEPAGE} and place it in ${DISTDIR}"
67 + ewarn "Despite game code is open source, it still need artwork from original humblebundle package."
68 + ewarn "Please, download ${A} from ${HOMEPAGE} (or from your humble bundle library) and place it in ${DISTDIR}"
69 echo
70 }
71
72 @@ -45,41 +55,55 @@ src_unpack() {
73 }
74
75 src_prepare() {
76 + local lua=lua
77 + use luajit && lua=luajit-5.1
78 + has_version 'dev-lang/lua:5.1' && lua=lua5.1
79 +
80 # Fix include paths.
81 sed -i \
82 -e "s:\.\./ExternalLibs/glpng:GL/glpng:" \
83 -e "s:\.\./ExternalLibs/::" \
84 -e "s:\.\./BBGE/:BBGE/:" \
85 - Aquaria/*.{cpp,h} || die
86 + Aquaria/*.{cpp,h} || die "Fix include patch failed"
87
88 # Only build game sources.
89 - rm -r BBGE/ || die
90 - sed -i "/ADD_EXECUTABLE[(]/,/[)]/d" CMakeLists.txt || die
91 - echo 'ADD_EXECUTABLE(aquaria ${AQUARIA_SRCS})' >> CMakeLists.txt || die
92 + rm -r BBGE/ ExternalLibs/ || die "dropping bbge && ExternalLibs faled"
93 + sed -i "/ADD_EXECUTABLE[(]/,/[)]/d" CMakeLists.txt || die "dropping bbge && ExternalLibs faled"
94 + echo 'ADD_EXECUTABLE(aquaria ${AQUARIA_SRCS})' >> CMakeLists.txt || die "dropping bbge && ExternalLibs faled"
95
96 # Redefine libraries to link against.
97 sed -i "/TARGET_LINK_LIBRARIES/d" CMakeLists.txt || die
98 - echo "TARGET_LINK_LIBRARIES(aquaria BBGE glpng lua pthread SDL tinyxml)" >> CMakeLists.txt || die
99 + echo "TARGET_LINK_LIBRARIES(aquaria BBGE glpng ${lua} pthread SDL tinyxml)" >> CMakeLists.txt || die
100 +
101 + default
102 }
103
104 src_configure() {
105 + local lua=lua
106 +
107 + use luajit && (
108 + local ljpk="$(best_version dev-lang/luajit:2)"
109 + local ljv="$(get_version_component_range 1-2 ${ljpk/*luajit-/})"
110 + append-cppflags -I/usr/include/luajit"${ljv}"
111 + )
112 +
113 + has_version 'dev-lang/lua:5.1' && append-cppflags -I/usr/include/lua5.1
114 +
115 append-cppflags -I/usr/include/BBGE -I/usr/include/freetype2
116 cmake-utils_src_configure
117 }
118
119 src_install() {
120 - dogamesbin "${CMAKE_BUILD_DIR}/${PN}" || die
121 -
122 - cd ../data || die
123 - insinto "${GAMES_DATADIR}/Aquaria"
124 - doins -r *.xml */ || die
125 - doins -r "${S}"/game_scripts/* || die
126 + cmake-utils_src_install
127
128 - dodoc README-linux.txt || die
129 - dohtml -r docs/* || die
130 + cd ../data
131 + insinto /usr/share/Aquaria
132 + doins -r *.xml */
133 + doins -r "${S}"/game_scripts/*
134
135 - doicon "${PN}.png" || die
136 - make_desktop_entry "${PN}" "Aquaria" || die
137 + dodoc README-linux.txt
138 + dodoc -r docs/*
139
140 - prepgamesdirs
141 + doicon "${PN}.png"
142 + make_desktop_entry "${PN}" "Aquaria"
143 }
144
145 diff --git a/games-engines/bbge/bbge-9999.ebuild b/games-engines/bbge/bbge-9999.ebuild
146 index c20ac8e..d68e6ae 100644
147 --- a/games-engines/bbge/bbge-9999.ebuild
148 +++ b/games-engines/bbge/bbge-9999.ebuild
149 @@ -1,12 +1,11 @@
150 -# Copyright 1999-2011 Gentoo Foundation
151 +# Copyright 1999-2017 Gentoo Foundation
152 # Distributed under the terms of the GNU General Public License v2
153 -# $Header: $
154
155 -EAPI="2"
156 +EAPI=6
157 EHG_REPO_URI="http://hg.icculus.org/icculus/aquaria"
158 EHG_PROJECT="aquaria"
159
160 -inherit flag-o-matic games cmake-utils mercurial
161 +inherit flag-o-matic cmake-utils mercurial
162
163 DESCRIPTION="The Bit-Blot Game Engine, used by Aquaria"
164 HOMEPAGE="http://www.bit-blot.com/"
165 @@ -16,7 +15,8 @@ SLOT="0"
166 KEYWORDS=""
167 IUSE="static-libs"
168
169 -RDEPEND=">=dev-libs/tinyxml-2.6.1-r1[stl]
170 +RDEPEND="
171 + >=dev-libs/tinyxml-2.6.1-r1[stl]
172 media-libs/freetype:2
173 media-libs/ftgl
174 media-libs/glpng
175 @@ -24,15 +24,18 @@ RDEPEND=">=dev-libs/tinyxml-2.6.1-r1[stl]
176 media-libs/libvorbis
177 media-libs/openal
178 sys-libs/zlib
179 - virtual/opengl"
180 + virtual/opengl
181 +"
182
183 DEPEND="${RDEPEND}"
184
185 S="${WORKDIR}/aquaria"
186
187 +#PATCHES=("${FILESDIR}/patches")
188 +
189 src_prepare() {
190 # Remove bundled stuff to ensure it's not used.
191 - rm -r BBGE/{GL,glext} || die
192 + rm -r BBGE/{GL,glext} || die "Removing bundled stuff failed"
193
194 # Remove bundled sources.
195 # Don't build Aquaria.
196 @@ -40,28 +43,32 @@ src_prepare() {
197 -e '/glpng/d' -e '/tinyxml/d' \
198 -e '/TARGET_LINK_LIBRARIES/d' \
199 -e '/ADD_EXECUTABLE[(]/,/[)]/d' \
200 - CMakeLists.txt || die
201 + CMakeLists.txt || die "No Aquaria patch failed"
202
203 - # Set the data prefix directory.
204 - echo "ADD_DEFINITIONS(-DBBGE_DATA_PREFIX=\"${GAMES_DATADIR}\")" >> CMakeLists.txt || die
205 +# # Set the data prefix directory.
206 +# echo "ADD_DEFINITIONS(-DBBGE_DATA_PREFIX=\"${GAMES_DATADIR}\")" >> CMakeLists.txt || die ""
207
208 # Always build shared.
209 - echo 'ADD_LIBRARY(BBGE SHARED ${BBGE_SRCS})' >> CMakeLists.txt || die
210 + echo 'ADD_LIBRARY(BBGE SHARED ${BBGE_SRCS})' >> CMakeLists.txt || die "Always-shared patch failed"
211
212 # Optionally build static.
213 if use static-libs; then
214 - echo 'ADD_LIBRARY(BBGE_Static STATIC ${BBGE_SRCS})' >> CMakeLists.txt || die
215 - echo 'SET_TARGET_PROPERTIES(BBGE_Static PROPERTIES OUTPUT_NAME BBGE)' >> CMakeLists.txt || die
216 + echo 'ADD_LIBRARY(BBGE_Static STATIC ${BBGE_SRCS})' >> CMakeLists.txt || die "Static libs patch failed"
217 + echo 'SET_TARGET_PROPERTIES(BBGE_Static PROPERTIES OUTPUT_NAME BBGE)' >> CMakeLists.txt || die "Static libs patch failed"
218 fi
219
220 # Resolve symbols now, not later.
221 - echo 'TARGET_LINK_LIBRARIES(BBGE ftgl glpng openal SDL tinyxml vorbisfile z)' >> CMakeLists.txt || die
222 + echo 'TARGET_LINK_LIBRARIES(BBGE ftgl glpng openal SDL tinyxml vorbisfile z)' >> CMakeLists.txt || die "Now-Resolve patch failed"
223
224 # Use system headers.
225 - ln -snf ../ExternalLibs/glfont2 BBGE/glfont2 || die
226 - sed -i 's:\.\./ExternalLibs/::' BBGE/*.{cpp,h} || die
227 - sed -i -r 's:["<](gl[a-z]*\.h)[">]:<GL/\1>:' BBGE/Base.h BBGE/Texture.cpp || die
228 - sed -i -e 's:"FTGL\.h":<FTGL/ftgl.h>:' -e '/FTGLTextureFont\.h/d' BBGE/TTFFont.h || die
229 + ln -snf ../ExternalLibs/glfont2 BBGE/glfont2 || die "system-headers patch failed"
230 + sed -i 's:\.\./ExternalLibs/::' BBGE/*.{cpp,h} || die "system-headers patch failed"
231 + sed -i -r 's:["<](gl[a-z]*\.h)[">]:<GL/\1>:' BBGE/Base.h BBGE/Texture.cpp || die "system-headers patch failed"
232 + sed -i -e 's:"FTGL\.h":<FTGL/ftgl.h>:' -e '/FTGLTextureFont\.h/d' BBGE/TTFFont.h || die "system-headers patch failed"
233 +
234 + sed -i -e '1i#include <unistd.h>' BBGE/Joystick.cpp || die "Joystick unistd sed-patch failed"
235 +
236 + default
237 }
238
239 src_configure() {
240
241 diff --git a/games-engines/bbge/files/gentoo-data-path.patch b/games-engines/bbge/files/gentoo-data-path.patch
242 deleted file mode 100644
243 index cf3a755..0000000
244 --- a/games-engines/bbge/files/gentoo-data-path.patch
245 +++ /dev/null
246 @@ -1,40 +0,0 @@
247 -# HG changeset patch
248 -# User James Le Cuirot <chewi@××××××××××××××.uk>
249 -# Date 1276623161 -3600
250 -# Node ID 1feb7c10b9ae5669721fad0aec3c7fb9f4ccfd78
251 -# Parent 3806789df5b04b632bcc3a483f4668edcb164fbc
252 -Use /usr/share/games/<appName> for data path on Gentoo.
253 -
254 -diff -r 3806789df5b0 -r 1feb7c10b9ae BBGE/Core.cpp
255 ---- a/BBGE/Core.cpp Tue Jun 15 18:21:12 2010 +0100
256 -+++ b/BBGE/Core.cpp Tue Jun 15 18:32:41 2010 +0100
257 -@@ -1008,25 +1008,10 @@
258 - else
259 - debugLog("Failed to chdir to filesystem path" + filesystem);
260 - }
261 -- char path[PATH_MAX];
262 -- // always a symlink to this process's binary, on modern Linux systems.
263 -- const ssize_t rc = readlink("/proc/self/exe", path, sizeof (path));
264 -- if ( (rc == -1) || (rc >= sizeof (path)) )
265 -- {
266 -- // error!
267 -- debugLog("readlink");
268 -- }
269 -- else
270 -- {
271 -- path[rc] = '\0';
272 -- char *ptr = strrchr(path, '/');
273 -- if (ptr != NULL)
274 -- {
275 -- *ptr = '\0';
276 -- debugLog(path);
277 -- chdir(path);
278 -- }
279 -- }
280 -+ std::string path("/usr/share/games/");
281 -+ path.append(appName);
282 -+ debugLog(path);
283 -+ chdir(path.c_str());
284 - #endif
285 - #ifdef BBGE_BUILD_WINDOWS
286 - // FIXME: filesystem not handled