diff --git a/scummvm-2.1.1-CONFIGURE_Add_compatibility_for_RPM_configure_macro.patch b/scummvm-2.1.1-CONFIGURE_Add_compatibility_for_RPM_configure_macro.patch new file mode 100644 index 0000000..fa96dca --- /dev/null +++ b/scummvm-2.1.1-CONFIGURE_Add_compatibility_for_RPM_configure_macro.patch @@ -0,0 +1,95 @@ +From 275d6402bc5fc8584a89d8cdd01972ef30963846 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Fri, 21 Feb 2020 23:16:45 +0100 +Subject: [PATCH 1/2] CONFIGURE: Ignore options valid for Autotools configure + +RPM-based distributions come with a configure macro, that sets up the +whole build environment. In order to be able to use this macro, some +options, which are valid for the configure script generated by GNU +Autotools, should not error-out when preparing the build stage. +--- + configure | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/configure b/configure +index 9f3c4b07bfc..89cf2ab5988 100755 +--- a/configure ++++ b/configure +@@ -1192,6 +1192,19 @@ EOF + + for ac_option in $@; do + case "$ac_option" in ++ # Silently ignore options valid for Autotools configure. ++ --build=*) ;; ++ --program-prefix=*) ;; ++ --sbindir=*) ;; ++ --sysconfdir=*) ;; ++ --includedir=*) ;; ++ --libexecdir=*) ;; ++ --localstatedir=*) ;; ++ --sharedstatedir=*) ;; ++ --infodir=*) ;; ++ --disable-dependency-tracking) ;; ++ --enable-dependency-tracking) ;; ++ # End of ignored options. + --enable-static) _static_build=yes ;; + --disable-16bit) _16bit=no ;; + --enable-highres) _highres=yes ;; + +From 51828b578d965c19c19fcbe0b1a5444c1502ee03 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= +Date: Fri, 21 Feb 2020 23:34:22 +0100 +Subject: [PATCH 2/2] CONFIGURE: Add an environemt variable that discards the + --host option + +In the previous commit we modified the configure script to silently +ignore some options, that are not needed for ScummVM, but are valid +for the configure script generated by GNU Autotools, so the configure +macro for RPM-based distributions can be used when building a rpm +package for them. + +Unfortunately the configure script, as used by ScummVM uses the --host +option to determine the target system it will actually be build for. +Autotools based configure scripts have a --target option for such a +purpose, and use the --host option to determine the system the build +is performed on. + +For that reason there should be a way to discard the parameters passed +to the configure script with the --host option. The easiest approach +to achieve this goal, is to have an environment variable, which when +set influences the configure script to ignore the parameters of the +--host option. + +Thus we introduced a variable called 'CONFIGURE_NO_HOST', that will +when set to anything, but an empty value, before invoking the configure +script, have the parameters of the --host option take no influence on +the configure stage (and the build stage as well). +--- + configure | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/configure b/configure +index 89cf2ab5988..d3bd5eda478 100755 +--- a/configure ++++ b/configure +@@ -1155,6 +1155,7 @@ Some influential environment variables: + AR archiver command + AS assembler command + ASFLAGS assembler flags ++ CONFIGURE_NO_HOST Ignore the cross-compile target set by the --host= option + CPPFLAGS C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command +@@ -1474,7 +1475,11 @@ for ac_option in $@; do + _xcodetoolspath=`echo $ac_option | cut -d '=' -f 2` + ;; + --host=*) +- _host=`echo $ac_option | cut -d '=' -f 2` ++ if test -z "$CONFIGURE_NO_HOST"; then ++ _host=`echo $ac_option | cut -d '=' -f 2` ++ else ++ echo "Ignoring --host option!" >&2 ++ fi + ;; + --prefix=*) + prefix=`echo $ac_option | cut -d '=' -f 2` diff --git a/scummvm.spec b/scummvm.spec index d9fb0ba..b80d228 100644 --- a/scummvm.spec +++ b/scummvm.spec @@ -14,7 +14,7 @@ Name: scummvm Version: 2.1.1 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Interpreter for several adventure games License: GPLv2+ URL: http://www.scummvm.org/ @@ -24,6 +24,8 @@ Patch0000: %{git_url}/commit/8593a9e1.patch#/%{name}-2.1.1-AUDIO_Fix_Compilation 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 +# Add compatibility for RPM's configure macro. +Patch0003: %{git_url}/pull/2079.patch#/%{name}-2.1.1-CONFIGURE_Add_compatibility_for_RPM_configure_macro.patch # Needed for AppData check. BuildRequires: libappstream-glib speech-dispatcher-devel alsa-lib-devel BuildRequires: SDL2-devel libvorbis-devel flac-devel zlib-devel @@ -69,23 +71,13 @@ This package contains the data files for %{name}. %build -# Properly export build-flags. -%if 0%{?set_build_flags:1} - %{set_build_flags} -%else - CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; - CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; - FFLAGS="${FFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FFLAGS ; - FCFLAGS="${FCFLAGS:-%optflags%{?_fmoddir: -I%_fmoddir}}" ; export FCFLAGS ; - %{?__global_ldflags:LDFLAGS="${LDFLAGS:-%__global_ldflags}" ; export LDFLAGS ;} -%endif +# The configure script shall ignore the parameter for the --host option +#passed by %%configure. +export CONFIGURE_NO_HOST=true -# No rpm configure because scummvm's configure isn't a real configure and thus -# doesn't understand some of the options %%configure passes. This includes -# -libdir, so rpmlint's complaints should be ignored. # The disables are so that these don't accidently get build in when rebuilding -# on a system with the necesarry deps installed -./configure \ +# on a system with the necesarry deps installed. +%configure \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --datadir=%{_datadir}/%{name} \ @@ -147,6 +139,9 @@ find $RPM_BUILD_ROOT%{_libdir} -type f -name '*.so' | xargs chmod -Rc 0755 %changelog +* Fri Feb 21 2020 Björn Esser - 2.1.1-4 +- Add patch from upstreamed PR to add compatibility for RPM's configure macro + * 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