commit:     6d678996b67e8cf3150d03fb17067754587f42d7
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  6 22:45:35 2022 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Wed Jul  6 22:45:35 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d678996

games-fps/gzdoom: Version bump to 4.8.2

Upstream broke this for distros in 4.8.0. This still hasn't been properly fixed,
so we just have to revert the breaking commit in the meantime. OpenSUSE has
already done the same for a while.

Upstream has seemingly also dropped support for 32-bit platforms. OpenSUSE is
reverting the line that prevents the build for working, but I'm trying to find
out more from upstream before we take action.

Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 games-fps/gzdoom/Manifest                          |   1 +
 ...rt-load-the-hex-font-as-early-as-possible.patch | 129 +++++++++++++++++++++
 games-fps/gzdoom/gzdoom-4.8.2.ebuild               |  85 ++++++++++++++
 3 files changed, 215 insertions(+)

diff --git a/games-fps/gzdoom/Manifest b/games-fps/gzdoom/Manifest
index 9712094c2ea3..3fad5682d972 100644
--- a/games-fps/gzdoom/Manifest
+++ b/games-fps/gzdoom/Manifest
@@ -1 +1,2 @@
 DIST gzdoom-4.7.1.tar.gz 19562412 BLAKE2B 
48b089c9d0ca0f26820ea90ea1a1a6ce3fa325f6f7bd36ded66ba43eeaab610ca99eacb1ca0aec75b0888a65108573e2c85d2ce0e88663031583267f1143386e
 SHA512 
040a51d2783616cca9f3d7e70bf83adf0d6afa8d7378a9f743cbf152811c07c4f03eecdbbdb617d9fda625049a6f13313dce6e5017698bf36fae74e107c012f0
+DIST gzdoom-4.8.2.tar.gz 24247668 BLAKE2B 
b9a505c29d14486bec96f53f614968c67ec0d8db0b784071d171038dec3a88c800483211e4ba59e8408ce5680f4800cbc455b4a53becd53e89bde17c7b7a69a5
 SHA512 
5f94aca016e87c8284b41d5c3beaeb752a4201e4562a528375addc976c7d7163d23a4885a223e4377856a2b75b71179efa80e99baf3edfe87fa19cf1e8bbfa42

diff --git 
a/games-fps/gzdoom/files/0001-Revert-load-the-hex-font-as-early-as-possible.patch
 
