commit:     6d3f9e49a29ccfd285b2450d434f98eeff1c0ba2
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Sun Mar 30 20:35:16 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Mar 31 21:30:45 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d3f9e49

sci-libs/nfft: add 3.5.3

Closes: https://bugs.gentoo.org/944858
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sci-libs/nfft/Manifest                     |  1 +
 sci-libs/nfft/files/nfft-3.5.3-gcc15.patch | 43 ++++++++++++++++++++++++
 sci-libs/nfft/files/nfft-3.5.3-rtc.patch   | 21 ++++++++++++
 sci-libs/nfft/nfft-3.5.3.ebuild            | 53 ++++++++++++++++++++++++++++++
 4 files changed, 118 insertions(+)

diff --git a/sci-libs/nfft/Manifest b/sci-libs/nfft/Manifest
index da7de6adcaee..b7f91d86ca5d 100644
--- a/sci-libs/nfft/Manifest
+++ b/sci-libs/nfft/Manifest
@@ -1 +1,2 @@
 DIST nfft-3.5.2.tar.gz 5377870 BLAKE2B 
5a9b79fd2db781f163f3e694e25096f9abfac67ae9e2f0614444e99160ac6ce150356b72130ba44f82c541120f8876723a06e989a5c125e1da1b85976b7ff500
 SHA512 
e5437b358f22807de2251527025accf326d77322e029cfc3df6ee733ccca4d020cbd3c045773735de0641618c71e5cc9b8f4df53becea3b7a7e27750f21fa64e
+DIST nfft-3.5.3.tar.gz 5643780 BLAKE2B 
7aaa4406250154766377f2e8620690d3f78b48f734f78ded7f611eda8c38fc048d3b38402e7c9f8b219629afe79058b5b2b57e0cf59cd869f0713365381e2ca9
 SHA512 
062e89bd621cb2f6e348507cf9892e38a92dde10d2d8afbc2642fd4531ae4d65dbc53196831063e015fc65bb589ecc4603d929eb1f498611f392a8270bf11b5d

