dev-python/jpype: fix building with -Werror=terminate using GCC-6.
authorPeter Levine <plevine457@gmail.com>
Mon, 24 Jul 2017 07:26:40 +0000 (03:26 -0400)
committerPatrice Clement <monsieurp@gentoo.org>
Mon, 24 Jul 2017 14:28:12 +0000 (16:28 +0200)
Gentoo-Bug: https://bugs.gentoo.org/608920
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Closes: https://github.com/gentoo/gentoo/pull/5194

dev-python/jpype/files/jpype-gcc6-noexcept.patch [new file with mode: 0644]
dev-python/jpype/jpype-0.6.1.ebuild
dev-python/jpype/jpype-0.6.2.ebuild

diff --git a/dev-python/jpype/files/jpype-gcc6-noexcept.patch b/dev-python/jpype/files/jpype-gcc6-noexcept.patch
new file mode 100644 (file)
index 0000000..710844d
--- /dev/null
@@ -0,0 +1,57 @@
+Bug: https://bugs.gentoo.org/show_bug.cgi?id=608920\r
+Upstream commit: https://github.com/originell/jpype/commit/3a4fb98938afd9c03070086d1b8fda8841410fa3\r
+\r
+From c3578c3488de35236f73b6eb27428b1f1526c45b Mon Sep 17 00:00:00 2001
+From: Peter-Levine <plevine457@gmail.com>
+Date: Sat, 11 Feb 2017 23:31:27 -0500
+Subject: [PATCH] Mark destructor that throws as noexcept(false) for >=C++11
+
+---
+ native/common/include/jp_field.h | 2 +-
+ native/common/include/jpype.h    | 6 ++++++
+ native/common/jp_field.cpp       | 2 +-
+ 3 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/native/common/include/jp_field.h b/native/common/include/jp_field.h
+index d28b795..f93752c 100644
+--- a/native/common/include/jp_field.h
++++ b/native/common/include/jp_field.h
+@@ -38,7 +38,7 @@ public :
+       /**\r
+        * destructor\r
+        */\r
+-      virtual ~JPField();\r
++      virtual ~JPField() NO_EXCEPT_FALSE;\r
+       \r
+ public :\r
+       bool isStatic() const;\r
+diff --git a/native/common/include/jpype.h b/native/common/include/jpype.h
+index 7db5832..a492d06 100644
+--- a/native/common/include/jpype.h
++++ b/native/common/include/jpype.h
+@@ -64,6 +64,12 @@
+     #define PyUnicode_FromFormat PyString_FromFormat\r
+ #endif\r
\r
++// Define this and use to allow destructors to throw in C++11 or later\r
++#if __cplusplus >= 201103L\r
++#define NO_EXCEPT_FALSE noexcept(false)\r
++#else\r
++#define NO_EXCEPT_FALSE\r
++#endif\r
\r
+ #include <map>\r
+ #include <string>\r
+diff --git a/native/common/jp_field.cpp b/native/common/jp_field.cpp
+index 8c75e58..5ef9d8c 100644
+--- a/native/common/jp_field.cpp
++++ b/native/common/jp_field.cpp
+@@ -63,7 +63,7 @@ JPField::JPField(const JPField& fld)
+       TRACE_OUT;\r
+ }\r
\r
+-JPField::~JPField()\r
++JPField::~JPField() NO_EXCEPT_FALSE\r
+ {\r
+       TRACE_IN("JPField::~JPField");\r
+       JPEnv::getJava()->DeleteGlobalRef(m_Field);\r
index 6ab0fe49543494efdf190017f0f499773356b08e..090ec143ecb2f52b804de3f430f01b7183f906e8 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=5
@@ -22,6 +22,8 @@ DEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
        >=virtual/jdk-1.6"
 
+PATCHES=( "${FILESDIR}"/${PN}-gcc6-noexcept.patch )
+
 python_compile() {
        if ! python_is_python3; then
                local CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
index 3ea7f1fefbc3a1421787b8ba3a8df9be34bc9b33..f8dfefc0dd2282416b3db1e0c075c5cae04663d7 100644 (file)
@@ -22,6 +22,8 @@ DEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
        >=virtual/jdk-1.6"
 
+PATCHES=( "${FILESDIR}"/${PN}-gcc6-noexcept.patch )
+
 python_compile() {
        if ! python_is_python3; then
                local CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"