commit:     57495bced469ec22e798661a68790456b047d112
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Thu May 29 02:34:37 2025 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Thu May 29 02:49:04 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=57495bce

sci-libs/linbox: patch to fix the build with gcc-15

I was waiting for linbox-1.7.1 to include this, but I'm starting to lose
hope and we need it now that gcc-15 is in ~arch.

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

 sci-libs/linbox/files/linbox-1.7.0-gcc15.patch |  26 ++++++
 sci-libs/linbox/linbox-1.7.0-r2.ebuild         | 115 +++++++++++++++++++++++++
 2 files changed, 141 insertions(+)

diff --git a/sci-libs/linbox/files/linbox-1.7.0-gcc15.patch 
b/sci-libs/linbox/files/linbox-1.7.0-gcc15.patch
new file mode 100644
index 000000000000..de162bf927bc
--- /dev/null
+++ b/sci-libs/linbox/files/linbox-1.7.0-gcc15.patch
@@ -0,0 +1,26 @@
+From 4a1e1395804d4630ec556c61ba3f2cb67e140248 Mon Sep 17 00:00:00 2001
+From: Jean-Guillaume Dumas <[email protected]>
+Date: Thu, 5 Dec 2024 15:38:58 +0100
+Subject: [PATCH] solving issue #319
+
+---
+ linbox/vector/blas-subvector.h | 52 +++++++++++++++++-----------------
+ tests/test-subvector.C         |  6 ++++
+ 2 files changed, 32 insertions(+), 26 deletions(-)
+
+diff --git a/linbox/vector/blas-subvector.h b/linbox/vector/blas-subvector.h
+index e1582723c3..8f290dd436 100644
+--- a/linbox/vector/blas-subvector.h
++++ b/linbox/vector/blas-subvector.h
+@@ -118,9 +118,9 @@ namespace LinBox {
+          * \param inc distance between two element
+          */
+         BlasSubvector (Self_t &V, size_t beg, size_t inc, size_t dim) :
+-            _ptr(V.data()+beg), _size(dim), _inc(inc), _field(&V.field()) {}
++            _ptr(V.getPointer()+beg), _size(dim), _inc(inc), 
_field(&V.field()) {}
++
+ 
+-        
+         /** Constructor from an existing @ref BlasVector
+          * \param V Pointer to @ref BlasVector of which to construct submatrix
+          */

diff --git a/sci-libs/linbox/linbox-1.7.0-r2.ebuild 
b/sci-libs/linbox/linbox-1.7.0-r2.ebuild
new file mode 100644
index 000000000000..c636b8406738
--- /dev/null
+++ b/sci-libs/linbox/linbox-1.7.0-r2.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="C++ template library for integer and finite-field linear algebra"
+HOMEPAGE="https://linalg.org/";
+SRC_URI="https://github.com/linbox-team/${PN}/releases/download/v${PV}/${P}.tar.gz";
+
+# I think only macros/libtool.m4 (and COPYING) is GPL-2+; the source
+# headers all say LGPL-2.1
+LICENSE="GPL-2+ LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~riscv ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="doc opencl openmp"
+
+BDEPEND="doc? ( app-text/doxygen )"
+
+# The project README says that gmp, givaro, and blas/lapack are required
+# transitively via fflas-ffpack, but that's not true. The build system
+# checks for them, and `git grep` shows that they're used directly.
+DEPEND="dev-libs/gmp[cxx(+)]
+       =sci-libs/givaro-4.2*
+       =sci-libs/fflas-ffpack-2.5*
+       virtual/cblas
+       virtual/lapack
+       opencl? ( virtual/opencl )
+       dev-libs/ntl:=
+       sci-libs/iml
+       dev-libs/mpfr:=
+       sci-mathematics/flint"
+
+# Use mathjax to render inline latex rather than requiring a working latex
+# installation to generate bitmaps.
+RDEPEND="${DEPEND}
+       doc? ( >=dev-libs/mathjax-3 )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.7.0-hardened-testfails.patch
+       "${FILESDIR}"/${PN}-1.7.0-gcc14.patch
+       "${FILESDIR}"/${PN}-1.7.0-gcc15.patch
+)
+
+# The --enable-openmp flag has been removed upstream, but we don't want
+# openmp support to disappear after the package has been compiled with
+# it, so we retain the USE flag and the toolchain check.
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+       default
+
+       if use doc; then
+               # Avoid the need for a working LaTeX installation. MathJax does
+               # slow down the browser a bit but it also renders much more
+               # nicely than the latex-generated bitmaps would.
+               echo "
+                       USE_MATHJAX = YES
+                       MATHJAX_VERSION = MathJax_3
+                       MATHJAX_RELPATH = \"${EPREFIX}/usr/share/mathjax\"
+                       MATHJAX_EXTENSIONS = ams
+               " >> doc/Doxyfile.mod || die
+       fi
+
+       eautoreconf
+}
+
+src_configure() {
+       #
+       # The --with-all flag includes,
+       #
+       #   --with-givaro: used for finite fields, integer, etc. (required)
+       #   --with-fflas-ffpack:  small field dense linear algebra (required)
+       #   --with-ntl: used for finite field, polynomial arithmetic (optional)
+       #   --with-iml: used for fast integer/rational linear algebra (optional)
+       #   --with-mpfr: not sure, doesn't seem to be used? (optional)
+       #   --with-flint: used in algorithms/matrix-blas3 once (optional)
+       #   --with-fplll: an fplll interface not directly used (optional)
+       #   --with-doxygen: needed with --enable-doc to build them (optional)
+       #
+       # Some of these could be behind USE flags, but the ./configure output
+       # says that they're "not yet mandatory," which makes me think we might
+       # be overcomplicating things to make them optional right now.
+       #
+       econf \
+               --with-docdir="${EPREFIX}/usr/share/doc/${PF}" \
+               --with-all="${EPREFIX}"/usr \
+               --without-fplll \
+               --without-archnative \
+               $(use_enable doc) \
+               $(use_with opencl ocl)
+}
+
+src_install() {
+       default
+       find "${ED}" -name '*.la' -delete || die
+       if use doc; then
+               # These files are used for incremental doxygen builds but aren't
+               # part of the final output. Check on
+               #
+               #   https://github.com/linbox-team/linbox/issues/252
+               #
+               # periodically to see if this is pointless.
+               find "${ED}/usr/share/doc/${PF}" -type f -name '*.md5' -delete 
|| die
+               find "${ED}/usr/share/doc/${PF}" -type f -name '*.map' -delete 
|| die
+       fi
+}

Reply via email to