summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Bar-Lev <alonbl@gentoo.org>2017-03-21 12:00:46 +0200
committerAlon Bar-Lev <alonbl@gentoo.org>2017-03-21 12:01:21 +0200
commit3900cc924001db0c7b6e9618fa8c5792b3d1bb72 (patch)
treeab6ff316b0c147e54a453e5a9c09a730a7e40ec0 /dev-libs/botan
parentdev-libs/libassuan: eapi cleanup (diff)
downloadgentoo-3900cc924001db0c7b6e9618fa8c5792b3d1bb72.tar.gz
gentoo-3900cc924001db0c7b6e9618fa8c5792b3d1bb72.tar.bz2
gentoo-3900cc924001db0c7b6e9618fa8c5792b3d1bb72.zip
dev-libs/botan: fix c++11 build issue
Bug: 597712 Package-Manager: Portage-2.3.3, Repoman-2.3.1
Diffstat (limited to 'dev-libs/botan')
-rw-r--r--dev-libs/botan/botan-1.10.15-r1.ebuild4
-rw-r--r--dev-libs/botan/files/botan-1.10.15-c++11.patch36
2 files changed, 40 insertions, 0 deletions
diff --git a/dev-libs/botan/botan-1.10.15-r1.ebuild b/dev-libs/botan/botan-1.10.15-r1.ebuild
index 00add8ce318..0fe8c0507d5 100644
--- a/dev-libs/botan/botan-1.10.15-r1.ebuild
+++ b/dev-libs/botan/botan-1.10.15-r1.ebuild
@@ -30,6 +30,10 @@ RDEPEND="bzip2? ( >=app-arch/bzip2-1.0.5 )
DEPEND="${RDEPEND}
doc? ( dev-python/sphinx )"
+PATCHES=(
+ "${FILESDIR}/${P}-c++11.patch"
+)
+
src_prepare() {
default
diff --git a/dev-libs/botan/files/botan-1.10.15-c++11.patch b/dev-libs/botan/files/botan-1.10.15-c++11.patch
new file mode 100644
index 00000000000..e47b56600fe
--- /dev/null
+++ b/dev-libs/botan/files/botan-1.10.15-c++11.patch
@@ -0,0 +1,36 @@
+From dc2834f708a6d857b1a7f9587d5a28af271103e5 Mon Sep 17 00:00:00 2001
+From: Peter-Levine <plevine457@gmail.com>
+Date: Mon, 20 Mar 2017 22:13:21 -0400
+Subject: [PATCH] Allow destructor to throw when building with >=C++11
+
+After C++11, destructors default to `noexcept(true)`. Thus, any throw statements in destructors become calls to `std::terminate()`. To enable the intended throw statement, the destructor must be explicitly marked `noexcept(false)`.
+---
+ src/alloc/alloc_mmap/mmap_mem.cpp | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/src/alloc/alloc_mmap/mmap_mem.cpp b/src/alloc/alloc_mmap/mmap_mem.cpp
+index 17c189e..2637533 100644
+--- a/src/alloc/alloc_mmap/mmap_mem.cpp
++++ b/src/alloc/alloc_mmap/mmap_mem.cpp
+@@ -21,6 +21,12 @@
+ #define MAP_FAILED -1
+ #endif
+
++#if __cplusplus >= 201103L
++#define NOEXCEPT noexcept(false)
++#else
++#define NOEXCEPT
++#endif
++
+ namespace Botan {
+
+ namespace {
+@@ -66,7 +72,7 @@ void* MemoryMapping_Allocator::alloc_block(size_t n)
+ throw MemoryMapping_Failed("Could not unlink temporary file");
+ }
+
+- ~TemporaryFile()
++ ~TemporaryFile() NOEXCEPT
+ {
+ /*
+ * We can safely close here, because post-mmap the file