1 |
commit: 7ad2c402e2e1a7998ea1724f7675d126b8b5b6bc |
2 |
Author: Peter Levine <plevine457 <AT> gmail <DOT> com> |
3 |
AuthorDate: Tue Mar 21 00:05:31 2017 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Apr 16 18:57:14 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7ad2c402 |
7 |
|
8 |
sci-electronics/klayout: Fix "error: throw will always call terminate()" (bug #612978) |
9 |
|
10 |
Package-Manager: Portage-2.3.5, Repoman-2.3.2 |
11 |
Closes: https://github.com/gentoo/gentoo/pull/4267 |
12 |
|
13 |
...layout-0.24.9-c++11-no-throw-in-destuctor.patch | 34 ++++++++++++++++++++++ |
14 |
sci-electronics/klayout/klayout-0.24.9.ebuild | 4 ++- |
15 |
2 files changed, 37 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/sci-electronics/klayout/files/klayout-0.24.9-c++11-no-throw-in-destuctor.patch b/sci-electronics/klayout/files/klayout-0.24.9-c++11-no-throw-in-destuctor.patch |
18 |
new file mode 100644 |
19 |
index 00000000000..4cb6473d58c |
20 |
--- /dev/null |
21 |
+++ b/sci-electronics/klayout/files/klayout-0.24.9-c++11-no-throw-in-destuctor.patch |
22 |
@@ -0,0 +1,34 @@ |
23 |
+# Fixes "error: throw will always call terminate() [-Werror=terminate]". Gentoo bug 612978. |
24 |
+ |
25 |
+--- a/src/tlAssert.h.old |
26 |
++++ b/src/tlAssert.h |
27 |
+@@ -27,6 +27,16 @@ |
28 |
+ |
29 |
+ #include "config.h" |
30 |
+ |
31 |
++// For >=C++11, mark assertion_failed() with attribute [[noreturn]] and call std::terminate(). |
32 |
++// Or else, throw int(0) to tell the compiler that the assertion will not return. |
33 |
++#if __cplusplus < 201103L |
34 |
++#define ATTRIB_ASSERT KLAYOUT_DLL |
35 |
++#define END_ASSERT throw int(0) |
36 |
++#else |
37 |
++#define ATTRIB_ASSERT [[noreturn]] KLAYOUT_DLL |
38 |
++#define END_ASSERT std::terminate() |
39 |
++#endif |
40 |
++ |
41 |
+ namespace tl |
42 |
+ { |
43 |
+ |
44 |
+@@ -34,10 +44,10 @@ |
45 |
+ * @brief The corresponding assert macro |
46 |
+ */ |
47 |
+ |
48 |
+-KLAYOUT_DLL void assertion_failed (const char *filename, unsigned int line, const char *condition); |
49 |
++ATTRIB_ASSERT void assertion_failed (const char *filename, unsigned int line, const char *condition); |
50 |
+ |
51 |
+ // the throw int(0) instruction will tell the compiler that the assertion will not return |
52 |
+-#define tl_assert(COND) if (!(COND)) { tl::assertion_failed (__FILE__, __LINE__, #COND); throw int(0); } |
53 |
++#define tl_assert(COND) if (!(COND)) { tl::assertion_failed (__FILE__, __LINE__, #COND); END_ASSERT; } |
54 |
+ |
55 |
+ } // namespace tl |
56 |
+ |
57 |
|
58 |
diff --git a/sci-electronics/klayout/klayout-0.24.9.ebuild b/sci-electronics/klayout/klayout-0.24.9.ebuild |
59 |
index ff57ef39774..8c7ca923bbd 100644 |
60 |
--- a/sci-electronics/klayout/klayout-0.24.9.ebuild |
61 |
+++ b/sci-electronics/klayout/klayout-0.24.9.ebuild |
62 |
@@ -1,4 +1,4 @@ |
63 |
-# Copyright 1999-2016 Gentoo Foundation |
64 |
+# Copyright 1999-2017 Gentoo Foundation |
65 |
# Distributed under the terms of the GNU General Public License v2 |
66 |
|
67 |
EAPI=5 |
68 |
@@ -27,6 +27,8 @@ RDEPEND=" |
69 |
DEPEND="${RDEPEND}" |
70 |
|
71 |
all_ruby_prepare() { |
72 |
+ epatch "${FILESDIR}"/${P}-c++11-no-throw-in-destuctor.patch |
73 |
+ |
74 |
# now we generate the stub build configuration file for the home-brew build system |
75 |
cp "${FILESDIR}/${PN}-0.23.10-Makefile.conf.linux-gentoo" "${S}/config/Makefile.conf.linux-gentoo" || die |
76 |
} |