commit 3b84393dd0fc8dd2292c690448cc62399e1fb870
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Fri Aug 11 00:50:47 2023 +0100
Fix build with new scons
d1x.spec | 10 ++++++----
fix_scons_issue.patch | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+), 4 deletions(-)
---
diff --git a/d1x.spec b/d1x.spec
index a80f34f..5e7c9f3 100644
--- a/d1x.spec
+++ b/d1x.spec
@@ -20,6 +20,7 @@ Patch1: d1x-gcc12.patch
Patch2: d1x-window_icon_bitmap.patch
# Fix compilation on armv7hl, can be dropped when we drop armv7hl support
Patch3: d1x-disable-Werror-useless-cast.patch
+Patch4: fix_scons_issue.patch
URL:
https://www.dxx-rebirth.com/
BuildRequires: gcc gcc-c++ libpng-devel
BuildRequires: SDL2-devel SDL2_mixer-devel SDL2_image-devel
@@ -68,10 +69,11 @@ robots-h.mvl files to the dir.
%prep
%setup -q -n dxx-rebirth-%{commit} -a 3 -a 4
-%patch0 -p1
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
+%patch 0 -p1
+%patch 1 -p1
+%patch 2 -p1
+%patch 3 -p1
+%patch 4 -p1
# Fixup encoding and CTRL+Z at the end of the orderfrm.txt files
iconv -f CP850 -t UTF-8 d1shar/ORDERFRM.TXT | head -n-3 > ORDERFRM.TXT
touch -r d1shar/ORDERFRM.TXT ORDERFRM.TXT
diff --git a/fix_scons_issue.patch b/fix_scons_issue.patch
new file mode 100644
index 0000000..e90fdf8
--- /dev/null
+++ b/fix_scons_issue.patch
@@ -0,0 +1,54 @@
+From 769164a55bd74f2f11d14dd5175fbee01cf77638 Mon Sep 17 00:00:00 2001
+From: Arne de Bruijn <mail(a)arnedebruijn.nl>
+Date: Wed, 22 Mar 2023 10:41:28 +0100
+Subject: [PATCH] Fix SConstruct for scons 4.5.0+
+
+env['CPPDEFINES'] may return a deque object in scons 4.5.0+ (see
+SCons/scons#4321).
+Explicitly convert it to a list where needed.
+
+Tested with scons 4.4.0, 4.5.0, 4.5.1 and 4.5.2.
+---
+ SConstruct | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index d89d101f9..7dfea1e1f 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -4771,7 +4771,7 @@ class DXXProgram(DXXCommon):
+ # Bypass ccache, if any, since this is a preprocess only
+ # call.
+ kwargs['CXXFLAGS'] = (env['CXXFLAGS'] or []) + ['-E']
+- kwargs['CPPDEFINES'] = (env['CPPDEFINES'] or []) + [
++ kwargs['CPPDEFINES'] = list(env['CPPDEFINES'] or []) + [
+ # Define these tokens to themselves so that
+ # `#ifndef` does not try to redefine them.
+ ('DXX_KCONFIG_UI_ENUM', 'DXX_KCONFIG_UI_ENUM'),
+@@ -4791,7 +4791,7 @@
+ def _apply_target_name(self,name):
+ return os.path.join(os.path.dirname(name), '.%s.%s' % (self.target,
os.path.splitext(os.path.basename(name))[0]))
+ def _apply_env_version_seq(self,env,_empty={}):
+- return _empty if self.user_settings.pch else {'CPPDEFINES' :
env['CPPDEFINES'] + [('DXX_VERSION_SEQ', self.DXX_VERSION_SEQ)]}
++ return _empty if self.user_settings.pch else {'CPPDEFINES' :
list(env['CPPDEFINES']) + [('DXX_VERSION_SEQ', self.DXX_VERSION_SEQ)]}
+ get_objects_similar_arch_ogl =
DXXCommon.create_lazy_object_states_getter((LazyObjectState(sources=(
+ 'similar/arch/ogl/gr.cpp',
+ 'similar/arch/ogl/ogl.cpp',
+@@ -4887,7 +4887,7 @@ class DXXProgram(DXXCommon):
+ ), LazyObjectState(sources=(
+ 'similar/main/inferno.cpp',
+ ),
+- transform_env = (lambda self, env: {'CPPDEFINES' : env['CPPDEFINES'] +
env.__dxx_CPPDEFINE_SHAREPATH + env.__dxx_CPPDEFINE_git_version}),
++ transform_env = (lambda self, env: {'CPPDEFINES' :
list(env['CPPDEFINES']) + env.__dxx_CPPDEFINE_SHAREPATH +
env.__dxx_CPPDEFINE_git_version}),
+ transform_target=_apply_target_name,
+ ), LazyObjectState(sources=(
+ 'similar/main/kconfig.cpp',
+@@ -4897,7 +4897,7 @@ class DXXProgram(DXXCommon):
+ ), LazyObjectState(sources=(
+ 'similar/misc/physfsx.cpp',
+ ),
+- transform_env = (lambda self, env: {'CPPDEFINES' : env['CPPDEFINES'] +
env.__dxx_CPPDEFINE_SHAREPATH}),
++ transform_env = (lambda self, env: {'CPPDEFINES' :
list(env['CPPDEFINES']) + env.__dxx_CPPDEFINE_SHAREPATH}),
+ transform_target=_apply_target_name,
+ ), LazyObjectState(sources=(
+ 'similar/main/playsave.cpp',