diff --git a/sci-libs/nfft/files/nfft-3.5.3-gcc15.patch 
b/sci-libs/nfft/files/nfft-3.5.3-gcc15.patch
new file mode 100644
index 000000000000..66040ad4ac08
--- /dev/null
+++ b/sci-libs/nfft/files/nfft-3.5.3-gcc15.patch
@@ -0,0 +1,43 @@
+https://bugs.gentoo.org/944858
+https://github.com/NFFT/nfft/pull/146
+
+--- a/applications/radon/radon.c.in
++++ b/applications/radon/radon.c.in
+@@ -111,7 +111,7 @@ static int linogram_grid(int T, int S, NFFT_R *x, NFFT_R 
*w)
+ /** computes the NFFT-based discrete Radon transform of f
+  *  on the grid given by gridfcn() with T angles and R offsets
+  */
+-static int Radon_trafo(int (*gridfcn)(), int T, int S, NFFT_R *f, int NN, 
NFFT_R *Rf)
++static int Radon_trafo(int (*gridfcn)(int T, int S, NFFT_R *x, NFFT_R *w), 
int T, int S, NFFT_R *f, int NN, NFFT_R *Rf)
+ {
+   int j, k; /**< index for nodes and freqencies   */
+   NFFT(plan) my_nfft_plan; /**< plan for the nfft-2D             */
+@@ -205,7 +205,7 @@ static int Radon_trafo(int (*gridfcn)(), int T, int S, 
NFFT_R *f, int NN, NFFT_R
+  */
+ int main(int argc, char **argv)
+ {
+-  int (*gridfcn)(); /**< grid generating function        */
++  int (*gridfcn)(int T, int S, NFFT_R *x, NFFT_R *w); /**< grid generating 
function        */
+   int T, S; /**< number of directions/offsets    */
+   FILE *fp;
+   int N; /**< image size                      */
+--- a/applications/radon/inverse_radon.c.in
++++ b/applications/radon/inverse_radon.c.in
+@@ -111,7 +111,7 @@ static int linogram_grid(int T, int S, NFFT_R *x, NFFT_R 
*w)
+  *  on the grid given by gridfcn() with T angles and R offsets
+  *  by a NFFT-based CG-type algorithm
+  */
+-static int inverse_radon_trafo(int (*gridfcn)(), int T, int S, NFFT_R *Rf, 
int NN, NFFT_R *f,
++static int inverse_radon_trafo(int (*gridfcn)(int T, int S, NFFT_R *x, NFFT_R 
*w), int T, int S, NFFT_R *Rf, int NN, NFFT_R *f,
+     int max_i)
+ {
+   int j, k; /**< index for nodes and freqencies   */
+@@ -237,7 +237,7 @@ static int inverse_radon_trafo(int (*gridfcn)(), int T, 
int S, NFFT_R *Rf, int N
+  */
+ int main(int argc, char **argv)
+ {
+-  int (*gridfcn)(); /**< grid generating function        */
++  int (*gridfcn)(int T, int S, NFFT_R *x, NFFT_R *w); /**< grid generating 
function        */
+   int T, S; /**< number of directions/offsets    */
+   FILE *fp;
+   int N; /**< image size                      */

diff --git a/sci-libs/nfft/files/nfft-3.5.3-rtc.patch 
b/sci-libs/nfft/files/nfft-3.5.3-rtc.patch
new file mode 100644
index 000000000000..c1b44e89bd06
--- /dev/null
+++ b/sci-libs/nfft/files/nfft-3.5.3-rtc.patch
@@ -0,0 +1,21 @@
+Remove implicit function declarations incompatible with new GCC.
+
+This is not UNICOS anyway
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -485,14 +485,6 @@ AC_CHECK_DECLS([nanosleep],[],[],[#include <time.h>])
+ AC_CHECK_DECLS([drand48],[],[],[#include <stdlib.h>])
+ AC_CHECK_DECLS([srand48],[],[],[#include <stdlib.h>])
+ 
+-# Cray UNICOS _rtc() (real-time clock) intrinsic
+-AC_MSG_CHECKING([for _rtc intrinsic])
+-rtc_ok=yes
+-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef HAVE_INTRINSICS_H
+-#include <intrinsics.h>
+-#endif]], [[_rtc()]])],[AC_DEFINE(HAVE__RTC,1,[Define if you have the UNICOS 
_rtc() intrinsic.])],[rtc_ok=no])
+-AC_MSG_RESULT($rtc_ok)
+-
+ AC_MSG_CHECKING([whether a cycle counter is available])
+ save_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="$CPPFLAGS -I$srcdir/include"

diff --git a/sci-libs/nfft/nfft-3.5.3.ebuild b/sci-libs/nfft/nfft-3.5.3.ebuild
new file mode 100644
index 000000000000..09111690b637
--- /dev/null
+++ b/sci-libs/nfft/nfft-3.5.3.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="library for nonequispaced discrete Fourier transformations"
+HOMEPAGE="https://www-user.tu-chemnitz.de/~potts/nfft/";
+SRC_URI="https://github.com/NFFT/nfft/releases/download/${PV}/${P}.tar.gz";
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc openmp"
+
+RDEPEND="sci-libs/fftw:3.0=[threads,openmp?]"
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+       "${FILESDIR}/${P}-gcc15.patch"
+       "${FILESDIR}/${P}-rtc.patch"
+)
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       econf \
+               --enable-all \
+               $(use_enable openmp)
+}
+
+src_install() {
+       default
+
+       if ! use doc; then
+               rm -r "${ED}"/usr/share/doc/${P}/html || die
+       fi
+
+       # no static archives
+       find "${ED}" -name '*.la' -delete || die
+}

Reply via email to