commit:     8d3a84b70c2c2b3a20a40b30a88c3aa91db58203
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 15 04:43:52 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 04:43:52 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8d3a84b7

sci-libs/coinor-couenne: fix build with GCC 11

Closes: https://bugs.gentoo.org/792798
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../coinor-couenne/coinor-couenne-0.5.8-r1.ebuild  |  4 ++
 ...coinor-couenne-0.5.8-fix-build-with-gcc11.patch | 43 ++++++++++++++++++++++
 2 files changed, 47 insertions(+)

diff --git a/sci-libs/coinor-couenne/coinor-couenne-0.5.8-r1.ebuild 
b/sci-libs/coinor-couenne/coinor-couenne-0.5.8-r1.ebuild
index 63bb046a307..cd577558b1c 100644
--- a/sci-libs/coinor-couenne/coinor-couenne-0.5.8-r1.ebuild
+++ b/sci-libs/coinor-couenne/coinor-couenne-0.5.8-r1.ebuild
@@ -32,6 +32,10 @@ BDEPEND="
                virtual/latex-base
        )"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.5.8-fix-build-with-gcc11.patch
+)
+
 src_prepare() {
        default
        # Prevent unneeded call to pkg-config that needs ${ED}'s in path.

diff --git 
a/sci-libs/coinor-couenne/files/coinor-couenne-0.5.8-fix-build-with-gcc11.patch 
b/sci-libs/coinor-couenne/files/coinor-couenne-0.5.8-fix-build-with-gcc11.patch
new file mode 100644
index 00000000000..339ce1a0e90
--- /dev/null
+++ 
b/sci-libs/coinor-couenne/files/coinor-couenne-0.5.8-fix-build-with-gcc11.patch
@@ -0,0 +1,43 @@
+https://bugs.gentoo.org/792798
+
+From debc5de2d0ac9654c01db080448df064b808c56e Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Tue, 15 Jun 2021 04:24:22 +0000
+Subject: [PATCH] Fix build with GCC 11
+diff --git a/src/problem/CouenneProblem.hpp b/src/problem/CouenneProblem.hpp
+index e5b54a5..db28cfd 100644
+--- a/src/problem/CouenneProblem.hpp
++++ b/src/problem/CouenneProblem.hpp
+@@ -74,7 +74,7 @@ class Nauty;
+ #define COUENNE_EPS_SYMM 1e-8
+ 
+   struct myclass0 {
+-    inline bool operator() (register const Node &a, register const Node &b) {
++    inline bool operator() (register const Node &a, register const Node &b) 
const {
+ 
+       return ((               a.get_code  () <  b.get_code  ())               
      ||
+             ((              a.get_code  () == b.get_code  ()                  
    &&
+@@ -120,7 +120,7 @@ class Nauty;
+     
+       
+   struct myclass {
+-    inline bool operator() (register const  Node &a, register const Node &b) {
++    inline bool operator() (register const  Node &a, register const Node &b) 
const {
+       return (a.get_index() < b.get_index() );
+     }
+   };
+
+--- a/src/cut/sdpcuts/CouenneMatrix.hpp
++++ b/src/cut/sdpcuts/CouenneMatrix.hpp
+@@ -69,7 +69,7 @@ namespace Couenne {
+ 
+     struct compare_scalars {
+       inline bool operator() (register CouenneScalar * const &a, 
+-                            register CouenneScalar * const &b)
++                            register CouenneScalar * const &b) const
+       {return a -> getIndex () < b -> getIndex ();}
+     };
+ 
+-- 
+2.32.0
+

Reply via email to