commit:     d67b9030c502912749bc458fea717f9bd3be16f4
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Tue Jul 30 20:22:02 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Tue Jul 30 20:28:25 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d67b9030

sci-mathematics/primecount: backport gcc-15 build fix

Closes: https://bugs.gentoo.org/936498
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../files/primecount-7.13-gcc-15-buildfix.patch    | 30 ++++++++++++++++++++++
 ...count-7.13.ebuild => primecount-7.13-r1.ebuild} |  2 ++
 2 files changed, 32 insertions(+)

diff --git 
a/sci-mathematics/primecount/files/primecount-7.13-gcc-15-buildfix.patch 
b/sci-mathematics/primecount/files/primecount-7.13-gcc-15-buildfix.patch
new file mode 100644
index 000000000000..6f483ba401ce
--- /dev/null
+++ b/sci-mathematics/primecount/files/primecount-7.13-gcc-15-buildfix.patch
@@ -0,0 +1,30 @@
+From a4512db281754a487314b64fadf4537f4620396d Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <[email protected]>
+Date: Tue, 30 Jul 2024 16:19:25 -0400
+Subject: [PATCH] include/libdivide.h: backport gcc-15 fix
+
+This is commit 572d2408 to upstream libdivide, backported to the copy
+bundled with primecount. The issue is also fixed in primecount but
+won't arrive until v7.14.
+---
+ include/libdivide.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/include/libdivide.h b/include/libdivide.h
+index 3779ebd..7336efb 100644
+--- a/include/libdivide.h
++++ b/include/libdivide.h
+@@ -2015,8 +2015,8 @@ public:
+     }
+ 
+     bool operator==(const divider<T, ALGO>& other) const {
+-        return div.denom.magic == other.denom.magic &&
+-               div.denom.more == other.denom.more;
++        return div.denom.magic == other.div.denom.magic &&
++               div.denom.more == other.div.denom.more;
+     }
+ 
+     bool operator!=(const divider<T, ALGO>& other) const {
+-- 
+2.44.2
+

diff --git a/sci-mathematics/primecount/primecount-7.13.ebuild 
b/sci-mathematics/primecount/primecount-7.13-r1.ebuild
similarity index 95%
rename from sci-mathematics/primecount/primecount-7.13.ebuild
rename to sci-mathematics/primecount/primecount-7.13-r1.ebuild
index c6490b03ae75..2408ad36320b 100644
--- a/sci-mathematics/primecount/primecount-7.13.ebuild
+++ b/sci-mathematics/primecount/primecount-7.13-r1.ebuild
@@ -18,6 +18,8 @@ RESTRICT="!test? ( test )"
 DEPEND=">=sci-mathematics/primesieve-12.0:="
 RDEPEND="${DEPEND}"
 
+PATCHES=( "${FILESDIR}/${P}-gcc-15-buildfix.patch" )
+
 DOCS=(
        ChangeLog
        README.md

Reply via email to