From 81ac66eb1ad8ee2d4bb60ff57d4708685113d458 Mon Sep 17 00:00:00 2001 From: Björn Esser Date: Feb 18 2020 14:02:26 +0000 Subject: Use GitHub url for patches from upstream --- diff --git a/scummvm-1.9.0-dyn-plugins-ldflags.patch b/scummvm-1.9.0-dyn-plugins-ldflags.patch deleted file mode 100644 index 890b086..0000000 --- a/scummvm-1.9.0-dyn-plugins-ldflags.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: scummvm-1.9.0/rules.mk -=================================================================== ---- scummvm-1.9.0.orig/rules.mk -+++ scummvm-1.9.0/rules.mk -@@ -42,7 +42,7 @@ ifdef PLUGIN - PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX) - $(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS) - $(QUIET)$(MKDIR) plugins -- $(QUIET_PLUGIN)$(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@ -+ $(QUIET_PLUGIN)$(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) $(LDFLAGS) -o $@ - - # Reset PLUGIN var - PLUGIN:= diff --git a/scummvm-2.1.1-AUDIO_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch b/scummvm-2.1.1-AUDIO_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch new file mode 100644 index 0000000..2fdf3ca --- /dev/null +++ b/scummvm-2.1.1-AUDIO_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch @@ -0,0 +1,27 @@ +From 8593a9e1e4e8dd1f5dfac9b1304a417df9a742e6 Mon Sep 17 00:00:00 2001 +From: D G Turner +Date: Sun, 15 Dec 2019 22:22:20 +0000 +Subject: [PATCH] AUDIO: Fix Compilation Against Fluidsynth v2.1+ + +This is as reported by eriktorbjorn. +--- + audio/softsynth/fluidsynth.cpp | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp +index 4034b2ffc36..33a74a15247 100644 +--- a/audio/softsynth/fluidsynth.cpp ++++ b/audio/softsynth/fluidsynth.cpp +@@ -35,7 +35,12 @@ + #include "backends/platform/ios7/ios7_common.h" + #endif + ++// Fluidsynth v2.1+ uses printf in one of it's headers, so this is ++// needed to allow compilation, as reported by eriktorbjorn on 20191215 ++// This is in include/fluidsynth/log.h around line 82 ++#define FORBIDDEN_SYMBOL_EXCEPTION_printf + #include ++#undef FORBIDDEN_SYMBOL_EXCEPTION_printf + + class MidiDriver_FluidSynth : public MidiDriver_Emulated { + private: diff --git a/scummvm-2.1.1-AUDIO_Really_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch b/scummvm-2.1.1-AUDIO_Really_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch new file mode 100644 index 0000000..a8bf73a --- /dev/null +++ b/scummvm-2.1.1-AUDIO_Really_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch @@ -0,0 +1,53 @@ +From 68758a879e0c8ecc0d40962516d4e808aa4e15e5 Mon Sep 17 00:00:00 2001 +From: D G Turner +Date: Tue, 17 Dec 2019 04:21:04 +0000 +Subject: [PATCH] AUDIO: Really Fix Compilation Against Fluidsynth v2.1+ + +The previous fix did not work as the forbidden exception had no effect +since scummsys.h and thus forbidden.h had already been included prior +to the fluidsynth header being included. This also meant that undefining +the exception define after the header would have had no effect anyway. + +This new solution was suggest by eriktorbjorn on bug #11278 and should +avoid the need to add an exception which would persist over the entire +source file. +--- + audio/softsynth/fluidsynth.cpp | 15 +++++++-------- + 1 file changed, 7 insertions(+), 8 deletions(-) + +diff --git a/audio/softsynth/fluidsynth.cpp b/audio/softsynth/fluidsynth.cpp +index 33a74a15247..f8c2412492e 100644 +--- a/audio/softsynth/fluidsynth.cpp ++++ b/audio/softsynth/fluidsynth.cpp +@@ -20,10 +20,16 @@ + * + */ + +-#include "common/scummsys.h" ++#include "config.h" + + #ifdef USE_FLUIDSYNTH + ++// Fluidsynth v2.1+ uses printf in one of it's headers, ++// include/fluidsynth/log.h around line 82 so need to include this ++// prior scummsys.h inclusion and thus forbidden.h ++#include ++ ++#include "common/scummsys.h" + #include "common/config-manager.h" + #include "common/error.h" + #include "common/system.h" +@@ -35,13 +41,6 @@ + #include "backends/platform/ios7/ios7_common.h" + #endif + +-// Fluidsynth v2.1+ uses printf in one of it's headers, so this is +-// needed to allow compilation, as reported by eriktorbjorn on 20191215 +-// This is in include/fluidsynth/log.h around line 82 +-#define FORBIDDEN_SYMBOL_EXCEPTION_printf +-#include +-#undef FORBIDDEN_SYMBOL_EXCEPTION_printf +- + class MidiDriver_FluidSynth : public MidiDriver_Emulated { + private: + MidiChannel_MPU401 _midiChannels[16]; diff --git a/scummvm-2.1.1-BUILD_Apply_LDFLAGS_on_modules_plugins.patch b/scummvm-2.1.1-BUILD_Apply_LDFLAGS_on_modules_plugins.patch new file mode 100644 index 0000000..d37300f --- /dev/null +++ b/scummvm-2.1.1-BUILD_Apply_LDFLAGS_on_modules_plugins.patch @@ -0,0 +1,27 @@ +From 0317160ec3d73fe6d2a24b0aebafb8bd11bf64a5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Tue, 18 Feb 2020 14:08:19 +0100 +Subject: [PATCH] BUILD: Apply LDFLAGS on modules/plugins + +Some distributions populate their build environment with special +linker flags, e.g. for hardening purposes such as immediate binding +and/or read-only relocations. + +Those flags should be honored when linking dynamic libraries. +--- + rules.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rules.mk b/rules.mk +index 1138c8b8fde..c522ef99f09 100644 +--- a/rules.mk ++++ b/rules.mk +@@ -47,7 +47,7 @@ ifdef PLUGIN + PLUGIN-$(MODULE) := plugins/$(PLUGIN_PREFIX)$(notdir $(MODULE))$(PLUGIN_SUFFIX) + $(PLUGIN-$(MODULE)): $(MODULE_OBJS-$(MODULE)) $(PLUGIN_EXTRA_DEPS) + $(QUIET)$(MKDIR) plugins +- $(QUIET_PLUGIN)$(CXX) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@ ++ $(QUIET_PLUGIN)$(CXX) $(LDFLAGS) $(filter-out $(PLUGIN_EXTRA_DEPS),$+) $(PLUGIN_LDFLAGS) -o $@ + + # Reset PLUGIN var + PLUGIN:= diff --git a/scummvm-fluidsynth1and2.patch b/scummvm-fluidsynth1and2.patch deleted file mode 100644 index 3bc96f5..0000000 --- a/scummvm-fluidsynth1and2.patch +++ /dev/null @@ -1,30 +0,0 @@ -diff -rupN scummvm-2.1.1.org/audio/softsynth/fluidsynth.cpp scummvm-2.1.1/audio/softsynth/fluidsynth.cpp ---- scummvm-2.1.1.org/audio/softsynth/fluidsynth.cpp 2020-01-17 15:06:39.000000000 -0500 -+++ scummvm-2.1.1/audio/softsynth/fluidsynth.cpp 2020-02-17 13:34:03.756328172 -0500 -@@ -20,10 +20,16 @@ - * - */ - --#include "common/scummsys.h" -+#include "config.h" - - #ifdef USE_FLUIDSYNTH - -+// Fluidsynth v2.1+ uses printf in one of it's headers, -+// include/fluidsynth/log.h around line 82 so need to include this -+// prior scummsys.h inclusion and thus forbidden.h -+#include -+ -+#include "common/scummsys.h" - #include "common/config-manager.h" - #include "common/error.h" - #include "common/system.h" -@@ -35,8 +41,6 @@ - #include "backends/platform/ios7/ios7_common.h" - #endif - --#include -- - class MidiDriver_FluidSynth : public MidiDriver_Emulated { - private: - MidiChannel_MPU401 _midiChannels[16]; diff --git a/scummvm.spec b/scummvm.spec index eb5dc4e..d9fb0ba 100644 --- a/scummvm.spec +++ b/scummvm.spec @@ -8,6 +8,9 @@ } %endif +# Url to upstream GitHub repo. +%global git_url https://github.com/%{name}/%{name} + Name: scummvm Version: 2.1.1 @@ -16,11 +19,11 @@ Summary: Interpreter for several adventure games License: GPLv2+ URL: http://www.scummvm.org/ Source0: http://www.scummvm.org/frs/%{name}/%{version}/%{name}-%{version}.tar.bz2 -# Properly apply LDFLAGS to plugins. -Patch0: scummvm-1.9.0-dyn-plugins-ldflags.patch -# Fluidsynth 1&2 support. From upstream trunk -# https://github.com/scummvm/scummvm/commit/68758a87 -Patch1: scummvm-fluidsynth1and2.patch +# Fluidsynth 1&2 support. From upstream trunk. +Patch0000: %{git_url}/commit/8593a9e1.patch#/%{name}-2.1.1-AUDIO_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch +Patch0001: %{git_url}/commit/68758a87.patch#/%{name}-2.1.1-AUDIO_Really_Fix_Compilation_Against_Fluidsynth_v2_1_and_later.patch +# Properly apply LDFLAGS to plugins. From upstream pull-request. +Patch0002: %{git_url}/pull/2077.patch#/%{name}-2.1.1-BUILD_Apply_LDFLAGS_on_modules_plugins.patch # Needed for AppData check. BuildRequires: libappstream-glib speech-dispatcher-devel alsa-lib-devel BuildRequires: SDL2-devel libvorbis-devel flac-devel zlib-devel @@ -146,6 +149,7 @@ find $RPM_BUILD_ROOT%{_libdir} -type f -name '*.so' | xargs chmod -Rc 0755 %changelog * Tue Feb 18 2020 Björn Esser - 2.1.1-3 - Export build-flags in a more elaborated way +- Use GitHub url for patches from upstream * Mon Feb 17 2020 Orcan Ogetbil - 2.1.1-2 - Rebuild against fluidsynth2