summaryrefslogtreecommitdiff
path: root/sci-mathematics/flint
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-24 07:41:16 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-24 07:41:16 +0000
commit3e3aa158fd100df495010eed7915f012d5c9bcaa (patch)
treeeec12007aef38a8d8dbffd66d0e186f005fdc65c /sci-mathematics/flint
parent4560e1a95e1072b051371c59aec78b15e4787ded (diff)
gentoo auto-resync : 24:12:2023 - 07:41:16
Diffstat (limited to 'sci-mathematics/flint')
-rw-r--r--sci-mathematics/flint/Manifest3
-rw-r--r--sci-mathematics/flint/files/flint-3.0.1-find-cblas.patch44
-rw-r--r--sci-mathematics/flint/flint-3.0.1.ebuild81
3 files changed, 128 insertions, 0 deletions
diff --git a/sci-mathematics/flint/Manifest b/sci-mathematics/flint/Manifest
index fcbedbf5fc32..c5448d68c254 100644
--- a/sci-mathematics/flint/Manifest
+++ b/sci-mathematics/flint/Manifest
@@ -1,4 +1,7 @@
AUX flint-2.9.0-remove-hardcoded-CFLAGS.patch 2131 BLAKE2B f52fbcf321fd0f0beb302480c220b1f83e382ffe893e9b22a5eed839d02c2436ba101575c272cea0fbcbdd42110d5b9dde7cf6516403cb6dde1b0fa081dae63f SHA512 fa5c057cf664cd3ba83d3ec6b31a96c8a8e4a971a8f07b11a40150e22c1e55c7ad2d8b480f119213f867e502417c48741bb438b1724393b42da27d3577116fb5
+AUX flint-3.0.1-find-cblas.patch 1755 BLAKE2B bdf73d282a98f11126271d1afb5dd27daa2242fbd4923558a720753db85fcc71474ab559822a3549d60c555ab72c8273350c9df3fea2ba4d134bd7a45ec4c089 SHA512 1dc9342031472e59a5ba68540f070dc410134be5d52d7545a780c5b2867fad3c84410c5719ada517a0f2780f384c02487d128e0264bdaa54e8cdf34d2a5b71df
DIST flint-2.9.0.tar.gz 5283894 BLAKE2B a790437ee142d8acb5cec1e6c7d21812f8d83f5d30d1e8c07e799713e96791d87792f25fbd4ce2d0d68f6a8ee2f0cde2b8d9f8db8ab26922a48485e0e90394aa SHA512 4494cba6a4e215e817d7c74ef6834c4e05a832488f4808bbd7bea8b02a4a35d47ef3c63a4f213230c712b32842f5588c503fc1cf23e5e2ddc4a4a5a1627a02ba
+DIST flint-3.0.1.tar.gz 7624944 BLAKE2B 0d94252075945f39af3dd2e49803cbe16aa65b108964dfc0c12bdfd9188748944c1e839401e17b974f8f6f8832e4da84d62a63f20b63cfff0ff5c2736bfd2d47 SHA512 4b5b432b962135cd708a0ce4242343f3226f0fdf73c3f541728ed4540e7ef6cb7812a48b6b46e65a8fcc1f5cae93d8bb59838d24728024cd9aa0f7b8e5c6f98f
EBUILD flint-2.9.0.ebuild 1726 BLAKE2B dd2ef05aacb1642cc35807306af41237bb362662a8b7b50d5814f42212125d8a83aa716c7699d554e66e41a298bf5470b454d6e67ae9dd7fae6d8bb6cd503e82 SHA512 d40e144f5e2efeb72fe39b7c9948517ab6b59588a184e3b449932c914d8f85ba5db0cd2b1f4a56925288877705956b0ff2c175327dd24f385a12014e577e5506
+EBUILD flint-3.0.1.ebuild 1983 BLAKE2B bba189fe6f49d2991abc592b99cf725add9abb69f1d683432aa1954e46293afe3fc0b5a8afa7e77acb09455598c91388e29cde07dc845bd2bd66fc98ef9734d8 SHA512 0e68cb71137a24a696f49b21f1523d694af56fda47b9d1343aca9d9a58f55196a304bbb236125e7313429311e7b4ba36a88d365d55f1ac7ff8840e4da4d9ac68
MISC metadata.xml 640 BLAKE2B b95d6f493564025e43604bffa340fffd88fcedf29c282fcc3c18e08ac089cdf1e10837787af664dd250a77a62237bf3665ff0a3045ca52680dd67aa0b39eeba7 SHA512 a9a64076e7f0df29e6a05a9d349c530a4ee4285b6a444425681eddf6ae1e8b41f610fda0bd7cc86b5177b36f34bc3072b67c7edac2cc8c0709a032b000576a14
diff --git a/sci-mathematics/flint/files/flint-3.0.1-find-cblas.patch b/sci-mathematics/flint/files/flint-3.0.1-find-cblas.patch
new file mode 100644
index 000000000000..77a9ed2e888f
--- /dev/null
+++ b/sci-mathematics/flint/files/flint-3.0.1-find-cblas.patch
@@ -0,0 +1,44 @@
+From 5cb3535b911c78adb9c8a908104fc4be3ffbfe51 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Sat, 23 Dec 2023 14:38:46 -0500
+Subject: [PATCH 1/1] CMake/FindCBLAS.cmake: search only for cblas
+
+On Gentoo, users can "eselect cblas" to choose a cblas implementation
+at runtime. Packages build against the reference cblas, but the others
+are (by design) compatible, so we can force one to take precedence at
+runtime with an ld.so.conf entry. But that only works when consumers
+link to libcblas.so. If they link directly to (say) openblas, then
+changing how libcblas.so resolves won't help.
+
+When Flint tries to find "cblas," it looks for accelerate and openblas
+before plain cblas. That runs afoul of the scheme described above. To
+remedy it, we patch the search function so that only "cblas" is
+considered. Since virtual/cblas always pulls in the reference
+implementation, there'd be no point in altering the search order to
+consider e.g. openblas after cblas.
+---
+ CMake/FindCBLAS.cmake | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/CMake/FindCBLAS.cmake b/CMake/FindCBLAS.cmake
+index f5b5b1c..f4919f4 100644
+--- a/CMake/FindCBLAS.cmake
++++ b/CMake/FindCBLAS.cmake
+@@ -11,13 +11,11 @@
+ find_path(CBLAS_INCLUDE_DIRS NAMES cblas.h
+ HINTS CBLAS_ROOT ENV CBLAS_ROOT
+ PATHS ${INCLUDE_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/include
+- PATH_SUFFIXES openblas cblas blis flexiblas
+ )
+
+-find_library(CBLAS_LIBRARIES NAMES accelerate openblas cblas blas blis flexiblas
++find_library(CBLAS_LIBRARIES NAMES cblas
+ HINTS CBLAS_ROOT ENV CBLAS_ROOT
+ PATHS ${LIB_INSTALL_DIR} ${CMAKE_INSTALL_PREFIX}/lib
+- PATH_SUFFIXES openblas cblas blis flexiblas
+ )
+
+ include(FindPackageHandleStandardArgs)
+--
+2.41.0
+
diff --git a/sci-mathematics/flint/flint-3.0.1.ebuild b/sci-mathematics/flint/flint-3.0.1.ebuild
new file mode 100644
index 000000000000..7f24b83f5744
--- /dev/null
+++ b/sci-mathematics/flint/flint-3.0.1.ebuild
@@ -0,0 +1,81 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake flag-o-matic python-any-r1
+
+DESCRIPTION="Fast Library for Number Theory"
+HOMEPAGE="https://www.flintlib.org/"
+
+# flintlib.org tarballs have been broken in the past, Bill Hart suggests
+# we get them from Github (which he has control over).
+SRC_URI="https://github.com/flintlib/flint/archive/refs/tags/v${PV}.tar.gz
+ -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+
+# Based off the soname, e.g. /usr/lib64/libflint.so -> libflint.so.15
+SLOT="0/18"
+
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86"
+IUSE="doc ntl test"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="${PYTHON_DEPS}
+ doc? (
+ app-text/texlive-core
+ dev-python/sphinx
+ dev-tex/latexmk
+ dev-texlive/texlive-latex
+ dev-texlive/texlive-latexextra
+ )
+"
+DEPEND="dev-libs/gmp:=
+ dev-libs/mpfr:=
+ ntl? ( dev-libs/ntl:= )
+ virtual/cblas"
+# flint 3 includes arb and arb cannot use flint 3.
+RDEPEND="${DEPEND}
+ !sci-mathematics/arb"
+
+# The rst files are API docs, but they're very low-effort compared to
+# the PDF and HTML docs, so we ship them unconditionally and hide only
+# the painful parts behind USE=doc.
+DOCS="AUTHORS README.md doc/source/*.rst"
+
+PATCHES=( "${FILESDIR}/flint-3.0.1-find-cblas.patch" )
+
+src_configure() {
+ # https://github.com/flintlib/flint/issues/1683
+ append-cflags -Wno-error=strict-prototypes
+
+ local mycmakeargs=(
+ -DWITH_NTL="$(usex ntl)"
+ -DBUILD_TESTING="$(usex test)"
+ -DBUILD_DOCS="$(usex doc)"
+ )
+
+ cmake_src_configure
+
+ if use doc; then
+ # Avoid the "html/_source" directory that will contain a copy of
+ # the rst sources we've already installed, and also avoid
+ # installing html/objects.inv.
+ HTML_DOCS="${BUILD_DIR}/html/*.html
+ ${BUILD_DIR}/html/*.js
+ ${BUILD_DIR}/html/_static"
+ DOCS+=" ${BUILD_DIR}/latex/Flint.pdf"
+ fi
+}
+
+src_compile() {
+ cmake_src_compile
+
+ if use doc; then
+ cmake_build html
+ cmake_build pdf
+ fi
+}