diff --git a/0001-Revert-load-the-hex-font-as-early-as-possible.patch b/0001-Revert-load-the-hex-font-as-early-as-possible.patch deleted file mode 100644 index 94463bb..0000000 --- a/0001-Revert-load-the-hex-font-as-early-as-possible.patch +++ /dev/null @@ -1,128 +0,0 @@ -From e5d7224171927f5a724128ffef7004daae6dd5c8 Mon Sep 17 00:00:00 2001 -From: Jan Engelhardt -Date: Thu, 23 Jun 2022 23:41:18 +0200 -Subject: [PATCH] Revert "- load the hex font as early as possible." -References: https://github.com/coelckers/gzdoom/issues/1615 - -This reverts commit 010f41a3aad3719b1e5d4d8ce157a5d9b0077b44. ---- - 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 e658d74a3..9b5f9cabe 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 --------------------------------------------- - -@@ -3533,15 +3532,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(); - -@@ -3571,6 +3561,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.36.1 - diff --git a/0001-fix-gzdoom.pk3-not-found-error.patch b/0001-fix-gzdoom.pk3-not-found-error.patch new file mode 100644 index 0000000..69a6550 --- /dev/null +++ b/0001-fix-gzdoom.pk3-not-found-error.patch @@ -0,0 +1,36 @@ +From 0f0b4b7620557410e4969cec6119a7771b8acf35 Mon Sep 17 00:00:00 2001 +From: Omar Polo +Date: Mon, 11 Jul 2022 11:52:43 +0200 +Subject: [PATCH] fix gzdoom.pk3 not found error + +Move the initialization before BaseFileSearch is called, otherwise +GameConfig is used not initialized and it doesn't find the gzdoom.pk3 +file. + +GameConfig used uninitalized was spotted by @LoneFox78. +--- + src/d_main.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +Index: gzdoom-g4.8.2/src/d_main.cpp +=================================================================== +--- gzdoom-g4.8.2.orig/src/d_main.cpp ++++ gzdoom-g4.8.2/src/d_main.cpp +@@ -3534,6 +3534,8 @@ static int D_DoomMain_Internal (void) + + std::set_new_handler(NewFailure); + const char *batchout = Args->CheckValue("-errorlog"); ++ ++ D_DoomInit(); + + // [RH] Make sure zdoom.pk3 is always loaded, + // as it contains magic stuff we need. +@@ -3568,8 +3570,6 @@ static int D_DoomMain_Internal (void) + + if (!batchrun) Printf(PRINT_LOG, "%s version %s\n", GAMENAME, GetVersionString()); + +- D_DoomInit(); +- + extern void D_ConfirmSendStats(); + D_ConfirmSendStats(); + diff --git a/gzdoom-asmjit.patch b/gzdoom-asmjit.patch deleted file mode 100644 index 8d0dd4a..0000000 --- a/gzdoom-asmjit.patch +++ /dev/null @@ -1,16 +0,0 @@ ---- - libraries/asmjit/CMakeLists.txt | 1 + - 1 file changed, 1 insertion(+) - -Index: gzdoom-g4.2.4/libraries/asmjit/CMakeLists.txt -=================================================================== ---- gzdoom-g4.2.4.orig/libraries/asmjit/CMakeLists.txt -+++ gzdoom-g4.2.4/libraries/asmjit/CMakeLists.txt -@@ -100,6 +100,7 @@ set(ASMJIT_SRCS - add_library(${ASMJITNAME} STATIC ${ASMJIT_SRCS} ${ASMJIT_PUBLIC_HDRS}) - - set_target_properties(${ASMJITNAME} PROPERTIES OUTPUT_NAME asmjit) -+target_link_libraries(${ASMJITNAME} rt) - - if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL ) - install(TARGETS ${ASMJITNAME} diff --git a/gzdoom.changes b/gzdoom.changes index 1a12395..648f5cd 100644 --- a/gzdoom.changes +++ b/gzdoom.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Sun Jul 24 07:43:09 UTC 2022 - Jan Engelhardt + +- Replace 0001-Revert-load-the-hex-font-as-early-as-possible.patch + by better fix, 0001-fix-gzdoom.pk3-not-found-error.patch . +- Drop gzdoom-asmjit.patch (no longer needed; the linkage error + it used to fix seems just gone) + ------------------------------------------------------------------- Sun Jul 10 08:32:53 UTC 2022 - Jan Engelhardt diff --git a/gzdoom.spec b/gzdoom.spec index d5a57bd..dbf541f 100644 --- a/gzdoom.spec +++ b/gzdoom.spec @@ -28,16 +28,14 @@ URL: https://zdoom.org/ Source: https://github.com/coelckers/gzdoom/archive/g%version.tar.gz Patch1: gzdoom-waddir.patch Patch2: gzdoom-lzma.patch -Patch3: gzdoom-asmjit.patch Patch4: gzdoom-sdlbug.patch Patch5: gzdoom-vulkan.patch Patch6: gzdoom-discord.patch -Patch8: 0001-Revert-load-the-hex-font-as-early-as-possible.patch +Patch8: 0001-fix-gzdoom.pk3-not-found-error.patch Patch9: 0001-Revert-use-static_assert-to-make-32-bit-builds-fail.patch BuildRequires: cmake >= 2.8.7 BuildRequires: discord-rpc-devel BuildRequires: gcc-c++ -BuildRequires: glslang-devel BuildRequires: libjpeg-devel BuildRequires: pkg-config BuildRequires: unzip @@ -50,12 +48,17 @@ BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(sdl2) >= 2.0.6 BuildRequires: pkgconfig(vpx) -BuildRequires: pkgconfig(vulkan) >= 1.2.162 BuildRequires: pkgconfig(zlib) +%if 0%{?suse_version} >= 1550 +BuildRequires: glslang-devel +BuildRequires: pkgconfig(vulkan) >= 1.2.162 +%else +Provides: bundled(glslang) = 11.10.0 +Provides: bundled(vulkan) = 1.2.189.1 +%endif Suggests: freedoom Provides: qzdoom = 1.3.0 Provides: zdoom = 2.8.1 -# DUMB is modified to read OggVorbis samples Provides: bundled(gdtoa) Provides: bundled(re2c) = 0.16.0 Provides: bundled(xbrz) = 1.7 @@ -78,10 +81,11 @@ The executables hard-require SSE2 on i686 currently. %autosetup -n %name-g%version -p1 perl -i -pe 's{__DATE__}{"does not matter when"}g' src/common/platform/posix/sdl/i_main.cpp perl -i -pe 's{}{%version}g' tools/updaterevision/UpdateRevision.cmake -rm -Rf glslang src/common/rendering/vulkan/thirdparty/vulkan mkdir -p extra_include/glslang -%if 0%{?suse_version} && 0%{?suse_version} < 1550 -touch extra_include/glslang/build_info.h +%if 0%{?suse_version} >= 1550 +rm -Rf glslang src/common/rendering/vulkan/thirdparty/vulkan +%else +%patch -P 5 -R -p1 %endif %build