diff options
author | Violet Purcell <vimproved@inventati.org> | 2024-10-19 12:06:31 -0400 |
---|---|---|
committer | Andrew Ammerlaan <andrewammerlaan@gentoo.org> | 2024-10-20 13:57:01 +0200 |
commit | dfb63cf60c75563bf69670cd168a16d2d4d8324c (patch) | |
tree | 0026a5187b6ed8b46bfebcaae20e7155443dea53 /sci-libs | |
parent | net-im/whatsie: add 4.16.1 (diff) | |
download | gentoo-dfb63cf60c75563bf69670cd168a16d2d4d8324c.tar.gz gentoo-dfb63cf60c75563bf69670cd168a16d2d4d8324c.tar.bz2 gentoo-dfb63cf60c75563bf69670cd168a16d2d4d8324c.zip |
sci-libs/kissfft: allow parallel installation of multiple datatypes
KissFFT can be built for five different primary datatypes: float,
double, int16_t, int32_t, and SIMD. Currently, we build the float
datatype by default and instead use SIMD if cpu_flags_x86_sse is
enabled. This can lead to awkwardness in programs that expect KissFFT to
be built with a specific data type, such as media-sound/TauonMusicBox in
GURU, which currently is forced to depend on
sci-libs/kissfft[-cpu_flags_x86_sse], which forces a rather irritating
package.use entry for anyone on an amd64 CPU who has set
CPU_FLAGS_X86 accordingly. Instead, always build the float datatype, and
additionally build the SIMD datatype based on cpu_flags_x86_sse. Also
add USE flags to enable the building of the double, int16_t, and int32_t
variants, which may enable more unbundling of KissFFT from other
packages.
Signed-off-by: Violet Purcell <vimproved@inventati.org>
Closes: https://github.com/gentoo/gentoo/pull/39045
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
Diffstat (limited to 'sci-libs')
-rw-r--r-- | sci-libs/kissfft/kissfft-131.1.0-r2.ebuild | 83 | ||||
-rw-r--r-- | sci-libs/kissfft/kissfft-9999.ebuild | 28 | ||||
-rw-r--r-- | sci-libs/kissfft/metadata.xml | 3 |
3 files changed, 110 insertions, 4 deletions
diff --git a/sci-libs/kissfft/kissfft-131.1.0-r2.ebuild b/sci-libs/kissfft/kissfft-131.1.0-r2.ebuild new file mode 100644 index 000000000000..8d8b1bb59f38 --- /dev/null +++ b/sci-libs/kissfft/kissfft-131.1.0-r2.ebuild @@ -0,0 +1,83 @@ +# 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 multibuild 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 double int16 int32 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() { + 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_install() { + multibuild_foreach_variant cmake_src_install +} diff --git a/sci-libs/kissfft/kissfft-9999.ebuild b/sci-libs/kissfft/kissfft-9999.ebuild index 14e039c7eec1..8d8b1bb59f38 100644 --- a/sci-libs/kissfft/kissfft-9999.ebuild +++ b/sci-libs/kissfft/kissfft-9999.ebuild @@ -5,7 +5,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{9..12} ) -inherit cmake python-any-r1 toolchain-funcs +inherit cmake multibuild 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" @@ -20,7 +20,7 @@ fi LICENSE="BSD" SLOT="0" -IUSE="alloca cpu_flags_x86_sse openmp test tools" +IUSE="alloca cpu_flags_x86_sse double int16 int32 openmp test tools" RESTRICT="!test? ( test )" DEPEND=" @@ -46,18 +46,38 @@ pkg_pretend() { } 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 } -src_configure() { +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=$(usex cpu_flags_x86_sse simd float) + -DKISSFFT_DATATYPE=${MULTIBUILD_VARIANT} ) cmake_src_configure } + +src_configure() { + multibuild_foreach_variant kissfft_configure +} + +src_compile() { + multibuild_foreach_variant cmake_src_compile +} + +src_install() { + multibuild_foreach_variant cmake_src_install +} diff --git a/sci-libs/kissfft/metadata.xml b/sci-libs/kissfft/metadata.xml index 9cc777a3ea9c..5ffd94eab047 100644 --- a/sci-libs/kissfft/metadata.xml +++ b/sci-libs/kissfft/metadata.xml @@ -7,6 +7,9 @@ </maintainer> <use> <flag name="alloca">Use alloca(3) instead of malloc(3) for memory management</flag> + <flag name="double">Build library for primary data type of double</flag> + <flag name="int16">Build library for primary data type of int16_t</flag> + <flag name="int32">Build library for primary data type of int32_t</flag> <flag name="tools">Build command line tools</flag> </use> <upstream> |