b/games-fps/gzdoom/files/0001-Revert-load-the-hex-font-as-early-as-possible.patch
new file mode 100644
index 000000000000..58a2f7a2b2f4
--- /dev/null
+++ 
b/games-fps/gzdoom/files/0001-Revert-load-the-hex-font-as-early-as-possible.patch
@@ -0,0 +1,129 @@
+From 2d00bc6b9f25ae045eecba6e198eaceee9046647 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <ch...@gentoo.org>
+Date: Wed, 6 Jul 2022 23:37:30 +0100
+Subject: [PATCH] Revert "- load the hex font as early as possible."
+
+This reverts commit 010f41a3aad3719b1e5d4d8ce157a5d9b0077b44.
+
+Bug: https://github.com/coelckers/gzdoom/issues/1615
+---
+ src/common/fonts/hexfont.cpp | 24 +++++++-----------------
+ src/d_main.cpp               | 17 +++++++----------
+ 2 files changed, 14 insertions(+), 27 deletions(-)
+
+diff --git a/src/common/fonts/hexfont.cpp b/src/common/fonts/hexfont.cpp
+index 8b50427f4..e2bdbff7a 100644
+--- a/src/common/fonts/hexfont.cpp
++++ b/src/common/fonts/hexfont.cpp
+@@ -58,12 +58,11 @@ struct HexDataSource
+       //
+       
//==========================================================================
+ 
+-      void ParseDefinition(FResourceLump* font)
++      void ParseDefinition(int lumpnum)
+       {
+               FScanner sc;
+ 
+-              auto data = font->Lock();
+-              sc.OpenMem("newconsolefont.hex", (const char*)data, 
font->Size());
++              sc.OpenLumpNum(lumpnum);
+               sc.SetCMode(true);
+               glyphdata.Push(0);      // ensure that index 0 can be used as 
'not present'.
+               while (sc.GetString())
+@@ -97,7 +96,6 @@ struct HexDataSource
+                       lumb = i * 255 / 17;
+                       SmallPal[i] = PalEntry(255, lumb, lumb, lumb);
+               }
+-              font->Unlock();
+       }
+ };
+ 
+@@ -402,7 +400,7 @@ public:
+ 
+ FFont *CreateHexLumpFont (const char *fontname, int lump)
+ {
+-      assert(hexdata.FirstChar != INT_MAX);
++      if (hexdata.FirstChar == INT_MAX) hexdata.ParseDefinition(lump);
+       return new FHexFont(fontname, lump);
+ }
+ 
+@@ -414,7 +412,7 @@ FFont *CreateHexLumpFont (const char *fontname, int lump)
+ 
+ FFont *CreateHexLumpFont2(const char *fontname, int lump)
+ {
+-      assert(hexdata.FirstChar != INT_MAX);
++      if (hexdata.FirstChar == INT_MAX) hexdata.ParseDefinition(lump);
+       return new FHexFont2(fontname, lump);
+ }
+ 
+@@ -426,7 +424,8 @@ FFont *CreateHexLumpFont2(const char *fontname, int lump)
+ 
+ uint8_t* GetHexChar(int codepoint)
+ {
+-      assert(hexdata.FirstChar != INT_MAX);
++      auto lump = fileSystem.CheckNumForFullName("newconsolefont.hex", 0);    
// This is always loaded from gzdoom.pk3 to prevent overriding it with 
incomplete replacements.
++      if (hexdata.FirstChar == INT_MAX) hexdata.ParseDefinition(lump);
+ 
+       if (hexdata.glyphmap[codepoint] > 0)
+       {
+@@ -434,13 +433,4 @@ uint8_t* GetHexChar(int codepoint)
+               return &hexdata.glyphdata[offset];
+       }
+       return nullptr;
+-}
+-
+-void LoadHexFont(const char* filename)
+-{
+-      auto resf = FResourceFile::OpenResourceFile(filename);
+-      if (resf == nullptr) I_FatalError("Unable to open %s", filename);
+-      auto hexfont = resf->FindLump("newconsolefont.hex");
+-      if (hexfont == nullptr) I_FatalError("Unable to find newconsolefont.hex 
in %s", filename);
+-      hexdata.ParseDefinition(hexfont);
+-}
++}
+\ No newline at end of file
+diff --git a/src/d_main.cpp b/src/d_main.cpp
+index b64142c07..d61807012 100644
+--- a/src/d_main.cpp
++++ b/src/d_main.cpp
+@@ -175,7 +175,6 @@ void FreeSBarInfoScript();
+ void I_UpdateWindowTitle();
+ void S_ParseMusInfo();
+ void D_GrabCVarDefaults();
+-void LoadHexFont(const char* filename);
+ 
+ // PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
+ 
+@@ -3535,15 +3534,6 @@ static int D_DoomMain_Internal (void)
+       std::set_new_handler(NewFailure);
+       const char *batchout = Args->CheckValue("-errorlog");
+       
+-      // [RH] Make sure zdoom.pk3 is always loaded,
+-      // as it contains magic stuff we need.
+-      wad = BaseFileSearch(BASEWAD, NULL, true, GameConfig);
+-      if (wad == NULL)
+-      {
+-              I_FatalError("Cannot find " BASEWAD);
+-      }
+-      LoadHexFont(wad);       // load hex font early so we have it during 
startup.
+-
+       C_InitConsole(80*8, 25*8, false);
+       I_DetectOS();
+ 
+@@ -3573,6 +3563,13 @@ static int D_DoomMain_Internal (void)
+       extern void D_ConfirmSendStats();
+       D_ConfirmSendStats();
+ 
++      // [RH] Make sure zdoom.pk3 is always loaded,
++      // as it contains magic stuff we need.
++      wad = BaseFileSearch (BASEWAD, NULL, true, GameConfig);
++      if (wad == NULL)
++      {
++              I_FatalError ("Cannot find " BASEWAD);
++      }
+       FString basewad = wad;
+ 
+       FString optionalwad = BaseFileSearch(OPTIONALWAD, NULL, true, 
GameConfig);
+-- 
+2.35.1
+

