Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-sports/dustrac/files/, games-sports/dustrac/
Date: Sun, 28 Feb 2021 12:26:43
Message-Id: 1614515171.60240ee1648fd7ff1c72fafddf341028f6074a3c.asturm@gentoo
1 commit: 60240ee1648fd7ff1c72fafddf341028f6074a3c
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 27 20:10:40 2021 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 28 12:26:11 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60240ee1
7
8 games-sports/dustrac: 1.13.0 version bump, cmake.eclass, build w/ GCC10
9
10 New HOMEPAGE
11 Make tests optional, both dependency and build
12 Fix tests using virtualx
13 Fix appdata install path
14 Fix build with GCC-10
15
16 Bug: https://bugs.gentoo.org/725516
17 Closes: https://bugs.gentoo.org/682552
18 Closes: https://bugs.gentoo.org/722524
19 Package-Manager: Portage-3.0.16, Repoman-3.0.2
20 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
21
22 games-sports/dustrac/Manifest | 1 +
23 games-sports/dustrac/dustrac-1.13.0.ebuild | 79 +++++++++++++++++++
24 .../dustrac/files/dustrac-1.13.0-appdata.patch | 27 +++++++
25 .../dustrac-1.13.0-cmake-add_library-static.patch | 31 ++++++++
26 .../dustrac/files/dustrac-1.13.0-cmake.patch | 69 ++++++++++++++++
27 .../dustrac/files/dustrac-1.13.0-gcc10.patch | 48 ++++++++++++
28 .../dustrac/files/dustrac-1.13.0-opengl.patch | 91 ++++++++++++++++++++++
29 7 files changed, 346 insertions(+)
30
31 diff --git a/games-sports/dustrac/Manifest b/games-sports/dustrac/Manifest
32 index 7e7ab1ee713..49e4fa26ade 100644
33 --- a/games-sports/dustrac/Manifest
34 +++ b/games-sports/dustrac/Manifest
35 @@ -1 +1,2 @@
36 DIST dustrac-1.11.0.tar.gz 27505282 BLAKE2B a42de406e388e13f1829e10248899f47cf98333a972eb4ce978116a706d9786840c4c6ec9107403aad25bd538453a7595c35cab33b0643968133710db2a3c66c SHA512 af67b76a815543d41cf8e5681ede11bfd63a2d6be7e4a21986d495d77b2673f5a145bb1c9cd5237d2caf64a4e77f221ae48b97a38a883dcd4e5bb0ef8c55f839
37 +DIST dustrac-1.13.0.tar.gz 18466297 BLAKE2B 694b879755125f273864f16ebb889d39d1dc690aa0f79e6cc3f8b5e64eec64209f32065dd2c88eb7b82e246837a0217ee284fb529b9e1e3149f2adeb5e54d2d1 SHA512 afb7a361771e5c19ef6ef26dd273a4b5df2b0ae7d7dd8292d2c875ac6a3109d2ff50f37f83006505c68486c50b4f6b371ba1f76cdedbe99652637508d86d7b49
38
39 diff --git a/games-sports/dustrac/dustrac-1.13.0.ebuild b/games-sports/dustrac/dustrac-1.13.0.ebuild
40 new file mode 100644
41 index 00000000000..051ce989865
42 --- /dev/null
43 +++ b/games-sports/dustrac/dustrac-1.13.0.ebuild
44 @@ -0,0 +1,79 @@
45 +# Copyright 1999-2021 Gentoo Authors
46 +# Distributed under the terms of the GNU General Public License v2
47 +
48 +EAPI=7
49 +
50 +inherit cmake xdg-utils virtualx
51 +
52 +DESCRIPTION="Tile-based, cross-platform 2D racing game"
53 +HOMEPAGE="https://juzzlin.github.io/DustRacing2D/"
54 +SRC_URI="https://github.com/juzzlin/DustRacing2D/archive/${PV}.tar.gz -> ${P}.tar.gz"
55 +S="${WORKDIR}/DustRacing2D-${PV}"
56 +
57 +LICENSE="GPL-3+ CC-BY-SA-3.0"
58 +SLOT="0"
59 +KEYWORDS="~amd64 ~x86"
60 +IUSE="test"
61 +
62 +RESTRICT="!test? ( test )"
63 +
64 +RDEPEND="
65 + dev-qt/qtcore:5
66 + dev-qt/qtgui:5
67 + dev-qt/qtopengl:5
68 + dev-qt/qtxml:5
69 + media-fonts/ubuntu-font-family
70 + media-libs/libvorbis
71 + media-libs/openal
72 + virtual/opengl
73 +"
74 +DEPEND="${RDEPEND}
75 + test? ( dev-qt/qttest:5 )
76 +"
77 +BDEPEND="
78 + dev-qt/linguist-tools:5
79 + virtual/pkgconfig
80 +"
81 +
82 +PATCHES=(
83 + # upstream backports
84 + "${FILESDIR}"/${P}-gcc10.patch # bug 722524
85 + "${FILESDIR}"/${P}-opengl.patch
86 + "${FILESDIR}"/${P}-appdata.patch
87 + # downstream patches
88 + "${FILESDIR}"/${P}-cmake.patch
89 + "${FILESDIR}"/${P}-cmake-add_library-static.patch
90 +)
91 +
92 +src_configure() {
93 + # -DGLES=ON didn't build for me but maybe just need use flags on some Qt package?
94 + # Maybe add a local gles use flag
95 + local mycmakeargs=(
96 + -DReleaseBuild=ON
97 + -DOpenGL_GL_PREFERENCE=GLVND
98 + -DDATA_PATH=/usr/share/${PN}
99 + -DBIN_PATH=/usr/bin
100 + -DDOC_PATH=/usr/share/doc/${PF}
101 + -DBUILD_TESTING=$(usex test)
102 + )
103 + cmake_src_configure
104 +}
105 +
106 +src_test() {
107 + virtx cmake_src_test
108 +}
109 +
110 +src_install() {
111 + cmake_src_install
112 +
113 + dosym ../../fonts/ubuntu-font-family/UbuntuMono-B.ttf /usr/share/${PN}/fonts/UbuntuMono-B.ttf
114 + dosym ../../fonts/ubuntu-font-family/UbuntuMono-R.ttf /usr/share/${PN}/fonts/UbuntuMono-R.ttf
115 +}
116 +
117 +pkg_postinst() {
118 + xdg_icon_cache_update
119 +}
120 +
121 +pkg_postrm() {
122 + xdg_icon_cache_update
123 +}
124
125 diff --git a/games-sports/dustrac/files/dustrac-1.13.0-appdata.patch b/games-sports/dustrac/files/dustrac-1.13.0-appdata.patch
126 new file mode 100644
127 index 00000000000..e932a411fd6
128 --- /dev/null
129 +++ b/games-sports/dustrac/files/dustrac-1.13.0-appdata.patch
130 @@ -0,0 +1,27 @@
131 +From 5c5c437c2634572da21a22e1f64fac1dc1b296ea Mon Sep 17 00:00:00 2001
132 +From: Pino Toscano <toscano.pino@×××××××.it>
133 +Date: Sun, 24 Sep 2017 16:19:51 +0200
134 +Subject: [PATCH] Install AppData file to the right location
135 +
136 +According to the specs [1], the location is now /usr/share/metainfo,
137 +with appdata left as legacy directory. Hence, install the AppData file
138 +to the non-legacy directory.
139 +
140 +[1] https://www.freedesktop.org/software/appstream/docs/chap-Metadata.html
141 +---
142 + InstallLinux.cmake | 2 +-
143 + 1 file changed, 1 insertion(+), 1 deletion(-)
144 +
145 +diff --git a/InstallLinux.cmake b/InstallLinux.cmake
146 +index 15e69855..3e0443d1 100644
147 +--- a/InstallLinux.cmake
148 ++++ b/InstallLinux.cmake
149 +@@ -74,7 +74,7 @@ function(setup_install_targets BIN_PATH DATA_PATH DOC_PATH)
150 + install(FILES ${CMAKE_BINARY_DIR}/dustrac-editor.desktop DESTINATION share/applications)
151 +
152 + # Install app store meta data
153 +- install(FILES src/dustrac.appdata.xml DESTINATION share/appdata)
154 ++ install(FILES src/dustrac.appdata.xml DESTINATION share/metainfo)
155 +
156 + # Install icons
157 + install(FILES data/icons/dustrac-game.png DESTINATION share/pixmaps)
158
159 diff --git a/games-sports/dustrac/files/dustrac-1.13.0-cmake-add_library-static.patch b/games-sports/dustrac/files/dustrac-1.13.0-cmake-add_library-static.patch
160 new file mode 100644
161 index 00000000000..f6b2cc612cc
162 --- /dev/null
163 +++ b/games-sports/dustrac/files/dustrac-1.13.0-cmake-add_library-static.patch
164 @@ -0,0 +1,31 @@
165 +Fix linking with BUILD_SHARED_LIBS=ON default in EAPI-7.
166 +
167 +--- a/src/game/STFH/CMakeLists.txt 2017-08-28 21:43:54.000000000 +0200
168 ++++ b/src/game/STFH/CMakeLists.txt 2021-02-27 20:58:35.523503983 +0100
169 +@@ -10,5 +10,5 @@
170 + source.cpp
171 + )
172 +
173 +-add_library(STFH ${STFHSRC})
174 ++add_library(STFH STATIC ${STFHSRC})
175 +
176 +--- a/src/game/MTFH/CMakeLists.txt 2017-08-28 21:43:54.000000000 +0200
177 ++++ b/src/game/MTFH/CMakeLists.txt 2021-02-27 20:58:48.451565823 +0100
178 +@@ -9,5 +9,5 @@
179 + menumanager.cpp
180 + menuitemview.cpp)
181 +
182 +-add_library(MTFH ${MTFHSRC})
183 ++add_library(MTFH STATIC ${MTFHSRC})
184 +
185 +--- a/src/game/MiniCore/CMakeLists.txt 2017-08-28 21:43:54.000000000 +0200
186 ++++ b/src/game/MiniCore/CMakeLists.txt 2021-02-27 20:59:01.267627130 +0100
187 +@@ -82,7 +82,7 @@
188 + set(MiniCoreSRC ${MiniCoreSRC} Graphics/contrib/glew/glew.c)
189 + endif()
190 +
191 +-add_library(MiniCore ${MiniCoreSRC})
192 ++add_library(MiniCore STATIC ${MiniCoreSRC})
193 +
194 + target_link_libraries(MiniCore Qt5::Core Qt5::OpenGL Qt5::Xml OpenGL::GL)
195 +
196
197 diff --git a/games-sports/dustrac/files/dustrac-1.13.0-cmake.patch b/games-sports/dustrac/files/dustrac-1.13.0-cmake.patch
198 new file mode 100644
199 index 00000000000..57a00c0068f
200 --- /dev/null
201 +++ b/games-sports/dustrac/files/dustrac-1.13.0-cmake.patch
202 @@ -0,0 +1,69 @@
203 +Rebase CFLAGS and COPYING removal patch onto 1.13.0
204 +Use CTest module for standard BUILD_TESTING switch and make Qt5Test optional
205 +
206 +--- a/CMakeLists.txt 2017-08-28 21:43:54.000000000 +0200
207 ++++ b/CMakeLists.txt 2021-02-27 19:21:04.090117623 +0100
208 +@@ -57,6 +57,9 @@
209 + add_definitions(-DGLEW_STATIC)
210 + add_definitions(-DGLEW_NO_GLU)
211 +
212 ++# Enable CMake's unit test framework
213 ++include(CTest)
214 ++
215 + if(UNIX)
216 + include("InstallLinux.cmake")
217 + elseif(WIN32)
218 +@@ -64,8 +67,7 @@
219 + endif()
220 +
221 + if(CMAKE_COMPILER_IS_GNUCXX OR MINGW OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
222 +- add_compile_options(-std=c++11 -W -Wall -O3 -pedantic)
223 +- add_compile_options(-fomit-frame-pointer -finline-functions -ffast-math)
224 ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -W -Wall -fomit-frame-pointer -finline-functions")
225 + elseif(MSVC)
226 + add_definitions(-DNOMINMAX)
227 + endif()
228 +@@ -83,7 +85,10 @@
229 + find_package(Qt5Xml ${QT_MIN_VER} REQUIRED)
230 + find_package(Qt5Widgets ${QT_MIN_VER} REQUIRED)
231 + find_package(Qt5LinguistTools ${QT_MIN_VER} REQUIRED)
232 +-find_package(Qt5Test ${QT_MIN_VER} REQUIRED)
233 ++
234 ++if(BUILD_TESTING)
235 ++ find_package(Qt5Test ${QT_MIN_VER} REQUIRED)
236 ++endif()
237 +
238 + # Find OpenGL
239 + find_package(OpenGL REQUIRED)
240 +@@ -109,9 +114,6 @@
241 + pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
242 + endif()
243 +
244 +-# Enable CMake's unit test framework
245 +-enable_testing()
246 +-
247 + # Install paths depend on the build type and target platform
248 + resolve_install_paths()
249 +
250 +--- a/InstallLinux.cmake 2017-08-28 21:43:54.000000000 +0200
251 ++++ b/InstallLinux.cmake 2021-02-27 19:21:23.760211724 +0100
252 +@@ -58,7 +58,7 @@
253 + install(FILES data/fonts.conf DESTINATION ${DATA_PATH})
254 + install(FILES data/meshes.conf DESTINATION ${DATA_PATH})
255 + install(FILES data/surfaces.conf DESTINATION ${DATA_PATH})
256 +- install(FILES AUTHORS CHANGELOG COPYING README.md DESTINATION ${DOC_PATH})
257 ++ install(FILES AUTHORS CHANGELOG README.md DESTINATION ${DOC_PATH})
258 + install(DIRECTORY data/images DESTINATION ${DATA_PATH} FILES_MATCHING PATTERN "*.jpg")
259 + install(DIRECTORY data/images DESTINATION ${DATA_PATH} FILES_MATCHING PATTERN "*.png")
260 + install(DIRECTORY data/levels DESTINATION ${DATA_PATH} FILES_MATCHING PATTERN "*.trk")
261 +--- a/src/game/MiniCore/CMakeLists.txt 2017-08-28 21:43:54.000000000 +0200
262 ++++ b/src/game/MiniCore/CMakeLists.txt 2021-02-27 19:17:29.616848751 +0100
263 +@@ -86,5 +86,7 @@
264 +
265 + target_link_libraries(MiniCore Qt5::OpenGL Qt5::Xml)
266 +
267 +-add_subdirectory(UnitTests)
268 ++if(BUILD_TESTING)
269 ++ add_subdirectory(UnitTests)
270 ++endif()
271 +
272
273 diff --git a/games-sports/dustrac/files/dustrac-1.13.0-gcc10.patch b/games-sports/dustrac/files/dustrac-1.13.0-gcc10.patch
274 new file mode 100644
275 index 00000000000..1a3f51896bd
276 --- /dev/null
277 +++ b/games-sports/dustrac/files/dustrac-1.13.0-gcc10.patch
278 @@ -0,0 +1,48 @@
279 +From d41a46ac32038055bfc9fe9a907e199ed74e371c Mon Sep 17 00:00:00 2001
280 +From: Pino Toscano <toscano.pino@×××××××.it>
281 +Date: Fri, 17 Apr 2020 13:25:12 +0200
282 +Subject: [PATCH] Include <stdexcept> for std::runtime_error
283 +
284 +It was implicitly pulled before, and in GCC 10 it will not be anymore.
285 +---
286 + src/game/openaloggdata.cpp | 1 +
287 + src/game/openalsource.cpp | 1 +
288 + src/game/openalwavdata.cpp | 1 +
289 + 3 files changed, 3 insertions(+)
290 +
291 +diff --git a/src/game/openaloggdata.cpp b/src/game/openaloggdata.cpp
292 +index 56634c20..4a2ab882 100644
293 +--- a/src/game/openaloggdata.cpp
294 ++++ b/src/game/openaloggdata.cpp
295 +@@ -19,6 +19,7 @@
296 +
297 + #include <vector>
298 + #include <cstdio>
299 ++#include <stdexcept>
300 +
301 + #include <vorbis/vorbisfile.h>
302 +
303 +diff --git a/src/game/openalsource.cpp b/src/game/openalsource.cpp
304 +index 9d2bb7f5..37a4272a 100644
305 +--- a/src/game/openalsource.cpp
306 ++++ b/src/game/openalsource.cpp
307 +@@ -19,6 +19,7 @@
308 + #include <AL/alc.h>
309 +
310 + #include <memory>
311 ++#include <stdexcept>
312 +
313 + static bool checkError()
314 + {
315 +diff --git a/src/game/openalwavdata.cpp b/src/game/openalwavdata.cpp
316 +index 3a9fc20a..015a11d3 100644
317 +--- a/src/game/openalwavdata.cpp
318 ++++ b/src/game/openalwavdata.cpp
319 +@@ -25,6 +25,7 @@
320 +
321 + #include <cstdio>
322 + #include <AL/alc.h>
323 ++#include <stdexcept>
324 +
325 + static bool checkError()
326 + {
327
328 diff --git a/games-sports/dustrac/files/dustrac-1.13.0-opengl.patch b/games-sports/dustrac/files/dustrac-1.13.0-opengl.patch
329 new file mode 100644
330 index 00000000000..5251169b46e
331 --- /dev/null
332 +++ b/games-sports/dustrac/files/dustrac-1.13.0-opengl.patch
333 @@ -0,0 +1,91 @@
334 +From acde4499b4a4d014d95668269797a272fd53bf86 Mon Sep 17 00:00:00 2001
335 +From: Jussi Lind <jussi.lind@×××.fi>
336 +Date: Thu, 15 Nov 2018 01:35:58 +0200
337 +Subject: [PATCH] CMake: Default to GLVND, use the recommended way to link to
338 + GL
339 +
340 +---
341 + CMakeLists.txt | 7 +++++++
342 + src/game/CMakeLists.txt | 2 +-
343 + src/game/MiniCore/src/CMakeLists.txt | 2 +-
344 + 3 files changed, 9 insertions(+), 2 deletions(-)
345 +
346 +From 7d6d2213d10ea96d25b5b9f18b42cace5bf0fbfd Mon Sep 17 00:00:00 2001
347 +From: Jussi Lind <jussi.lind@×××.fi>
348 +Date: Sun, 18 Nov 2018 21:12:20 +0200
349 +Subject: [PATCH] Fix linking to OpenGL libs on CMake < 3.11.0
350 +
351 +---
352 + CMakeLists.txt | 5 +++++
353 + src/game/CMakeLists.txt | 4 +---
354 + src/game/MiniCore/CMakeLists.txt | 5 +++++
355 + src/game/MiniCore/src/CMakeLists.txt | 2 +-
356 + 4 files changed, 12 insertions(+), 4 deletions(-)
357 +
358 +From edc1825110f80377af51226a686731bf17d1de52 Mon Sep 17 00:00:00 2001
359 +From: Jussi Lind <jussi.lind@×××.fi>
360 +Date: Tue, 30 Jul 2019 23:14:20 +0300
361 +Subject: [PATCH] Use OpenGL::GL instead of OpenGL::OpenGL
362 +
363 +- For more info: https://cmake.org/cmake/help/v3.10/module/FindOpenGL.html
364 +---
365 + CMakeLists.txt | 2 +-
366 + src/game/MiniCore/CMakeLists.txt | 2 +-
367 + 2 files changed, 2 insertions(+), 2 deletions(-)
368 +
369 +diff -u a/CMakeLists.txt b/CMakeLists.txt
370 +--- a/CMakeLists.txt
371 ++++ b/CMakeLists.txt
372 +@@ -3,6 +3,8 @@
373 + cmake_minimum_required(VERSION 2.8.12)
374 + cmake_policy(VERSION 2.8.12)
375 +
376 ++# Use cmake --help-policy [POLICY] for more information about these:
377 ++
378 + if(POLICY CMP0005)
379 + cmake_policy(SET CMP0005 NEW)
380 + endif()
381 +@@ -11,6 +13,11 @@
382 + cmake_policy(SET CMP0020 NEW)
383 + endif()
384 +
385 ++# Default to GLVND
386 ++if(POLICY CMP0072)
387 ++ cmake_policy(SET CMP0072 OLD)
388 ++endif()
389 ++
390 + # Global game version
391 + set(VERSION_MAJOR "2")
392 + set(VERSION_MINOR "0")
393 +diff -u a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt
394 +--- a/src/game/CMakeLists.txt
395 ++++ b/src/game/CMakeLists.txt
396 +@@ -157,15 +157,13 @@
397 + MiniCore
398 + MTFH
399 + STFH
400 +- ${OPENGL_gl_LIBRARY}
401 +- ${OPENGL_glu_LIBRARY}
402 + ${OPENAL_LIBRARY}
403 + ${VORBISFILE_LIBRARIES}
404 + ${VORBISFILE_LIB} # Valid only with MSVC
405 + ${VORBIS_LIB} # Valid only with MSVC
406 + ${OGG_LIB}) # Valid only with MSVC
407 +
408 +-target_link_libraries(${GAME_BINARY_NAME} ${COMMON_LIBS} Qt5::OpenGL Qt5::Xml)
409 ++target_link_libraries(${GAME_BINARY_NAME} ${COMMON_LIBS} Qt5::OpenGL Qt5::Xml OpenGL::GL)
410 +
411 + foreach(TS_FILE ${TS})
412 + # Make targets to copy generated qm files to data dir. This is done the hard
413 +diff -u a/src/game/MiniCore/CMakeLists.txt b/src/game/MiniCore/CMakeLists.txt
414 +--- a/src/game/MiniCore/CMakeLists.txt
415 ++++ b/src/game/MiniCore/CMakeLists.txt
416 +@@ -88,7 +88,7 @@
417 +
418 + add_library(MiniCore ${MiniCoreSRC})
419 +
420 +-target_link_libraries(MiniCore Qt5::OpenGL Qt5::Xml)
421 ++target_link_libraries(MiniCore Qt5::Core Qt5::OpenGL Qt5::Xml OpenGL::GL)
422 +
423 + if(BUILD_TESTING)
424 + add_subdirectory(UnitTests)