commit:     8a76450ae9023973d0a004fc0c59fb9755b2b121
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Fri Dec 12 14:36:06 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Dec 15 16:23:17 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8a76450a

sci-mathematics/mathmod: fix gcc-16/gnu++20

lerp is declared globally with c++20 which is by default with gcc-16 and
allowed by qt-6.10

Closes: https://bugs.gentoo.org/967323
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/44999
Closes: https://github.com/gentoo/gentoo/pull/44999
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../mathmod/files/mathmod-13.0-fix_cxx20.patch     | 42 ++++++++++++++++++++++
 .../files/mathmod-13.0-missing_include.patch       |  2 +-
 sci-mathematics/mathmod/mathmod-13.0-r1.ebuild     |  3 +-
 3 files changed, 45 insertions(+), 2 deletions(-)

diff --git a/sci-mathematics/mathmod/files/mathmod-13.0-fix_cxx20.patch 
b/sci-mathematics/mathmod/files/mathmod-13.0-fix_cxx20.patch
new file mode 100644
index 000000000000..4610a989f0f9
--- /dev/null
+++ b/sci-mathematics/mathmod/files/mathmod-13.0-fix_cxx20.patch
@@ -0,0 +1,42 @@
+PR merged https://github.com/parisolab/mathmod/pull/293.patch
+lerp is declared globally with c++20 which is by default with gcc-16 and
+allowed by qt-6.10
+--- a/pariso/commun.cpp
++++ b/pariso/commun.cpp
+@@ -20,6 +20,11 @@
+ 
+ #include "commun.h"
+ 
++#if defined(__cpp_lib_interpolate)
++#include <cmath> // for std::lerp (C++20)
++using std::lerp;
++#endif
++
+ float rd[3], featurePoint[4];
+ const static uint OFFSET_BASIS = 2166136261U;
+ const static uint FNV_PRIME = 16777619U;
+@@ -423,10 +428,12 @@ float fade(float f)
+ {
+     return f*f*f*(f*(f*6-15)+10); // t * t * (3.0 - 2.0 * t);
+ }
++#if !defined(__cpp_lib_interpolate)
+ float lerp(float t, float a, float b)
+ {
+     return a + t*(b - a);
+ }
++#endif
+ float grad(int hash, float x, float y, float z)
+ {
+     int h = hash & 15;       // CONVERT LO 4 BITS OF HASH CODE
+--- a/pariso/commun.h
++++ b/pariso/commun.h
+@@ -36,7 +36,9 @@ double Laguerre_a(const double*);
+ void ImprovedNoise(float xsize=4.0, float ysize=4.0, float zsize=4.0);
+ float noise(float, float, float);
+ float fade(float);
++#if !defined(__cpp_lib_interpolate)
+ float lerp(float, float, float);
++#endif
+ float grad(int, float, float, float);
+ float FractalNoise3D(float, float, float, int, float, float);
+ float Marble(float, float, float, int);

diff --git a/sci-mathematics/mathmod/files/mathmod-13.0-missing_include.patch 
b/sci-mathematics/mathmod/files/mathmod-13.0-missing_include.patch
index 3771213f1f7e..ae34309879ce 100644
--- a/sci-mathematics/mathmod/files/mathmod-13.0-missing_include.patch
+++ b/sci-mathematics/mathmod/files/mathmod-13.0-missing_include.patch
@@ -1,4 +1,4 @@
-PR pending https://github.com/parisolab/mathmod/pull/288.patch
+PR merged https://github.com/parisolab/mathmod/pull/288.patch
 fix compile w/ qt-6.10.0
 move <QElapsedTimer> in header
 --- a/pariso/isosurface/Iso3D.cpp

diff --git a/sci-mathematics/mathmod/mathmod-13.0-r1.ebuild 
b/sci-mathematics/mathmod/mathmod-13.0-r1.ebuild
index 17d25c5a372c..b7ab90667be8 100644
--- a/sci-mathematics/mathmod/mathmod-13.0-r1.ebuild
+++ b/sci-mathematics/mathmod/mathmod-13.0-r1.ebuild
@@ -22,8 +22,9 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 
 PATCHES=(
-       # https://github.com/parisolab/mathmod/pull/288.patch
+       # both merged
        "${FILESDIR}"/${PN}-13.0-missing_include.patch
+       "${FILESDIR}"/${PN}-13.0-fix_cxx20.patch
 )
 
 src_configure() {

Reply via email to