commit:     9f98bd691ff2e76bf53ac4a6c3d8be1cecbc0658
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 30 17:39:48 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Jun 30 18:46:04 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f98bd69

sci-libs/symengine: Fix SymEngineConfig.cmake module w/ CMake-4

Only changes a cmake module used by revdeps, not dropping stable keywords.

Closes: https://bugs.gentoo.org/957803
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 .../symengine/files/symengine-0.14.0-cmake4.patch  |  44 +++++++++
 sci-libs/symengine/symengine-0.14.0-r1.ebuild      | 106 +++++++++++++++++++++
 2 files changed, 150 insertions(+)

diff --git a/sci-libs/symengine/files/symengine-0.14.0-cmake4.patch 
b/sci-libs/symengine/files/symengine-0.14.0-cmake4.patch
new file mode 100644
index 000000000000..bd50ace7a8f9
--- /dev/null
+++ b/sci-libs/symengine/files/symengine-0.14.0-cmake4.patch
@@ -0,0 +1,44 @@
+From 186f72e208220efd12362c336a49378076f63f30 Mon Sep 17 00:00:00 2001
+From: Isuru Fernando <[email protected]>
+Date: Tue, 1 Apr 2025 10:30:43 -0500
+Subject: [PATCH 2/3] set cmake_minimum_required
+
+---
+ cmake/SymEngineConfig.cmake.in | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cmake/SymEngineConfig.cmake.in b/cmake/SymEngineConfig.cmake.in
+index aaaa8d241..8465298a7 100644
+--- a/cmake/SymEngineConfig.cmake.in
++++ b/cmake/SymEngineConfig.cmake.in
+@@ -31,7 +31,9 @@
+ # target_link_libraries(example ${SYMENGINE_LIBRARIES})
+ #
+ 
+-cmake_minimum_required(VERSION 2.8.12)
++# We are compatible with 2.8.12, but also updated to support policies
++# in 4.0.0
++cmake_minimum_required(VERSION 2.8.12...4.0.0)
+ 
+ if (POLICY CMP0074)
+   cmake_policy(SET CMP0074 NEW)
+
+From 3818ef6b65e1d0da4f485ec8f64661719cbe547c Mon Sep 17 00:00:00 2001
+From: Isuru Fernando <[email protected]>
+Date: Tue, 1 Apr 2025 19:40:18 -0500
+Subject: [PATCH 3/3] Update CMakeLists.txt
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 62c367f16..f13772b97 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.13)
++cmake_minimum_required(VERSION 2.8.12...4.0.0)
+ 
+ if (POLICY CMP0074)
+   cmake_policy(SET CMP0074 NEW)

diff --git a/sci-libs/symengine/symengine-0.14.0-r1.ebuild 
b/sci-libs/symengine/symengine-0.14.0-r1.ebuild
new file mode 100644
index 000000000000..611e2f62519a
--- /dev/null
+++ b/sci-libs/symengine/symengine-0.14.0-r1.ebuild
@@ -0,0 +1,106 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LLVM_COMPAT=( {18..20} )
+LLVM_OPTIONAL=1
+
+inherit cmake llvm-r2 toolchain-funcs
+
+DESCRIPTION="Fast symbolic manipulation library, written in C++"
+HOMEPAGE="https://github.com/symengine/symengine/";
+SRC_URI="
+       https://github.com/symengine/${PN}/archive/v${PV}.tar.gz
+               -> ${P}.gh.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv ~x86"
+IUSE="
+       boost debug ecm +flint llvm +mpc +mpfr openmp primesieve tcmalloc
+       test
+"
+REQUIRED_USE="
+       boost? ( !flint !mpc !mpfr )
+       llvm? ( ${LLVM_REQUIRED_USE} )
+       mpc? ( mpfr )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       boost? ( dev-libs/boost:= )
+       !boost? ( dev-libs/gmp:= )
+       debug? ( sys-libs/binutils-libs:= )
+       ecm? ( sci-mathematics/gmp-ecm:= )
+       flint? ( sci-mathematics/flint:= )
+       mpc? ( dev-libs/mpc:= )
+       mpfr? ( dev-libs/mpfr:= )
+       llvm? ( $(llvm_gen_dep 'llvm-core/llvm:${LLVM_SLOT}=') )
+       primesieve? ( sci-mathematics/primesieve:= )
+       tcmalloc? ( dev-util/google-perftools )
+"
+DEPEND="
+       ${RDEPEND}
+       dev-libs/cereal
+"
+
+PATCHES=( "${FILESDIR}/${P}-cmake4.patch" ) # bug 957803, in git master
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_configure() {
+       local int_class
+
+       if use flint; then
+               int_class=flint
+       elif use mpfr; then
+               int_class=gmpxx
+       elif use boost; then
+               int_class=boostmp
+       else
+               int_class=gmp
+       fi
+
+       einfo "Building with integer class: ${int_class}"
+
+       local mycmakeargs=(
+               
-DINSTALL_CMAKE_DIR="${EPREFIX}/usr/$(get_libdir)/cmake/symengine"
+               -DINTEGER_CLASS=${int_class}
+               # not installed
+               -DBUILD_BENCHMARKS=OFF
+               # broken with out-of-tree builds
+               -DBUILD_DOXYGEN=OFF
+               -DBUILD_TESTS=$(usex test)
+               # -DWITH_ARB provided by flint >= 2
+               -DWITH_BFD=$(usex debug)
+               -DWITH_ECM=$(usex ecm)
+               -DWITH_FLINT=$(usex flint)
+               -DWITH_LLVM=$(usex llvm)
+               -DWITH_MPC=$(usex mpc)
+               -DWITH_MPFR=$(usex mpfr)
+               -DWITH_OPENMP=$(usex openmp)
+               -DWITH_PRIMESIEVE=$(usex primesieve)
+               -DWITH_PTHREAD=ON
+               -DWITH_SYMENGINE_ASSERT=$(usex debug)
+               -DWITH_SYMENGINE_THREAD_SAFE=ON
+               -DWITH_SYSTEM_CEREAL=ON
+               # TODO: package it
+               # -DWITH_SYSTEM_FASTFLOAT=ON
+               -DWITH_TCMALLOC=$(usex tcmalloc)
+       )
+       if use llvm; then
+               mycmakeargs+=(
+                       -DLLVM_ROOT="$(get_llvm_prefix -d)"
+               )
+       fi
+
+       cmake_src_configure
+}

Reply via email to