commit:     378e134da95b4547fec2437dffb6fb1c3d84a946
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Tue Dec  9 10:01:02 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Dec  9 16:16:28 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=378e134d

sci-libs/kissfft: add 131.2.0

rebased from live
close two bugs fixed by upstream

Closes: https://bugs.gentoo.org/837026
Closes: https://bugs.gentoo.org/965071
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/44968
Closes: https://github.com/gentoo/gentoo/pull/44968
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/kissfft/Manifest                          |  1 +
 .../kissfft/files/kissfft-131.2.0-fix_python.patch | 15 ++++
 sci-libs/kissfft/kissfft-131.2.0.ebuild            | 92 ++++++++++++++++++++++
 3 files changed, 108 insertions(+)

diff --git a/sci-libs/kissfft/Manifest b/sci-libs/kissfft/Manifest
index 12e96cdb00eb..26d7997008ec 100644
--- a/sci-libs/kissfft/Manifest
+++ b/sci-libs/kissfft/Manifest
@@ -1 +1,2 @@
 DIST kissfft-131.1.0.tar.gz 52383 BLAKE2B 
74e6d2e7d132a311b31c28a468e13d9772a53f0ea0abed0e0f49d8db9c183fb0646f58fd38df3e797b8577285899daf6b80446b149ce2582bb828410656d96df
 SHA512 
bd715868ce0e93a291a0592fb1f8b960e832fc64efe863755e52b67d5addff9bcb444a1bf2570d1914c52b41dad1023d0d86400f5ea30c9fb84cd6b4f7210708
+DIST kissfft-131.2.0.tar.gz 52477 BLAKE2B 
79c4f98ce09dfad13ac0b440422a6a0905a4fa9c7d7234bdab79cacf6ab3f28c034f136587fae72eccb27c7369c486dcc7a95b279d76584d6a7ea0ddc24de0d8
 SHA512 
5d02802a9e191e7cb77c26e9a34659a5d47c4e85bcfdf86a7cffdda66d8b79261f7fe5795ffabd78644b6094c01b32a84841669fbc0009ac9268ae1ba521af9e

diff --git a/sci-libs/kissfft/files/kissfft-131.2.0-fix_python.patch 
b/sci-libs/kissfft/files/kissfft-131.2.0-fix_python.patch
new file mode 100644
index 000000000000..44f5bf8ad0fa
--- /dev/null
+++ b/sci-libs/kissfft/files/kissfft-131.2.0-fix_python.patch
@@ -0,0 +1,15 @@
+backport PR merged to fix python detection
+https://github.com/mborgerding/kissfft/pull/119.patch
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -53,8 +53,8 @@ if(KISSFFT_DATATYPE MATCHES "^simd$")
+     endif()
+ endif()
+ 
+-find_package(Python REQUIRED)
+-add_test(NAME testkiss.py COMMAND "${PYTHON_EXECUTABLE}" 
"${CMAKE_CURRENT_SOURCE_DIR}/testkiss.py")
++find_package(Python3 COMPONENTS Interpreter REQUIRED)
++add_test(NAME testkiss.py COMMAND "${Python3_INTERPRETER}" 
"${CMAKE_CURRENT_SOURCE_DIR}/testkiss.py")
+ list(APPEND TESTKISS_PY_ENV "KISSFFT_DATATYPE=${KISSFFT_DATATYPE}")
+ list(APPEND TESTKISS_PY_ENV "KISSFFT_OPENMP=${KISSFFT_OPENMP}")
+ set_tests_properties(testkiss.py PROPERTIES

diff --git a/sci-libs/kissfft/kissfft-131.2.0.ebuild 
b/sci-libs/kissfft/kissfft-131.2.0.ebuild
new file mode 100644
index 000000000000..3e3fe3b61b3d
--- /dev/null
+++ b/sci-libs/kissfft/kissfft-131.2.0.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..14} )
+
+inherit cmake multibuild python-any-r1 toolchain-funcs
+
+DESCRIPTION="Fast Fourier Transform (FFT) library that tries to Keep it 
Simple, Stupid"
+HOMEPAGE="https://github.com/mborgerding/kissfft";
+
+if [[ ${PV} == *9999 ]] ; then
+       EGIT_REPO_URI="https://github.com/mborgerding/kissfft";
+       inherit git-r3
+else
+       SRC_URI="https://github.com/mborgerding/kissfft/archive/${PV}.tar.gz -> 
${P}.tar.gz"
+       KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
+fi
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="alloca cpu_flags_x86_sse double int16 int32 openmp test tools"
+RESTRICT="!test? ( test )"
+
+RDEPEND="tools? ( media-libs/libpng:= )"
+DEPEND="
+       ${RDEPEND}
+       test? (
+               sci-libs/fftw:3.0
+               $(python_gen_any_dep '
+                       dev-python/numpy[${PYTHON_USEDEP}]
+               ')
+       )
+"
+
+PATCHES=(
+       # both merged after 131.2.0
+       "${FILESDIR}"/${PN}-131.1.0-cross.patch
+       "${FILESDIR}"/${PN}-131.2.0-fix_python.patch
+       # PR pending https://github.com/mborgerding/kissfft/pull/92
+       "${FILESDIR}"/${PN}-131.1.0-cmake.patch
+)
+
+python_check_deps() {
+       python_has_version -d "dev-python/numpy[${PYTHON_USEDEP}]"
+}
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       MULTIBUILD_VARIANTS=(
+               float
+               $(usev double)
+               $(usev int16 int16_t)
+               $(usev int32 int32_t)
+               $(usev cpu_flags_x86_sse simd)
+       )
+
+       use test && python-any-r1_pkg_setup
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+kissfft_configure() {
+       local mycmakeargs=(
+               -DKISSFFT_OPENMP=$(usex openmp 1 0)
+               -DKISSFFT_TEST=$(usex test)
+               -DKISSFFT_TOOLS=$(usex tools)
+               -DKISSFFT_USE_ALLOCA=$(usex alloca)
+               -DKISSFFT_DATATYPE=${MULTIBUILD_VARIANT}
+       )
+
+       cmake_src_configure
+}
+
+src_configure() {
+       multibuild_foreach_variant kissfft_configure
+}
+
+src_compile() {
+       multibuild_foreach_variant cmake_src_compile
+}
+
+src_test() {
+       multibuild_foreach_variant cmake_src_test
+}
+
+src_install() {
+       multibuild_foreach_variant cmake_src_install
+}

Reply via email to