1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
12 DESCRIPTION="Quake 2 engine focused on single player"
13 HOMEPAGE="https://www.yamagi.org/quake2/"
14 SRC_URI="https://deponie.yamagi.org/quake2/quake2-${PV}.tar.xz
15 ctf? ( https://deponie.yamagi.org/quake2/quake2-ctf-${CTF_V}.tar.xz )
16 rogue? ( https://deponie.yamagi.org/quake2/quake2-rogue-${ROGUE_V}.tar.xz )
17 xatrix? ( https://deponie.yamagi.org/quake2/quake2-xatrix-${XATRIX_V}.tar.xz )"
21 KEYWORDS="~amd64 ~x86"
22 IUSE="+client ctf dedicated openal +opengl rogue softrender xatrix"
24 || ( client dedicated )
25 client? ( || ( opengl softrender ) )
30 media-libs/libsdl2[video]
31 !openal? ( media-libs/libsdl2[sound] )
33 media-libs/libsdl2[opengl]
38 RDEPEND="${COMMON_DEPEND}
39 client? ( openal? ( media-libs/openal ) )
41 DEPEND="${COMMON_DEPEND}"
43 S="${WORKDIR}/quake2-${PV}"
46 "${FILESDIR}"/${PN}-respect-flags.patch
47 "${FILESDIR}"/${PN}-7.42-fno-common.patch
49 DOCS=( CHANGELOG README.md doc/. )
55 WITH_SYSTEMDIR="${EPREFIX}"/usr/share/games/quake2 \
56 WITH_OPENAL=$(usex openal) \
62 for addon in ctf rogue xatrix; do
63 use ${addon} || continue
65 pushd "${WORKDIR}"/quake2-${addon}-* >/dev/null || die
66 if [[ ${addon} = ctf ]]; then
67 eapply -l -- "${FILESDIR}"/${PN}-addon-respect-flags-r2.patch
69 eapply -l -- "${FILESDIR}"/${PN}-addon-respect-flags-r3.patch
71 popd >/dev/null || die
78 local targets=( game )
81 use opengl && targets+=( ref_gl1 ref_gl3 )
82 use softrender && targets+=( ref_soft )
84 use dedicated && targets+=( server )
87 mymake "${targets[@]}"
90 for addon in ctf rogue xatrix; do
91 use ${addon} || continue
92 emake -C "${WORKDIR}"/quake2-${addon}-* VERBOSE=1
97 insinto /usr/lib/yamagi-quake2
98 # Yamagi Quake II expects all binaries to be in the same directory
99 # See stuff/packaging.md for more info
100 exeinto /usr/lib/yamagi-quake2
105 dosym ../lib/yamagi-quake2/quake2 /usr/bin/yquake2
107 newicon stuff/icon/Quake2.svg "yamagi-quake2.svg"
108 make_desktop_entry "yquake2" "Yamagi Quake II"
111 if use dedicated; then
113 dosym ../lib/yamagi-quake2/q2ded /usr/bin/yq2ded
116 insinto /usr/lib/yamagi-quake2/baseq2
120 for addon in ctf rogue xatrix; do
121 use ${addon} || continue
123 insinto /usr/lib/yamagi-quake2/${addon}
124 doins "${WORKDIR}"/quake2-${addon}-*/release/game.so
129 ctf) addon_name="CTF" ;;
130 rogue) addon_name="Ground Zero" ;;
131 xatrix) addon_name="The Reckoning" ;;
134 make_wrapper "yquake2-${addon}" "yquake2 +set game ${addon}"
135 make_desktop_entry "yquake2-${addon}" "Yamagi Quake II: ${addon_name}"
142 dodoc stuff/cdripper.sh
147 if [[ -z ${REPLACING_VERSIONS} ]]; then
149 elog "In order to play, you must at least install:"
150 elog "games-fps/quake2-data or games-fps/quake2-demodata or copy game"
151 elog "data files to ~/.yq2/ or ${EPREFIX}/usr/share/games/quake2/ manually."
152 elog "Read ${EPREFIX}/usr/share/doc/${PF}/README.md* for more information."