Gentoo Archives: gentoo-commits

From: Marek Szuba <marecki@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: profiles/, games-strategy/hedgewars/files/, games-strategy/hedgewars/
Date: Tue, 01 Dec 2020 22:27:19
Message-Id: 1606861626.727ef34a6076430ed3b1b74586f5474f40b55324.marecki@gentoo
1 commit: 727ef34a6076430ed3b1b74586f5474f40b55324
2 Author: Marek Szuba <marecki <AT> gentoo <DOT> org>
3 AuthorDate: Tue Dec 1 22:24:42 2020 +0000
4 Commit: Marek Szuba <marecki <AT> gentoo <DOT> org>
5 CommitDate: Tue Dec 1 22:27:06 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=727ef34a
7
8 games-strategy/hedgewars: migrate to lua-single.eclass
9
10 Locked to 5.1 but by using a bundled version of FindLua.cmake which only
11 considers that version rather than looking for the package "Lua51".
12 Therefore, I have already put machinery in place which requests a specific
13 Lua version.
14
15 BTW. All tests of both this ebuild and its unmigrated counterpart fail with
16 "unsupported image format" unless media-libs/sdl2-image has been built in
17 USE=png. Haven't checked what happens at run time.
18
19 Closes: https://bugs.gentoo.org/752714
20 Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>
21
22 .../files/hedgewars-1.0.0-cmake_lua_version.patch | 11 ++
23 .../hedgewars/hedgewars-1.0.0-r100.ebuild | 112 +++++++++++++++++++++
24 profiles/package.mask | 1 +
25 3 files changed, 124 insertions(+)
26
27 diff --git a/games-strategy/hedgewars/files/hedgewars-1.0.0-cmake_lua_version.patch b/games-strategy/hedgewars/files/hedgewars-1.0.0-cmake_lua_version.patch
28 new file mode 100644
29 index 00000000000..b1daa255112
30 --- /dev/null
31 +++ b/games-strategy/hedgewars/files/hedgewars-1.0.0-cmake_lua_version.patch
32 @@ -0,0 +1,11 @@
33 +--- a/CMakeLists.txt
34 ++++ b/CMakeLists.txt
35 +@@ -202,7 +202,7 @@
36 + #lua discovery
37 + if(LUA_SYSTEM)
38 + if(NOT LUA_LIBRARY OR NOT LUA_INCLUDE_DIR)
39 +- find_package(Lua)
40 ++ find_package(Lua ${LUA_VERSION} EXACT REQUIRED)
41 + endif()
42 +
43 + if(LUA_LIBRARY AND LUA_INCLUDE_DIR)
44
45 diff --git a/games-strategy/hedgewars/hedgewars-1.0.0-r100.ebuild b/games-strategy/hedgewars/hedgewars-1.0.0-r100.ebuild
46 new file mode 100644
47 index 00000000000..8f127f79072
48 --- /dev/null
49 +++ b/games-strategy/hedgewars/hedgewars-1.0.0-r100.ebuild
50 @@ -0,0 +1,112 @@
51 +# Copyright 1999-2020 Gentoo Authors
52 +# Distributed under the terms of the GNU General Public License v2
53 +
54 +EAPI=7
55 +
56 +CMAKE_MAKEFILE_GENERATOR=emake
57 +LUA_COMPAT=( lua5-1 )
58 +
59 +inherit cmake lua-single xdg-utils
60 +
61 +MY_P=${PN}-src-${PV}
62 +
63 +DESCRIPTION="A turn-based strategy, artillery, action and comedy game"
64 +HOMEPAGE="https://www.hedgewars.org/"
65 +SRC_URI="https://www.hedgewars.org/download/releases/${MY_P}.tar.bz2"
66 +
67 +LICENSE="GPL-2 Apache-2.0 FDL-1.3"
68 +SLOT="0"
69 +KEYWORDS="~amd64 ~x86"
70 +IUSE="server"
71 +
72 +REQUIRED_USE="${LUA_REQUIRED_USE}"
73 +
74 +QA_FLAGS_IGNORED="/usr/bin/hwengine" # pascal sucks
75 +QA_PRESTRIPPED="/usr/bin/hwengine" # pascal sucks
76 +
77 +# qtcore:5= - depends on private header
78 +DEPEND="${LUA_DEPS}
79 + >=dev-games/physfs-3.0.1
80 + dev-qt/qtcore:5=
81 + dev-qt/qtgui:5
82 + dev-qt/qtnetwork:5
83 + dev-qt/qtwidgets:5
84 + media-libs/libpng:0=
85 + media-libs/libsdl2:=
86 + media-libs/sdl2-image:=
87 + media-libs/sdl2-mixer:=[vorbis]
88 + media-libs/sdl2-net:=
89 + media-libs/sdl2-ttf:=
90 + sys-libs/zlib
91 + !x86? ( media-video/ffmpeg:= )
92 + "
93 +RDEPEND="${DEPEND}
94 + app-arch/xz-utils
95 + >=media-fonts/dejavu-2.28
96 + media-fonts/wqy-zenhei"
97 +BDEPEND="
98 + dev-qt/linguist-tools:5
99 + server? (
100 + >=dev-lang/ghc-6.10
101 + dev-haskell/entropy
102 + dev-haskell/hslogger
103 + >=dev-haskell/mtl-2
104 + >=dev-haskell/network-2.3
105 + dev-haskell/random
106 + dev-haskell/regex-tdfa
107 + dev-haskell/sandi
108 + dev-haskell/sha
109 + dev-haskell/vector
110 + dev-haskell/utf8-string
111 + dev-haskell/yaml
112 + >=dev-haskell/zlib-0.5.3 <dev-haskell/zlib-0.6
113 + )
114 + !x86? ( >=dev-lang/fpc-2.4 )
115 + x86? (
116 + >=dev-lang/ghc-6.10
117 + dev-haskell/parsec
118 + )"
119 +
120 +PATCHES=(
121 + "${FILESDIR}/${P}-qt-5.15.patch"
122 + "${FILESDIR}/${PN}-1.0.0-cmake_lua_version.patch"
123 +)
124 +
125 +S="${WORKDIR}"/${MY_P}
126 +
127 +src_configure() {
128 + local mycmakeargs=(
129 + -DMINIMAL_FLAGS=ON
130 + -DDATA_INSTALL_DIR="${EPREFIX}/usr/share/${PN}"
131 + -Dtarget_binary_install_dir="${EPREFIX}/usr/bin"
132 + -Dtarget_library_install_dir="${EPREFIX}/usr/$(get_libdir)"
133 + -DNOSERVER=$(usex !server)
134 + -DBUILD_ENGINE_C=$(usex x86)
135 + -DNOVIDEOREC=$(usex !x86)
136 + -DCMAKE_VERBOSE_MAKEFILE=TRUE
137 + # Need to tell the build system where the fonts are located
138 + # as it uses PhysFS' symbolic link protection mode which
139 + # prevents us from symlinking the fonts into the right directory
140 + # https://hg.hedgewars.org/hedgewars/rev/76ad55807c24
141 + # https://icculus.org/physfs/docs/html/physfs_8h.html#aad451d9b3f46f627a1be8caee2eef9b7
142 + -DFONTS_DIRS="${EPREFIX}/usr/share/fonts/wqy-zenhei;${EPREFIX}/usr/share/fonts/dejavu"
143 + # upstream sets RPATH that leads to weird breakage
144 + # https://bugzilla.redhat.com/show_bug.cgi?id=1200193
145 + -DCMAKE_SKIP_RPATH=ON
146 + -DLUA_VERSION=$(lua_get_version)
147 + )
148 + cmake_src_configure
149 +}
150 +
151 +src_install() {
152 + cmake_src_install
153 + doman man/${PN}.6
154 +}
155 +
156 +pkg_postinst() {
157 + xdg_desktop_database_update
158 +}
159 +
160 +pkg_postrm() {
161 + xdg_desktop_database_update
162 +}
163
164 diff --git a/profiles/package.mask b/profiles/package.mask
165 index 415ef0457d9..de708ef1857 100644
166 --- a/profiles/package.mask
167 +++ b/profiles/package.mask
168 @@ -578,6 +578,7 @@ dev-lua/luacrypto
169 >=games-rpg/sumwars-0.5.8-r100
170 >=games-simulation/corsix-th-0.64-r100
171 >=games-sports/xmoto-0.6.1-r100
172 +>=games-strategy/hedgewars-1.0.0-r100
173 >=games-util/slade-3.1.12a-r100
174 >=mail-filter/imapfilter-2.6.16-r100
175 >=media-gfx/geeqie-1.5.1-r1