commit:     b066efd6375e70a8f412041473f32dc954e484b8
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Thu Oct 20 23:36:49 2016 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Thu Oct 20 23:38:48 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b066efd6

sci-libs/beagle: Allow for compiling with GCC 6

Gentoo-bug: 597342
* EAPI=6
* Fix patches to be -p1 compliant

Package-Manager: portage-2.3.2

 sci-libs/beagle/beagle-3.0.3-r1.ebuild             | 58 ++++++++++++++++++++++
 sci-libs/beagle/files/beagle-3.0.3-fix-c++14.patch | 30 +++++++++++
 sci-libs/beagle/files/beagle-3.0.3-gcc47.patch     |  4 +-
 3 files changed, 90 insertions(+), 2 deletions(-)

diff --git a/sci-libs/beagle/beagle-3.0.3-r1.ebuild 
b/sci-libs/beagle/beagle-3.0.3-r1.ebuild
new file mode 100644
index 00000000..f8122e2
--- /dev/null
+++ b/sci-libs/beagle/beagle-3.0.3-r1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+DESCRIPTION="Open BEAGLE, a versatile EC/GA/GP framework"
+SRC_URI="mirror://sourceforge/beagle/${P}.tar.gz"
+HOMEPAGE="http://beagle.gel.ulaval.ca/";
+
+SLOT="0"
+LICENSE="LGPL-2.1"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples static-libs"
+
+RDEPEND="
+       sys-libs/zlib
+       !app-misc/beagle
+       !dev-libs/libbeagle"
+DEPEND="${RDEPEND}
+       doc? ( app-doc/doxygen )"
+
+PATCHES=(
+       "${FILESDIR}/${PN}-3.0.3-gcc43.patch"
+       "${FILESDIR}/${PN}-3.0.3-gcc47.patch"
+       "${FILESDIR}/${PN}-3.0.3-fix-c++14.patch"
+)
+
+src_prepare() {
+       default
+       sed -e "s:@LIBS@:@LIBS@ -lpthread:" \
+               -i PACC/Threading/Makefile.in || die
+}
+
+src_configure() {
+       econf \
+               --enable-optimization \
+               $(use_enable static-libs static)
+}
+
+src_compile() {
+       default
+       use doc && emake doc
+}
+
+src_install () {
+       use doc && local HTML_DOCS=( refman/. )
+       if use examples; then
+               dodoc -r examples
+               docompress -x /usr/share/doc/${PF}/examples
+       fi
+
+       default
+
+       if ! use static-libs; then
+               find "${D}" -name '*.la' -delete || die
+       fi
+}

diff --git a/sci-libs/beagle/files/beagle-3.0.3-fix-c++14.patch 
b/sci-libs/beagle/files/beagle-3.0.3-fix-c++14.patch
new file mode 100644
index 00000000..896b582
--- /dev/null
+++ b/sci-libs/beagle/files/beagle-3.0.3-fix-c++14.patch
@@ -0,0 +1,30 @@
+Fix building with C++14, where destructors are noexcept(true) by default.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=597342
+
+--- a/PACC/Threading/Thread.cpp
++++ b/PACC/Threading/Thread.cpp
+@@ -79,6 +79,9 @@
+ \attention If the destructor in the derived thread class (e.g. MyThread 
above) does not wait for thread termination, the potential hazardous situation 
is that the runtime system will have deleted all of its members before calling 
this destructor (in C++, class destructors are called in reversed sequence). 
Thus, the still running thread could access deleted data members with 
unpredictable and unexpected results. So beware!
+ */
+ Threading::Thread::~Thread(void)
++#if __cplusplus >= 201103L
++      noexcept(false)
++#endif
+ {
+       lock();
+       if(mThread) {
+--- a/PACC/Threading/Thread.hpp
++++ b/PACC/Threading/Thread.hpp
+@@ -53,7 +53,11 @@
+               class Thread : public Condition {
+                public:
+                       Thread(void);
+-                      virtual ~Thread(void);
++                      virtual ~Thread(void)
++#if __cplusplus >= 201103L
++                      noexcept(false)
++#endif
++                      ;
+                       
+                       void cancel(void);
+                       bool isRunning(void) const;

diff --git a/sci-libs/beagle/files/beagle-3.0.3-gcc47.patch 
b/sci-libs/beagle/files/beagle-3.0.3-gcc47.patch
index cb3546c..b74fb32 100644
--- a/sci-libs/beagle/files/beagle-3.0.3-gcc47.patch
+++ b/sci-libs/beagle/files/beagle-3.0.3-gcc47.patch
@@ -1,5 +1,5 @@
---- beagle/include/beagle/RouletteT.hpp
-+++ beagle/include/beagle/RouletteT.hpp
+--- a/beagle/include/beagle/RouletteT.hpp
++++ b/beagle/include/beagle/RouletteT.hpp
 @@ -87,7 +87,7 @@
      Beagle_StackTraceBeginM();
      Beagle_AssertM(inWeight>=0.0);

Reply via email to