diff --git a/games-fps/gzdoom/gzdoom-4.8.2.ebuild 
b/games-fps/gzdoom/gzdoom-4.8.2.ebuild
new file mode 100644
index 000000000000..f697ad1bc5eb
--- /dev/null
+++ b/games-fps/gzdoom/gzdoom-4.8.2.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake desktop xdg flag-o-matic
+
+DESCRIPTION="A modder-friendly OpenGL source port based on the DOOM engine"
+HOMEPAGE="https://zdoom.org";
+SRC_URI="https://github.com/coelckers/${PN}/archive/g${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="Apache-2.0 BSD BZIP2 GPL-3 LGPL-2.1+ LGPL-3 MIT
+       non-free? ( Activision ChexQuest3 DOOM-COLLECTORS-EDITION freedist 
WidePix )"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="debug gles2 gtk +non-free openmp telemetry vulkan"
+
+DEPEND="
+       app-arch/bzip2
+       media-libs/libjpeg-turbo:0=
+       media-libs/libsdl2[gles2?,opengl,vulkan?]
+       media-libs/libvpx:=
+       media-libs/openal
+       media-libs/zmusic
+       sys-libs/zlib
+       gtk? ( x11-libs/gtk+:3 )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${PN}-g${PV}"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-4.7.1-Introduce-the-BUILD_NONFREE-option.patch
+       "${FILESDIR}"/0001-Revert-load-the-hex-font-as-early-as-possible.patch
+)
+
+src_prepare() {
+       rm -rf docs/licenses || die
+       rm -rf libraries/{bzip2,jpeg,zlib} || die
+       if ! use non-free ; then
+               rm -rf wadsrc_bm wadsrc_extra wadsrc_widepix || die
+       fi
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_SHARED_LIBS=OFF
+               -DINSTALL_DOCS_PATH="${EPREFIX}/usr/share/doc/${PF}"
+               -DINSTALL_PK3_PATH="${EPREFIX}/usr/share/doom"
+               -DINSTALL_SOUNDFONT_PATH="${EPREFIX}/usr/share/doom"
+               -DDYN_OPENAL=OFF
+               -DNO_GTK="$(usex !gtk)"
+               -DNO_OPENAL=OFF
+               -DHAVE_VULKAN="$(usex vulkan)"
+               -DHAVE_GLES2="$(usex gles2)"
+               -DNO_OPENMP="$(usex !openmp)"
+               -DBUILD_NONFREE="$(usex non-free)"
+       )
+
+       use debug || append-cppflags -DNDEBUG
+       use telemetry || append-cppflags -DNO_SEND_STATS
+
+       cmake_src_configure
+}
+
+src_install() {
+       newicon src/posix/zdoom.xpm "${PN}.xpm"
+       make_desktop_entry "${PN}" "GZDoom" "${PN}" "Game;ActionGame"
+       cmake_src_install
+}
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       if ! use non-free ; then
+               ewarn
+               ewarn "GZDoom installed without non-free components."
+               ewarn "Note: The non-free game_support.pk3 file is needed to 
play"
+               ewarn "      games natively supported by GZDoom."
+               ewarn "A list of games natively supported by GZDoom is 
available"
+               ewarn "on the ZDoom wiki: https://zdoom.org/wiki/IWAD";
+               ewarn
+       fi
+}

Reply via email to