Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: games-fps/yamagi-quake2/, games-fps/yamagi-quake2/files/
Date: Sun, 04 Mar 2018 11:38:34
Message-Id: 1520163500.f405aa6406f2d58f628fcb4cf265fa8e863705e0.mgorny@gentoo
1 commit: f405aa6406f2d58f628fcb4cf265fa8e863705e0
2 Author: Alexander Tsoy <alexander <AT> tsoy <DOT> me>
3 AuthorDate: Thu Jan 18 23:33:23 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 4 11:38:20 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f405aa64
7
8 games-fps/yamagi-quake2: new package
9
10 This is the Yamagi Quake II Client, an enhanced version of id Software's
11 Quake II with focus on offline and coop gameplay. Both the gameplay and
12 the graphics are unchanged, but many bugs in the last official release
13 were fixed and some nice to have features like widescreen support and a
14 modern OpenGL 3.2 renderer were added. Unlike most other Quake II source
15 ports Yamagi Quake II is fully 64 bit clean and is still actively
16 maintained.
17
18 Closes: https://bugs.gentoo.org/314751
19
20 games-fps/yamagi-quake2/Manifest | 4 +
21 .../files/yamagi-quake2-addon-respect-flags.patch | 30 +++++
22 .../files/yamagi-quake2-respect-flags.patch | 40 +++++++
23 games-fps/yamagi-quake2/metadata.xml | 21 ++++
24 games-fps/yamagi-quake2/yamagi-quake2-7.10.ebuild | 132 +++++++++++++++++++++
25 5 files changed, 227 insertions(+)
26
27 diff --git a/games-fps/yamagi-quake2/Manifest b/games-fps/yamagi-quake2/Manifest
28 new file mode 100644
29 index 00000000000..d608a375340
30 --- /dev/null
31 +++ b/games-fps/yamagi-quake2/Manifest
32 @@ -0,0 +1,4 @@
33 +DIST quake2-7.10.tar.xz 1792748 BLAKE2B 853d6db1eec46ce40952fd413a259653275081599a940941fc883921b310f436be62b80a1d911a0d8f95a33e540e60bd6db2377370cc443cbaa9c3eec6ae055f SHA512 46247c3e2c8e6dcb056dfc7785dd63bf4f896719894a1c5467f2eb313cc3d8a892fda9bafc2ca760a9ac96f6b8e23485a8740b03e118cf9a524f68657183fbb9
34 +DIST quake2-ctf-1.05.tar.xz 134872 BLAKE2B eb987004b1c1b1743ec532b6bea96a257957377cbdb0571d6c6e7b2dae6c1b7abc154233d4f9d3af6fb546d7810e5c041b8e9293de2e409a7cace88aa455f526 SHA512 9eb951f4a9d7abc5f9a2ca53d886f68b745c1efdf3fea14db2e071b8d1592d33579c5fa56326aa583269a4810e16a7eda8dcd8930e36782cb4fcb8578c44951b
35 +DIST quake2-rogue-2.04.tar.xz 240436 BLAKE2B e7c3660378fe40b3f514b6e1de8714e3d3550baa244897b98bb81f362fa2b0aa57e3abceb5a38ea77cfec7621e2fcfab342a45bf9b66ccd0e44cc70292888fc2 SHA512 546deb74175c60ed7e5600a3d4b1c983fc0b1fae5922ebdb8fc3cdc5584931a0a5e34914ec2cd4ef9815323ba82cb56d427986d5c91dc040d6b68baff68ca5a8
36 +DIST quake2-xatrix-2.05.tar.xz 189888 BLAKE2B 9d884af6033d529ce8cca7a70a36608e45db47dab74ab0d88c04f4d928425cf22901b1299a69330bfa83810034c9f1eff2d9618b222db68564d81d569f0596cd SHA512 f7e14bb870eaf4515405f5f1162057669351a334993410101973b75e52d6d576c35c91112911f961ad122ebe664b294649e94e88a2f62b79f51e28d02f50487a
37
38 diff --git a/games-fps/yamagi-quake2/files/yamagi-quake2-addon-respect-flags.patch b/games-fps/yamagi-quake2/files/yamagi-quake2-addon-respect-flags.patch
39 new file mode 100644
40 index 00000000000..d767f04d4b0
41 --- /dev/null
42 +++ b/games-fps/yamagi-quake2/files/yamagi-quake2-addon-respect-flags.patch
43 @@ -0,0 +1,30 @@
44 +--- a/Makefile 2017-05-25 12:45:51.000000000 +0300
45 ++++ b/Makefile 2018-01-14 17:38:34.540167879 +0300
46 +@@ -64,11 +64,11 @@
47 + #
48 + # -MMD to generate header dependencies.
49 + ifeq ($(OSTYPE), Darwin)
50 +-CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
51 +- -Wall -pipe -g -fwrapv -arch i386 -arch x86_64
52 ++CFLAGS += -fno-strict-aliasing -fomit-frame-pointer \
53 ++ -Wall -fwrapv -arch i386 -arch x86_64
54 + else
55 +-CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
56 +- -Wall -pipe -g -MMD -fwrapv
57 ++CFLAGS += -fno-strict-aliasing -fomit-frame-pointer \
58 ++ -Wall -MMD -fwrapv
59 + endif
60 +
61 + # ----------
62 +@@ -80,9 +80,9 @@
63 +
64 + # Base LDFLAGS.
65 + ifeq ($(OSTYPE), Darwin)
66 +-LDFLAGS := -shared -arch i386 -arch x86_64
67 ++LDFLAGS += -shared -arch i386 -arch x86_64
68 + else
69 +-LDFLAGS := -shared
70 ++LDFLAGS += -shared
71 + endif
72 +
73 + # ----------
74
75 diff --git a/games-fps/yamagi-quake2/files/yamagi-quake2-respect-flags.patch b/games-fps/yamagi-quake2/files/yamagi-quake2-respect-flags.patch
76 new file mode 100644
77 index 00000000000..76ac4b60f50
78 --- /dev/null
79 +++ b/games-fps/yamagi-quake2/files/yamagi-quake2-respect-flags.patch
80 @@ -0,0 +1,40 @@
81 +--- a/Makefile 2017-12-08 12:22:59.000000000 +0300
82 ++++ b/Makefile 2018-01-14 15:42:56.804047742 +0300
83 +@@ -165,12 +165,12 @@
84 + # -MMD to generate header dependencies. (They cannot be
85 + # generated if building universal binaries on OSX)
86 + ifeq ($(YQ2_OSTYPE), Darwin)
87 +-CFLAGS := -O2 -fno-strict-aliasing -fomit-frame-pointer \
88 +- -Wall -pipe -g -fwrapv
89 ++CFLAGS += -fno-strict-aliasing -fomit-frame-pointer \
90 ++ -Wall -fwrapv
91 + CFLAGS += $(OSX_ARCH)
92 + else
93 +-CFLAGS := -std=gnu99 -O2 -fno-strict-aliasing \
94 +- -Wall -pipe -g -ggdb -MMD -fwrapv
95 ++CFLAGS += -std=gnu99 -fno-strict-aliasing \
96 ++ -Wall -MMD -fwrapv
97 + endif
98 +
99 + # ----------
100 +@@ -263,15 +263,15 @@
101 +
102 + # Base LDFLAGS.
103 + ifeq ($(YQ2_OSTYPE),Linux)
104 +-LDFLAGS := -L/usr/lib -lm -ldl -rdynamic
105 ++LDFLAGS += -lm -ldl -rdynamic
106 + else ifeq ($(YQ2_OSTYPE),FreeBSD)
107 +-LDFLAGS := -L/usr/local/lib -lm
108 ++LDFLAGS += -lm
109 + else ifeq ($(YQ2_OSTYPE),OpenBSD)
110 +-LDFLAGS := -L/usr/local/lib -lm
111 ++LDFLAGS += -lm
112 + else ifeq ($(YQ2_OSTYPE),Windows)
113 +-LDFLAGS := -L/usr/lib -lws2_32 -lwinmm -static-libgcc
114 ++LDFLAGS += -lws2_32 -lwinmm -static-libgcc
115 + else ifeq ($(YQ2_OSTYPE), Darwin)
116 +-LDFLAGS := $(OSX_ARCH) -lm
117 ++LDFLAGS += $(OSX_ARCH) -lm
118 + endif
119 +
120 + CFLAGS += -fvisibility=hidden
121
122 diff --git a/games-fps/yamagi-quake2/metadata.xml b/games-fps/yamagi-quake2/metadata.xml
123 new file mode 100644
124 index 00000000000..c573477de06
125 --- /dev/null
126 +++ b/games-fps/yamagi-quake2/metadata.xml
127 @@ -0,0 +1,21 @@
128 +<?xml version="1.0" encoding="UTF-8"?>
129 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
130 +<pkgmetadata>
131 + <maintainer type="person">
132 + <email>alexander@××××.me</email>
133 + <name>Alexander Tsoy</name>
134 + </maintainer>
135 + <maintainer type="project">
136 + <email>proxy-maint@g.o</email>
137 + <name>Proxy Maintainers</name>
138 + </maintainer>
139 + <upstream>
140 + <remote-id type="github">yquake2/yquake2</remote-id>
141 + </upstream>
142 + <use>
143 + <flag name="client">Build client</flag>
144 + <flag name="ctf">Build support for the 'Capture The Flag' addon</flag>
145 + <flag name="rogue">Build support for the 'Ground Zero' Mission Pack</flag>
146 + <flag name="xatrix">Build support for the 'The Reckoning' Mission Pack</flag>
147 + </use>
148 +</pkgmetadata>
149
150 diff --git a/games-fps/yamagi-quake2/yamagi-quake2-7.10.ebuild b/games-fps/yamagi-quake2/yamagi-quake2-7.10.ebuild
151 new file mode 100644
152 index 00000000000..09f38aad41c
153 --- /dev/null
154 +++ b/games-fps/yamagi-quake2/yamagi-quake2-7.10.ebuild
155 @@ -0,0 +1,132 @@
156 +# Copyright 1999-2018 Gentoo Foundation
157 +# Distributed under the terms of the GNU General Public License v2
158 +
159 +EAPI=6
160 +
161 +inherit desktop eutils
162 +
163 +CTF_V=1.05
164 +ROGUE_V=2.04
165 +XATRIX_V=2.05
166 +
167 +DESCRIPTION="Quake 2 engine focused on single player"
168 +HOMEPAGE="https://www.yamagi.org/quake2/"
169 +SRC_URI="https://deponie.yamagi.org/quake2/quake2-${PV}.tar.xz
170 + ctf? ( https://deponie.yamagi.org/quake2/quake2-ctf-${CTF_V}.tar.xz )
171 + rogue? ( https://deponie.yamagi.org/quake2/quake2-rogue-${ROGUE_V}.tar.xz )
172 + xatrix? ( https://deponie.yamagi.org/quake2/quake2-xatrix-${XATRIX_V}.tar.xz )"
173 +
174 +LICENSE="GPL-2"
175 +SLOT="0"
176 +KEYWORDS="~amd64 ~x86"
177 +IUSE="+client ctf dedicated ogg openal rogue xatrix"
178 +REQUIRED_USE="|| ( client dedicated )"
179 +
180 +RDEPEND="sys-libs/zlib:0=
181 + client? (
182 + media-libs/libsdl2[opengl,video]
183 + virtual/opengl
184 + ogg? (
185 + media-libs/libogg
186 + media-libs/libvorbis
187 + )
188 + openal? ( media-libs/openal )
189 + !openal? ( media-libs/libsdl2[sound] )
190 + )
191 +"
192 +
193 +DEPEND="${RDEPEND}"
194 +
195 +S="${WORKDIR}/quake2-${PV}"
196 +
197 +PATCHES=( "${FILESDIR}"/${PN}-respect-flags.patch )
198 +DOCS=( CHANGELOG CONTRIBUTE README.md )
199 +
200 +mymake() {
201 + emake \
202 + VERBOSE=1 \
203 + DLOPEN_OPENAL=no \
204 + WITH_CDA=no \
205 + WITH_SYSTEMWIDE=yes \
206 + WITH_SYSTEMDIR="${EPREFIX}"/usr/share/games/quake2 \
207 + WITH_ZIP=yes \
208 + WITH_OGG=$(usex ogg) \
209 + WITH_OPENAL=$(usex openal) \
210 + "$@"
211 +}
212 +
213 +src_prepare() {
214 + local addon
215 + for addon in ctf rogue xatrix; do
216 + use ${addon} || continue
217 +
218 + pushd "${WORKDIR}"/quake2-${addon}-* >/dev/null || die
219 + eapply -l -- "${FILESDIR}"/${PN}-addon-respect-flags.patch
220 + popd >/dev/null || die
221 + done
222 +
223 + default
224 +}
225 +
226 +src_compile() {
227 + local targets=( game )
228 + use client && targets+=( client ref_gl1 ref_gl3 )
229 + use dedicated && targets+=( server )
230 +
231 + mymake config
232 + mymake "${targets[@]}"
233 +
234 + local addon
235 + for addon in ctf rogue xatrix; do
236 + use ${addon} || continue
237 + emake -C "${WORKDIR}"/quake2-${addon}-* VERBOSE=1
238 + done
239 +}
240 +
241 +src_install() {
242 + insinto /usr/lib/yamagi-quake2
243 + # Yamagi Quake II expects all binaries to be in the same directory
244 + # See stuff/packaging.md for more info
245 + exeinto /usr/lib/yamagi-quake2
246 + doins -r release/.
247 +
248 + if use client; then
249 + doexe release/quake2
250 + dosym ../lib/yamagi-quake2/quake2 /usr/bin/yquake2
251 +
252 + newicon stuff/icon/Quake2.svg "yamagi-quake2.svg"
253 + make_desktop_entry "yquake2" "Yamagi Quake II"
254 + fi
255 +
256 + if use dedicated; then
257 + doexe release/q2ded
258 + dosym ../lib/yamagi-quake2/q2ded /usr/bin/yq2ded
259 + fi
260 +
261 + insinto /usr/lib/yamagi-quake2/baseq2
262 + doins stuff/yq2.cfg
263 +
264 + local addon
265 + for addon in ctf rogue xatrix; do
266 + use ${addon} || continue
267 +
268 + insinto /usr/lib/yamagi-quake2/${addon}
269 + doins "${WORKDIR}"/quake2-${addon}-*/release/game.so
270 +
271 + local addon_name
272 + case ${addon} in
273 + ctf) addon_name="CTF" ;;
274 + rogue) addon_name="Ground Zero" ;;
275 + xatrix) addon_name="The Reckoning" ;;
276 + esac
277 +
278 + make_wrapper "yquake2-${addon}" "yquake2 +set game ${addon}"
279 + make_desktop_entry "yquake2-${addon}" "Yamagi Quake II: ${addon_name}"
280 + done
281 +
282 + einstalldocs
283 + if use client; then
284 + docinto examples
285 + dodoc stuff/cdripper.sh
286 + fi
287 +}