From 47bf5f3c9bac743e1a4b6c0916dd1e59336c7b079c01694603a0e3c0430907fa Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 11 Jun 2020 08:16:01 +0000 Subject: [PATCH] OBS-URL: https://build.opensuse.org/package/show/games/gzdoom?expand=0&rev=45 --- gzdoom-vulkan.patch | 52 ++++++++++++++++----------------------------- gzdoom.spec | 20 +++++++++++------ 2 files changed, 32 insertions(+), 40 deletions(-) diff --git a/gzdoom-vulkan.patch b/gzdoom-vulkan.patch index d3f5071..bdc8a3a 100644 --- a/gzdoom-vulkan.patch +++ b/gzdoom-vulkan.patch @@ -4,26 +4,38 @@ Date: 2019-04-13 15:02:22.799297208 +0200 Use Vulkan system libraries instead of bundled code. --- - CMakeLists.txt | 3 --- - src/CMakeLists.txt | 2 +- - src/common/rendering/vulkan/shaders/vk_shader.cpp | 2 +- - src/common/rendering/vulkan/system/vk_builders.cpp | 4 ++-- - 4 files changed, 4 insertions(+), 7 deletions(-) + CMakeLists.txt | 4 +--- + libraries/glslang/spirv/CMakeLists.txt | 1 + + src/CMakeLists.txt | 2 +- + 3 files changed, 3 insertions(+), 4 deletions(-) Index: gzdoom-g4.4.0/CMakeLists.txt =================================================================== --- gzdoom-g4.4.0.orig/CMakeLists.txt +++ gzdoom-g4.4.0/CMakeLists.txt -@@ -307,9 +307,6 @@ option(FORCE_INTERNAL_ASMJIT "Use intern +@@ -307,9 +307,7 @@ option(FORCE_INTERNAL_ASMJIT "Use intern mark_as_advanced( FORCE_INTERNAL_ASMJIT ) if (HAVE_VULKAN) - add_subdirectory( libraries/glslang/glslang) - add_subdirectory( libraries/glslang/spirv ) - add_subdirectory( libraries/glslang/OGLCompilersDLL ) ++ include_directories(/usr/include/glslang/Public /usr/include/SPIRV) endif() if( ZLIB_FOUND AND NOT FORCE_INTERNAL_ZLIB ) +Index: gzdoom-g4.4.0/libraries/glslang/spirv/CMakeLists.txt +=================================================================== +--- gzdoom-g4.4.0.orig/libraries/glslang/spirv/CMakeLists.txt ++++ gzdoom-g4.4.0/libraries/glslang/spirv/CMakeLists.txt +@@ -50,6 +50,7 @@ set(SPVREMAP_HEADERS + doc.h) + + add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) ++set_property(TARGET SPIRV OUTPUT_NAME libSPIRV-zdoom) + set_property(TARGET SPIRV PROPERTY FOLDER glslang) + set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) + target_include_directories(SPIRV PUBLIC Index: gzdoom-g4.4.0/src/CMakeLists.txt =================================================================== --- gzdoom-g4.4.0.orig/src/CMakeLists.txt @@ -37,31 +49,3 @@ Index: gzdoom-g4.4.0/src/CMakeLists.txt endif() include_directories( "${ZLIB_INCLUDE_DIR}" "${BZIP2_INCLUDE_DIR}" "${LZMA_INCLUDE_DIRS}" "${JPEG_INCLUDE_DIR}" "${ZMUSIC_INCLUDE_DIR}" ) -Index: gzdoom-g4.4.0/src/common/rendering/vulkan/shaders/vk_shader.cpp -=================================================================== ---- gzdoom-g4.4.0.orig/src/common/rendering/vulkan/shaders/vk_shader.cpp -+++ gzdoom-g4.4.0/src/common/rendering/vulkan/shaders/vk_shader.cpp -@@ -25,7 +25,7 @@ - #include "hw_shaderpatcher.h" - #include "filesystem.h" - #include "engineerrors.h" --#include -+#include - - VkShaderManager::VkShaderManager(VulkanDevice *device) : device(device) - { -Index: gzdoom-g4.4.0/src/common/rendering/vulkan/system/vk_builders.cpp -=================================================================== ---- gzdoom-g4.4.0.orig/src/common/rendering/vulkan/system/vk_builders.cpp -+++ gzdoom-g4.4.0/src/common/rendering/vulkan/system/vk_builders.cpp -@@ -23,8 +23,8 @@ - #include "vk_builders.h" - #include "engineerrors.h" - #include "renderstyle.h" --#include --#include -+#include -+#include - - static const TBuiltInResource DefaultTBuiltInResource = { - /* .MaxLights = */ 32, diff --git a/gzdoom.spec b/gzdoom.spec index 848ed9b..720905d 100644 --- a/gzdoom.spec +++ b/gzdoom.spec @@ -28,15 +28,13 @@ 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-vulkan.patch -Patch4: gzdoom-asmjit.patch +Patch3: gzdoom-asmjit.patch +Patch4: gzdoom-vulkan.patch BuildRequires: cmake >= 2.8.7 BuildRequires: gcc-c++ -BuildRequires: glslang-devel BuildRequires: libjpeg-devel BuildRequires: nasm BuildRequires: pkg-config -BuildRequires: spirv-tools-devel BuildRequires: unzip BuildRequires: zmusic-devel BuildRequires: pkgconfig(bzip2) @@ -48,6 +46,11 @@ BuildRequires: pkgconfig(openal) BuildRequires: pkgconfig(sdl2) BuildRequires: pkgconfig(vulkan) BuildRequires: pkgconfig(zlib) +%if 0%{?sle_version} >= 150200 +BuildRequires: glslang-devel >= 6.3 +%else +Provides: bundled(glslang) = 8.13.3559 +%endif Recommends: freedoom Recommends: timidity Recommends: timidity-eawpats @@ -71,8 +74,13 @@ GZDoom is a port (a modification) of the original Doom source code, featuring: * Demo record/playback of classic and Boom demos is not supported. %prep -%autosetup -p1 -n %name-g%version -rm -Rfv glslang src/rendering/vulkan/thirdparty/vulkan +%setup -qn %name-g%version +%patch -P 1 -P 2 -P 3 -p1 +%if 1 || 0%{?sle_version} >= 150200 +%patch -P 4 -p1 +rm -Rf glslang +%endif +rm -Rf src/common/rendering/vulkan/thirdparty/vulkan perl -i -pe 's{__DATE__}{""}g' src/posix/sdl/i_main.cpp %build