commit:     1ec95586a5708ea3652b1f6893204d0f55281ece
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat May  7 04:00:15 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat May  7 04:00:15 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1ec95586

dev-util/edb-debugger: fix build with GCC 12

Closes: https://bugs.gentoo.org/841839
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-util/edb-debugger/edb-debugger-1.3.0.ebuild    | 24 +++---
 .../files/edb-debugger-1.3.0-gcc12.patch           | 88 ++++++++++++++++++++++
 2 files changed, 99 insertions(+), 13 deletions(-)

diff --git a/dev-util/edb-debugger/edb-debugger-1.3.0.ebuild 
b/dev-util/edb-debugger/edb-debugger-1.3.0.ebuild
index 21c906d48591..e550d9ad3f47 100644
--- a/dev-util/edb-debugger/edb-debugger-1.3.0.ebuild
+++ b/dev-util/edb-debugger/edb-debugger-1.3.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -8,14 +8,14 @@ inherit cmake
 DESCRIPTION="edb is a cross platform x86/x86-64 debugger, inspired by Ollydbg"
 HOMEPAGE="https://github.com/eteran/edb-debugger";
 
SRC_URI="https://github.com/eteran/edb-debugger/releases/download/${PV}/edb-debugger-${PV}.tgz";
+S="${WORKDIR}"/${PN}
 
 LICENSE="GPL-2+"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE="graphviz"
 
-RDEPEND="
-       dev-libs/capstone:=
+RDEPEND="dev-libs/capstone:=
        dev-libs/double-conversion
        dev-qt/qtconcurrent:5
        dev-qt/qtcore:5
@@ -25,19 +25,17 @@ RDEPEND="
        dev-qt/qtwidgets:5
        dev-qt/qtxml:5
        dev-qt/qtxmlpatterns:5
-       graphviz? ( media-gfx/graphviz )
-"
+       graphviz? ( media-gfx/graphviz )"
+DEPEND="dev-libs/boost
+       ${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
 
-DEPEND="
-       dev-libs/boost
-       virtual/pkgconfig
-       ${RDEPEND}
-"
-
-S=${WORKDIR}/${PN}
+PATCHES=(
+       "${FILESDIR}"/${P}-gcc12.patch
+)
 
 src_prepare() {
-       #Make the desktop's entries somewhat better
+       # Make the desktop's entries somewhat better
        sed -i -e 's/GenericName=edb debugger/GenericName=Evan\x27s Debugger/' 
edb.desktop || die
        sed -i -e 's/Comment=edb debugger/Comment=edb is a cross platform 
x86\/x86-64 debugger/' edb.desktop || die
 

diff --git a/dev-util/edb-debugger/files/edb-debugger-1.3.0-gcc12.patch 
b/dev-util/edb-debugger/files/edb-debugger-1.3.0-gcc12.patch
new file mode 100644
index 000000000000..df037193310f
--- /dev/null
+++ b/dev-util/edb-debugger/files/edb-debugger-1.3.0-gcc12.patch
@@ -0,0 +1,88 @@
+https://github.com/eteran/edb-debugger/commit/da04c339559f82257ff54ea62b1d403ee98c1ba0
+https://bugs.gentoo.org/841839
+
+From da04c339559f82257ff54ea62b1d403ee98c1ba0 Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+Date: Sat, 2 Apr 2022 22:36:50 +0000
+Subject: [PATCH] Gcc 12 includes fix (#815)
+
+* RegisterViewModelBase.h: add <memory> for unique_ptr
+
+Without the change gcc-12 fails to build edb-debugger as:
+
+    [ 20%] Building CXX object 
src/CMakeFiles/edb.dir/RegisterViewModelBase.cpp.o
+    In file included from edb-debugger/src/RegisterViewModelBase.cpp:18:
+    edb-debugger/include/RegisterViewModelBase.h:162:14: error:
+      'unique_ptr' in namespace 'std' does not name a template type
+      162 |         std::unique_ptr<CategoriesHolder> rootItem;
+          |              ^~~~~~~~~~
+    edb-debugger/include/RegisterViewModelBase.h:9:1: note:
+      'std::unique_ptr' is defined in header '<memory>';
+        did you forget to '#include <memory>'?
+        8 | #include <deque>
+      +++ |+#include <memory>
+
+* State.h: add <memory> for unique_ptr
+
+Without the change gcc-12 fails to build edb-debugger as:
+
+    [ 21%] Building CXX object src/CMakeFiles/edb.dir/State.cpp.o
+    In file included from edb-debugger/src/State.cpp:19:
+    edb-debugger/include/State.h:93:14:
+      error: 'unique_ptr' in namespace 'std' does not name a template type
+       93 |         std::unique_ptr<IState> impl_;
+          |              ^~~~~~~~~~
+    edb-debugger/include/State.h:24:1:
+      note: 'std::unique_ptr' is defined in header '<memory>';
+        did you forget to '#include <memory>'?
+       23 | #include "Types.h"
+      +++ |+#include <memory>
+       24 |
+
+* IState.h: add <memory> for unique_ptr
+
+Without the change gcc-12 fails to build edb-debugger as:
+
+    [ 69%] Building CXX object 
plugins/DebuggerCore/CMakeFiles/DebuggerCore.dir/unix/linux/arch/x86-generic/PlatformState.cpp.o
+    In file included from 
edb-debugger/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformState.h:22,
+                     from 
edb-debugger/plugins/DebuggerCore/unix/linux/arch/x86-generic/PlatformState.cpp:19:
+    edb-debugger/include/IState.h:33:22:
+      error: 'unique_ptr' in namespace 'std' does not name a template type
+       33 |         virtual std::unique_ptr<IState> clone() const = 0;
+          |                      ^~~~~~~~~~
+    edb-debugger/include/IState.h:23:1:
+      note: 'std::unique_ptr' is defined in header '<memory>';
+        did you forget to '#include <memory>'?
+       22 | #include "Register.h"
+      +++ |+#include <memory>
+       23 | #include "Types.h"
+--- a/include/IState.h
++++ b/include/IState.h
+@@ -19,6 +19,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
+ #ifndef ISTATE_H_20110315_
+ #define ISTATE_H_20110315_
+ 
++#include <memory>
+ #include "Register.h"
+ #include "Types.h"
+ 
+--- a/include/RegisterViewModelBase.h
++++ b/include/RegisterViewModelBase.h
+@@ -6,6 +6,7 @@
+ #include "util/Integer.h"
+ #include <QAbstractItemModel>
+ #include <deque>
++#include <memory>
+ #include <vector>
+ 
+ Q_DECLARE_METATYPE(std::vector<NumberDisplayMode>)
+--- a/include/State.h
++++ b/include/State.h
+@@ -19,6 +19,7 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
+ #ifndef STATE_H_20060715_
+ #define STATE_H_20060715_
+ 
++#include <memory>
+ #include "API.h"
+ #include "Types.h"
+ 

Reply via email to