commit d2f21a230151bc791622f1a83028b560dc2de8a9
Author: Mamoru TASAKA <mtasaka(a)fedoraproject.org>
Date: Thu Apr 14 19:13:14 2022 +0900
Backport upstream fix to compile with -fpermissive for uicommon.h
dfhack-0.47.05-fpermissive-uicommon.patch | 35 +++++++++++++++++++++++++++++++
dfhack.spec | 8 ++++++-
2 files changed, 42 insertions(+), 1 deletion(-)
---
diff --git a/dfhack-0.47.05-fpermissive-uicommon.patch
b/dfhack-0.47.05-fpermissive-uicommon.patch
new file mode 100644
index 0000000..aefc9f6
--- /dev/null
+++ b/dfhack-0.47.05-fpermissive-uicommon.patch
@@ -0,0 +1,35 @@
+From 39c650de131f85ea74d1f7638c3ea630faed5c15 Mon Sep 17 00:00:00 2001
+From: lethosor <lethosor(a)gmail.com>
+Date: Sat, 21 Aug 2021 12:58:17 -0400
+Subject: [PATCH] Fix compilation error on macOS with GCC 11
+
+This should make `-fpermissive` (from #1924) unnecessary, so I also removed
+those instructions.
+---
+ docs/Compile.rst | 14 ++++----------
+ plugins/uicommon.h | 5 +++--
+ 2 files changed, 7 insertions(+), 12 deletions(-)
+
+diff --git a/plugins/uicommon.h b/plugins/uicommon.h
+index 78256ac690..54a948eb28 100644
+--- a/plugins/uicommon.h
++++ b/plugins/uicommon.h
+@@ -31,7 +31,6 @@ using namespace std;
+ using std::string;
+ using std::vector;
+ using std::map;
+-using std::ostringstream;
+ using std::set;
+
+ using namespace DFHack;
+@@ -160,7 +159,9 @@ static inline void OutputToggleString(int &x, int &y, const
char *text, df::inte
+
+ inline string int_to_string(const int n)
+ {
+- return static_cast<ostringstream*>( &(ostringstream() << n)
)->str();
++ std::ostringstream ss;
++ ss << n;
++ return ss.str();
+ }
+
+ static inline void set_to_limit(int &value, const int maximum, const int min = 0)
diff --git a/dfhack.spec b/dfhack.spec
index 610493c..e20377a 100644
--- a/dfhack.spec
+++ b/dfhack.spec
@@ -47,7 +47,7 @@
Name: dfhack
Version: %{dfversion}
-Release: 7.%{hackrelease}%{?dist}
+Release: 8.%{hackrelease}%{?dist}
Summary: Memory hacking library for Dwarf Fortress and a set of tools that use it
# It'd be nice if we could unbundle some of these things, but I suspect it won't
happen.
@@ -92,6 +92,8 @@ Source15:
https://github.com/DFHack/scripts/archive/%{commit15}/dfhack-scr
# Patch to make protobuf build on F33/F32 with gcc 10.
#
https://github.com/DFHack/dfhack/issues/1506
Patch3: protobuf-gcc-10-fix.patch
+#
https://github.com/DFHack/dfhack/commit/39c650de131f85ea74d1f7638c3ea630f...
+Patch4: %{name}-0.47.05-fpermissive-uicommon.patch
# dfhack only supports DF architectures, of which there are two.
ExclusiveArch: %{ix86} x86_64
@@ -227,6 +229,7 @@ cp -a %SOURCE3 library/include/
# You know what, don't apply patches. We don't build isoworld, anyway.
#patch0 -p1
#patch1 -p1
+%patch4 -p1
# Fix protobuf problem; there's probably a way to do this with the patch macro.
patch depends/protobuf/google/protobuf/message.cc %PATCH3
@@ -344,6 +347,9 @@ rm -f docs/build.sh
%license LICENSE.rst
%changelog
+* Thu Apr 14 2022 Mamoru TASAKA <mtasaka(a)fedoraproject.org> - 0.47.04-8.r1
+- Backport upstream fix to compile with -fpermissive for uicommon.h
+
* Thu Feb 10 2022 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
0.47.04-7.r1
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild