sci-chemistry/sparky: Allow for compiling with GCC 6
authorDavid Seifert <soap@gentoo.org>
Fri, 7 Oct 2016 21:04:05 +0000 (23:04 +0200)
committerDavid Seifert <soap@gentoo.org>
Fri, 7 Oct 2016 21:04:24 +0000 (23:04 +0200)
Gentoo-bug: 596012
* EAPI=6
* Patch by Peter Levine

Package-Manager: portage-2.3.1

sci-chemistry/sparky/files/3.115-fix-c++14.patch [new file with mode: 0644]
sci-chemistry/sparky/sparky-3.115-r2.ebuild [moved from sci-chemistry/sparky/sparky-3.115-r1.ebuild with 89% similarity]

diff --git a/sci-chemistry/sparky/files/3.115-fix-c++14.patch b/sci-chemistry/sparky/files/3.115-fix-c++14.patch
new file mode 100644 (file)
index 0000000..3a05ea7
--- /dev/null
@@ -0,0 +1,32 @@
+Fix the custom new/new[] operators in order to account for changed
+noexcept semantics in C++11.
+See also: https://bugs.gentoo.org/show_bug.cgi?id=596012
+
+Patch by Peter Levine
+
+--- a/c++/memalloc.cc
++++ b/c++/memalloc.cc
+@@ -39,7 +39,10 @@
+ // ----------------------------------------------------------------------------
+ //
+-void *operator new(size_t size) throw(std::bad_alloc)
++void *operator new(size_t size)
++#if __cplusplus < 201103L
++throw(std::bad_alloc)
++#endif
+ {
+   void *value = allocate(size);
+   if (tracking_memory)
+@@ -72,7 +75,10 @@
+ // ----------------------------------------------------------------------------
+ //
+-void *operator new[](size_t size) throw(std::bad_alloc)
++void *operator new[](size_t size)
++#if __cplusplus < 201103L
++throw(std::bad_alloc)
++#endif
+ {
+   void *value = allocate(size);
+   if (tracking_memory)
similarity index 89%
rename from sci-chemistry/sparky/sparky-3.115-r1.ebuild
rename to sci-chemistry/sparky/sparky-3.115-r2.ebuild
index 1dc0780c5c3c9a29a485f335fe80a8cb91d275aa..b04634eb0c2032d7825606b3849fdcd9d58c6ba7 100644 (file)
@@ -1,13 +1,13 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=5
+EAPI=6
 
 PYTHON_COMPAT=( python2_7 )
 PYTHON_REQ_USE="tk"
 
-inherit eutils flag-o-matic multilib prefix python-single-r1 toolchain-funcs
+inherit flag-o-matic prefix python-single-r1 toolchain-funcs
 
 DESCRIPTION="Graphical NMR assignment and integration program for large polymers"
 HOMEPAGE="http://www.cgl.ucsf.edu/home/sparky/"
@@ -17,7 +17,6 @@ LICENSE="sparky"
 SLOT="0"
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
 IUSE="examples"
-
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
 
 RDEPEND="${PYTHON_DEPS}
@@ -35,7 +34,8 @@ PATCHES=(
        "${FILESDIR}"/${PV}-wrapper-r1.patch
        "${FILESDIR}"/${PV}-paths.patch
        "${FILESDIR}"/${PV}-makefile.patch
-       )
+       "${FILESDIR}"/${PV}-fix-c++14.patch
+)
 
 pkg_setup() {
        python-single-r1_pkg_setup
@@ -44,7 +44,7 @@ pkg_setup() {
 }
 
 src_prepare() {
-       epatch ${PATCHES[@]}
+       default
 
        sed -i \
                -e "s:^\(set PYTHON =\).*:\1 ${PYTHON}:g" \
@@ -92,7 +92,6 @@ src_compile() {
 
 src_install() {
        # The symlinks are needed to avoid hacking the complete code to fix the locations
-
        dobin c++/{{bruk,matrix,peaks,pipe,vnmr}2ucsf,ucsfdata,sparky-no-python} bin/${PN}
 
        insinto /usr/share/${PN}/
@@ -100,22 +99,20 @@ src_install() {
        dosym ../../share/${PN}/print-prolog.ps /usr/$(get_libdir)/${PN}/print-prolog.ps
        dosym ../../share/${PN}/Sparky /usr/$(get_libdir)/${PN}/Sparky
 
-       dohtml -r manual/*
-       dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/${PN}/manual
-
        python_moduleinto ${PN}
        python_domodule python/*.py c++/{spy.so,_tkinter.so}
-
-       python_optimize
-
        dosym ../${EPYTHON}/site-packages /usr/$(get_libdir)/${PN}/python
 
+       rm manual/{pkzip.cfg,Makefile} || die
+       mv {manual/,}manual.ps || die
+       local DOCS=( README manual.ps )
+       local HTML_DOCS=( manual/. )
+       einstalldocs
+       newdoc python/README README.python
+       dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/${PN}/manual
+
        if use examples; then
-               insinto /usr/share/doc/${PF}/
-               doins -r example || die
+               dodoc -r example
                dosym ../../share/doc/${PF}/example /usr/$(get_libdir)/${PN}/example
        fi
-
-       dodoc README
-       newdoc python/README README.python
 }