diff options
author | David Roman <davidroman96@gmail.com> | 2024-02-01 11:40:22 +0100 |
---|---|---|
committer | Yixun Lan <dlan@gentoo.org> | 2024-02-22 12:10:56 +0000 |
commit | 38ef80f7c87a6c640df9c801289dd28de96a0321 (patch) | |
tree | 38a86ef05e66f04abca0110717d8f1f6e840c5c8 /sci-libs | |
parent | dev-libs/kirigami-addons: add 1.0.0, drop 0.11.90 (diff) | |
download | gentoo-38ef80f7c87a6c640df9c801289dd28de96a0321.tar.gz gentoo-38ef80f7c87a6c640df9c801289dd28de96a0321.tar.bz2 gentoo-38ef80f7c87a6c640df9c801289dd28de96a0321.zip |
sci-libs/kissfft: add cmake patch
Also:
- update EAPI 7 -> 8
- add python12 support
Signed-off-by: David Roman <davidroman96@gmail.com>
Signed-off-by: Yixun Lan <dlan@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/kissfft/files/kissfft-131.1.0-cmake.patch | 26 | ||||
-rw-r--r-- | sci-libs/kissfft/kissfft-131.1.0-r1.ebuild | 63 | ||||
-rw-r--r-- | sci-libs/kissfft/kissfft-9999.ebuild | 9 |
3 files changed, 94 insertions, 4 deletions
diff --git a/sci-libs/kissfft/files/kissfft-131.1.0-cmake.patch b/sci-libs/kissfft/files/kissfft-131.1.0-cmake.patch new file mode 100644 index 000000000000..a3cb3e468e17 --- /dev/null +++ b/sci-libs/kissfft/files/kissfft-131.1.0-cmake.patch @@ -0,0 +1,26 @@ +diff --git a/kissfft-config.cmake.in b/kissfft-config.cmake.in +index cd7139a..7d6c7a2 100644 +--- a/kissfft-config.cmake.in ++++ b/kissfft-config.cmake.in +@@ -66,14 +66,19 @@ foreach(_kissfft_datatype simd int16 int32 float double) + endforeach() + + if(_kissfft_datatype_detected) +- if(NOT TARGET kissfft::kissfft-${_kissfft_datatype_detected}) +- message(FATAL_ERROR "kissfft with datatype=${_kissfft_datatype_detected} is not installed") ++ if(TARGET kissfft::kissfft-${_kissfft_datatype_detected}-openmp) ++ set(_kissfft_openmp_detected "-openmp") + endif() ++ ++ if(NOT TARGET kissfft::kissfft-${_kissfft_datatype_detected}${_kissfft_openmp_detected}) ++ message(FATAL_ERROR "kissfft with datatype=${_kissfft_datatype_detected}${_kissfft_openmp_detected} is not installed") ++ endif() ++ + if(TARGET kissfft::kissfft) + message(SEND_ERROR "kissfft::kissfft already exists. You cannot use 2 find_package's with datatype that are visible to eachother.") + else() + add_library(kissfft::kissfft INTERFACE IMPORTED) +- set_property(TARGET kissfft::kissfft PROPERTY INTERFACE_LINK_LIBRARIES kissfft::kissfft-${_kissfft_datatype_detected}) ++ set_property(TARGET kissfft::kissfft PROPERTY INTERFACE_LINK_LIBRARIES kissfft::kissfft-${_kissfft_datatype_detected}${_kissfft_openmp_detected}) + endif() + endif() diff --git a/sci-libs/kissfft/kissfft-131.1.0-r1.ebuild b/sci-libs/kissfft/kissfft-131.1.0-r1.ebuild new file mode 100644 index 000000000000..14e039c7eec1 --- /dev/null +++ b/sci-libs/kissfft/kissfft-131.1.0-r1.ebuild @@ -0,0 +1,63 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..12} ) + +inherit cmake python-any-r1 toolchain-funcs + +DESCRIPTION="A 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 openmp test tools" +RESTRICT="!test? ( test )" + +DEPEND=" + test? ( + sci-libs/fftw:3.0 + $(python_gen_any_dep ' + dev-python/numpy[${PYTHON_USEDEP}] + ') + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-131.1.0-cross.patch + "${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() { + use test && python-any-r1_pkg_setup + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +src_configure() { + local mycmakeargs=( + -DKISSFFT_OPENMP=$(usex openmp 1 0) + -DKISSFFT_TEST=$(usex test) + -DKISSFFT_TOOLS=$(usex tools) + -DKISSFFT_USE_ALLOCA=$(usex alloca) + -DKISSFFT_DATATYPE=$(usex cpu_flags_x86_sse simd float) + ) + + cmake_src_configure +} diff --git a/sci-libs/kissfft/kissfft-9999.ebuild b/sci-libs/kissfft/kissfft-9999.ebuild index 238fe43ab8ee..14e039c7eec1 100644 --- a/sci-libs/kissfft/kissfft-9999.ebuild +++ b/sci-libs/kissfft/kissfft-9999.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2023 Gentoo Authors +# Copyright 1999-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 -EAPI=7 +EAPI=8 -PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_COMPAT=( python3_{9..12} ) inherit cmake python-any-r1 toolchain-funcs @@ -15,7 +15,7 @@ if [[ ${PV} == *9999 ]] ; then inherit git-r3 else SRC_URI="https://github.com/mborgerding/kissfft/archive/${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~amd64 ~arm ~arm64 ~x86" + KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86" fi LICENSE="BSD" @@ -34,6 +34,7 @@ DEPEND=" PATCHES=( "${FILESDIR}"/${PN}-131.1.0-cross.patch + "${FILESDIR}"/${PN}-131.1.0-cmake.patch ) python_check_deps() { |