commit:     03441e07bbbd0cae3a9e69d4e9f7b871647d70b8
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 30 10:55:21 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Sep 30 11:02:40 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=03441e07

sci-libs/flexiblas: Update the wrappers to avoid DT_AUXILIARY

Update the wrapper approach to avoid DT_AUXILIARY in the default case.
Now, libblas.so.3 & co. are symlinks to the FlexiBLAS library, so that
packages use it directly; libblas.so & co. are symlinks to wrappers
placed in a subdirectory, so they are only used to construct the correct
DT_NEEDED entries at build time.  The advantage of this approach is that
it also works on musl, so we do not have to use two different solutions.

We are still using the full library symlink tree for the wrapper
to avoid another fight with Meson, and hopefully to reduce the risk
of compatibility issues.  The library still contains DT_AUXILIARY
section, and it could still be used if one dlopens the top-level .so
file directly (rather than the .so.3).

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...blas-9999.ebuild => flexiblas-3.4.82-r4.ebuild} | 39 +++++++++++-----------
 sci-libs/flexiblas/flexiblas-9999.ebuild           | 24 +++++--------
 2 files changed, 28 insertions(+), 35 deletions(-)

diff --git a/sci-libs/flexiblas/flexiblas-9999.ebuild 
b/sci-libs/flexiblas/flexiblas-3.4.82-r4.ebuild
similarity index 88%
copy from sci-libs/flexiblas/flexiblas-9999.ebuild
copy to sci-libs/flexiblas/flexiblas-3.4.82-r4.ebuild
index 13f3775404c0..51b77796acdc 100644
--- a/sci-libs/flexiblas/flexiblas-9999.ebuild
+++ b/sci-libs/flexiblas/flexiblas-3.4.82-r4.ebuild
@@ -3,21 +3,24 @@
 
 EAPI=8
 
-inherit cmake git-r3 multilib toolchain-funcs
+inherit cmake multilib toolchain-funcs
 
+MY_P=flexiblas-release-v${PV}
 DESCRIPTION="A BLAS and LAPACK wrapper library with runtime exchangable 
backends"
 HOMEPAGE="
        https://www.mpi-magdeburg.mpg.de/projects/flexiblas/
        https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release/
 "
-EGIT_REPO_URI="
-       https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release.git
+SRC_URI="
+       
https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release/-/archive/v${PV}/${MY_P}.tar.bz2
 "
+S=${WORKDIR}/${MY_P}
 
 # BSD for vendored cblas/lapacke
 LICENSE="LGPL-3+ BSD"
 SLOT="0"
-IUSE="blis elibc_glibc index64 mkl openblas openmp system-blas tbb test"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86"
+IUSE="blis index64 mkl openblas openmp system-blas tbb test"
 RESTRICT="!test? ( test )"
 
 # flexiblas only supports gnu-openmp using clang/gcc
@@ -38,13 +41,12 @@ RDEPEND="
                !app-eselect/eselect-cblas
                !app-eselect/eselect-lapack
                !sci-libs/lapack[-flexiblas(-)]
+               !=sci-libs/blas-lapack-aux-wrapper-0-r0
        )
 "
 PDEPEND="
        system-blas? (
-               elibc_glibc? (
-                       sci-libs/blas-lapack-aux-wrapper[index64?]
-               )
+               >=sci-libs/blas-lapack-aux-wrapper-0-r1[index64?]
        )
 "
 
@@ -61,6 +63,12 @@ pkg_setup() {
 }
 
 src_prepare() {
+       local PATCHES=(
+               # extracted from
+               # 
https://gitlab.mpi-magdeburg.mpg.de/software/flexiblas-release/-/commit/04021ceada30f136036a22dc6c811b3d352b199d
+               "${FILESDIR}/${P}-xerbla-array.patch"
+       )
+
        cmake_src_prepare
 
        # remove bundled netlib blas/lapack
@@ -246,19 +254,12 @@ src_install() {
                        dosym "flexiblas/${fn}" "/usr/include/${fn}"
                done
 
-               # On glibc, we can use sci-libs/blas-lapack-aux-wrapper.
-               if ! use elibc_glibc; then
-                       for suffix in '' $(usev index64 64); do
-                               for fn in blas cblas lapack lapacke; do
-                                       dosym "libflexiblas${suffix}.so.3" \
-                                               
"${libdir}/lib${fn}${suffix}.so.3"
-                                       dosym "libflexiblas${suffix}.so" \
-                                               "${libdir}/lib${fn}${suffix}.so"
-                                       dosym "flexiblas${suffix}.pc" \
-                                               
"${libdir}/pkgconfig/${fn}${suffix}.pc"
-                               done
+               for suffix in '' $(usev index64 64); do
+                       for fn in blas cblas lapack lapacke; do
+                               dosym "libflexiblas${suffix}.so.3" \
+                                       "${libdir}/lib${fn}${suffix}.so.3"
                        done
-               fi
+               done
        fi
 }
 

diff --git a/sci-libs/flexiblas/flexiblas-9999.ebuild 
b/sci-libs/flexiblas/flexiblas-9999.ebuild
index 13f3775404c0..9aff3ceea439 100644
--- a/sci-libs/flexiblas/flexiblas-9999.ebuild
+++ b/sci-libs/flexiblas/flexiblas-9999.ebuild
@@ -17,7 +17,7 @@ EGIT_REPO_URI="
 # BSD for vendored cblas/lapacke
 LICENSE="LGPL-3+ BSD"
 SLOT="0"
-IUSE="blis elibc_glibc index64 mkl openblas openmp system-blas tbb test"
+IUSE="blis index64 mkl openblas openmp system-blas tbb test"
 RESTRICT="!test? ( test )"
 
 # flexiblas only supports gnu-openmp using clang/gcc
@@ -38,13 +38,12 @@ RDEPEND="
                !app-eselect/eselect-cblas
                !app-eselect/eselect-lapack
                !sci-libs/lapack[-flexiblas(-)]
+               !=sci-libs/blas-lapack-aux-wrapper-0-r0
        )
 "
 PDEPEND="
        system-blas? (
-               elibc_glibc? (
-                       sci-libs/blas-lapack-aux-wrapper[index64?]
-               )
+               >=sci-libs/blas-lapack-aux-wrapper-0-r1[index64?]
        )
 "
 
@@ -246,19 +245,12 @@ src_install() {
                        dosym "flexiblas/${fn}" "/usr/include/${fn}"
                done
 
-               # On glibc, we can use sci-libs/blas-lapack-aux-wrapper.
-               if ! use elibc_glibc; then
-                       for suffix in '' $(usev index64 64); do
-                               for fn in blas cblas lapack lapacke; do
-                                       dosym "libflexiblas${suffix}.so.3" \
-                                               
"${libdir}/lib${fn}${suffix}.so.3"
-                                       dosym "libflexiblas${suffix}.so" \
-                                               "${libdir}/lib${fn}${suffix}.so"
-                                       dosym "flexiblas${suffix}.pc" \
-                                               
"${libdir}/pkgconfig/${fn}${suffix}.pc"
-                               done
+               for suffix in '' $(usev index64 64); do
+                       for fn in blas cblas lapack lapacke; do
+                               dosym "libflexiblas${suffix}.so.3" \
+                                       "${libdir}/lib${fn}${suffix}.so.3"
                        done
-               fi
+               done
        fi
 }
 

Reply via email to