sci-libs/beagle: Allow for compiling with GCC 6
authorDavid Seifert <soap@gentoo.org>
Thu, 20 Oct 2016 23:36:49 +0000 (01:36 +0200)
committerDavid Seifert <soap@gentoo.org>
Thu, 20 Oct 2016 23:38:48 +0000 (01:38 +0200)
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 [new file with mode: 0644]
sci-libs/beagle/files/beagle-3.0.3-fix-c++14.patch [new file with mode: 0644]
sci-libs/beagle/files/beagle-3.0.3-gcc47.patch

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 (file)
index 0000000..f8122e2
--- /dev/null
@@ -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 (file)
index 0000000..896b582
--- /dev/null
@@ -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;
index cb3546c68a5c3b2feded12f020b32f2e7ff3270a..b74fb32b998962e6f96e46f6e924d4b07c6add02 100644 (file)
@@ -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);