commit: f617ecaa12023da72ed203244b95be0513017c5d Author: Cristian Othón Martínez Vera <cfuga <AT> cfuga <DOT> mx> AuthorDate: Tue Jan 20 01:22:36 2026 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Feb 11 07:46:15 2026 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f617ecaa
games-fps/red-blue-quake2: add 0.1-r2 * update EAPI 7 -> 8 * add dep `x11-libs/libXext` * add dep `x11-libs/libXxf86dga` * support for c99 * support for c23 Closes: https://bugs.gentoo.org/926464 Closes: https://bugs.gentoo.org/941190 Closes: https://bugs.gentoo.org/948964 Signed-off-by: Cristian Othón Martínez Vera <cfuga <AT> cfuga.mx> Part-of: https://github.com/gentoo/gentoo/pull/45450 Closes: https://github.com/gentoo/gentoo/pull/45450 Signed-off-by: Sam James <sam <AT> gentoo.org> .../files/red-blue-quake2-0.1-c23.patch | 24 ++++ .../files/red-blue-quake2-0.1-c99.patch | 138 +++++++++++++++++++++ .../red-blue-quake2/red-blue-quake2-0.1-r2.ebuild | 79 ++++++++++++ 3 files changed, 241 insertions(+) diff --git a/games-fps/red-blue-quake2/files/red-blue-quake2-0.1-c23.patch b/games-fps/red-blue-quake2/files/red-blue-quake2-0.1-c23.patch new file mode 100644 index 000000000000..920e96100a49 --- /dev/null +++ b/games-fps/red-blue-quake2/files/red-blue-quake2-0.1-c23.patch @@ -0,0 +1,24 @@ +Bug: https://bugs.gentoo.org/948964 + +--- a/ctf/q_shared.h ++++ b/ctf/q_shared.h +@@ -52,7 +52,7 @@ + #endif + + typedef unsigned char byte; +-typedef enum {false, true} qboolean; ++typedef int qboolean; + + + #ifndef NULL +--- a/game/q_shared.h ++++ b/game/q_shared.h +@@ -52,7 +52,7 @@ + #endif + + typedef unsigned char byte; +-typedef enum {false, true} qboolean; ++typedef int qboolean; + + + #ifndef NULL diff --git a/games-fps/red-blue-quake2/files/red-blue-quake2-0.1-c99.patch b/games-fps/red-blue-quake2/files/red-blue-quake2-0.1-c99.patch new file mode 100644 index 000000000000..f464f5945e7e --- /dev/null +++ b/games-fps/red-blue-quake2/files/red-blue-quake2-0.1-c99.patch @@ -0,0 +1,138 @@ +Bug: https://bugs.gentoo.org/926464 + +--- a/client/menu.c ++++ b/client/menu.c +@@ -1402,8 +1402,8 @@ + */ + static int credits_start_time; + static const char **credits; +-static char *creditsIndex[256]; +-static char *creditsBuffer; ++static const char *creditsIndex[256]; ++static void *creditsBuffer; + static const char *idcredits[] = + { + "+QUAKE II BY ID SOFTWARE", +@@ -2603,7 +2603,7 @@ + s_startmap_list.generic.x = 0; + s_startmap_list.generic.y = 0; + s_startmap_list.generic.name = "initial map"; +- s_startmap_list.itemnames = mapnames; ++ s_startmap_list.itemnames = (const char **) mapnames; + + s_rules_box.generic.type = MTYPE_SPINCONTROL; + s_rules_box.generic.x = 0; +@@ -3395,7 +3395,7 @@ + + static void ModelCallback( void *unused ) + { +- s_player_skin_box.itemnames = s_pmi[s_player_model_box.curvalue].skindisplaynames; ++ s_player_skin_box.itemnames = (const char **) s_pmi[s_player_model_box.curvalue].skindisplaynames; + s_player_skin_box.curvalue = 0; + } + +@@ -3684,7 +3684,7 @@ + s_player_model_box.generic.callback = ModelCallback; + s_player_model_box.generic.cursor_offset = -48; + s_player_model_box.curvalue = currentdirectoryindex; +- s_player_model_box.itemnames = s_pmnames; ++ s_player_model_box.itemnames = (const char **) s_pmnames; + + s_player_skin_title.generic.type = MTYPE_SEPARATOR; + s_player_skin_title.generic.name = "skin"; +@@ -3698,7 +3698,7 @@ + s_player_skin_box.generic.callback = 0; + s_player_skin_box.generic.cursor_offset = -48; + s_player_skin_box.curvalue = currentskinindex; +- s_player_skin_box.itemnames = s_pmi[currentdirectoryindex].skindisplaynames; ++ s_player_skin_box.itemnames = (const char **) s_pmi[currentdirectoryindex].skindisplaynames; + + s_player_hand_title.generic.type = MTYPE_SEPARATOR; + s_player_hand_title.generic.name = "handedness"; +--- a/ctf/g_items.c ++++ b/ctf/g_items.c +@@ -2211,7 +2211,7 @@ + "item_flag_team1", + CTFPickup_Flag, + NULL, +- CTFDrop_Flag, //Should this be null if we don't want players to drop it manually? ++ NULL, + NULL, + "ctf/flagtk.wav", + "players/male/flag1.md2", EF_FLAG1, +@@ -2234,7 +2234,7 @@ + "item_flag_team2", + CTFPickup_Flag, + NULL, +- CTFDrop_Flag, //Should this be null if we don't want players to drop it manually? ++ NULL, + NULL, + "ctf/flagtk.wav", + "players/male/flag2.md2", EF_FLAG2, +--- a/game/m_boss31.c ++++ b/game/m_boss31.c +@@ -28,7 +28,7 @@ + #include "g_local.h" + #include "m_boss31.h" + +-extern SP_monster_makron (edict_t *self); ++extern void SP_monster_makron (edict_t *self); + qboolean visible (edict_t *self, edict_t *other); + + static int sound_pain1; +--- a/game/q_shared.h ++++ b/game/q_shared.h +@@ -32,6 +32,7 @@ + #endif + + #include <assert.h> ++#include <ctype.h> + #include <math.h> + #include <stdio.h> + #include <stdarg.h> +--- a/linux/net_udp.c ++++ b/linux/net_udp.c +@@ -25,6 +25,7 @@ + #include <sys/socket.h> + #include <sys/time.h> + #include <netinet/in.h> ++#include <arpa/inet.h> + #include <netdb.h> + #include <sys/param.h> + #include <sys/ioctl.h> +--- a/linux/q_shlinux.c ++++ b/linux/q_shlinux.c +@@ -23,6 +23,12 @@ + #include <stdio.h> + #include <dirent.h> + #include <unistd.h> ++#ifndef __USE_GNU /* mremap(2) + glibc */ ++#define __USE_GNU ++#endif ++#ifndef _GNU_SOURCE /* mremap(2) + musl */ ++#define _GNU_SOURCE ++#endif + #include <sys/mman.h> + #include <sys/time.h> + +--- a/linux/snd_linux.c ++++ b/linux/snd_linux.c +@@ -54,7 +54,7 @@ + extern uid_t saved_euid; + + if (snd_inited) +- return; ++ return 0; + + if (!snddevice) { + sndbits = Cvar_Get("sndbits", "16", CVAR_ARCHIVE); +--- a/linux/rw_x11.c ++++ b/linux/rw_x11.c +@@ -33,6 +33,7 @@ + */ + + #include <ctype.h> ++#include <sys/mman.h> + #include <sys/time.h> + #include <sys/types.h> + #include <unistd.h> diff --git a/games-fps/red-blue-quake2/red-blue-quake2-0.1-r2.ebuild b/games-fps/red-blue-quake2/red-blue-quake2-0.1-r2.ebuild new file mode 100644 index 000000000000..88657927ff3f --- /dev/null +++ b/games-fps/red-blue-quake2/red-blue-quake2-0.1-r2.ebuild @@ -0,0 +1,79 @@ +# Copyright 1999-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit toolchain-funcs + +DESCRIPTION="Red-blue Quake II! Play quake2 with 3D glasses!" +HOMEPAGE="https://www.jfedor.org/red-blue-quake2/" +SRC_URI="mirror://idsoftware/source/q2source-3.21.zip + https://www.jfedor.org/red-blue-quake2/${P}.tar.gz" +S="${WORKDIR}"/quake2-3.21 + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="~x86" + +RDEPEND=" + x11-libs/libX11 + x11-libs/libXext + x11-libs/libXxf86dga +" +DEPEND="${RDEPEND}" +BDEPEND="app-arch/unzip" + +PATCHES=( + "${FILESDIR}"/${PV}-gentoo.patch + "${FILESDIR}"/${P}-gcc41.patch + "${FILESDIR}"/${P}-ldflags.patch + "${FILESDIR}"/${P}-c99.patch + "${FILESDIR}"/${P}-c23.patch +) + +src_prepare() { + default + + cd linux || die + + sed -i \ + -e "s:GENTOO_DIR:$(get_libdir)/${PN}:" \ + sys_linux.c || die + + sed -i \ + -e "s:/etc/quake2.conf:/etc/${PN}.conf:" \ + sys_linux.c vid_so.c || die + + sed -i \ + -e 's:-O6::' \ + -e 's:-g::' \ + Makefile || die + + echo "$(get_libdir)"/${PN} > "${T}"/${PN}.conf || die +} + +src_compile() { + cd linux || die + + mkdir -p releasei386-glibc/ref_soft || die + + emake \ + CC="$(tc-getCC)" \ + GENTOO_CFLAGS="${CFLAGS}" \ + GENTOO_DATADIR=/usr/share/quake2/baseq2/ \ + build_release +} + +src_install() { + cd linux/release* || die + + exeinto "$(get_libdir)"/${PN} + doexe gamei386.so ref_softx.so + + exeinto "$(get_libdir)"/${PN}/ctf + doexe ctf/gamei386.so + newbin quake2 red-blue-quake2 + + insinto /etc + doins "${T}"/${PN}.conf +}
