git: cb177d8463fe - main - science/afni: fix build on non-x86

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Fri, 22 Oct 2021 12:09:09 UTC
The branch main has been updated by pkubaj:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cb177d8463fe78539116f2594a3d9a1c7da6b2d0

commit cb177d8463fe78539116f2594a3d9a1c7da6b2d0
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2021-10-22 11:42:20 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2021-10-22 11:42:20 +0000

    science/afni: fix build on non-x86
    
    fpsetprec() is only on amd64 and i386 and requires x87 FPU. It's possible to build without x87, just how it's done on Linux.
---
 science/afni/Makefile                            |  2 --
 science/afni/files/patch-SUMA_gts_src_rounding.h | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/science/afni/Makefile b/science/afni/Makefile
index 0c6910c73fd2..5351e4d3a0b4 100644
--- a/science/afni/Makefile
+++ b/science/afni/Makefile
@@ -8,8 +8,6 @@ COMMENT=	Advanced Functional Neuro Imaging
 
 LICENSE=	GPLv2
 
-BROKEN_powerpc64=	fails to compile: ./predicates_init.c:46: error: implicit declaration of function 'fpsetprec'
-
 CRAN_DEPENDS=	R-cran-lme4>0:math/R-cran-lme4 \
 		R-cran-snow>0:science/R-cran-snow \
 		R-cran-psych>0:math/R-cran-psych
diff --git a/science/afni/files/patch-SUMA_gts_src_rounding.h b/science/afni/files/patch-SUMA_gts_src_rounding.h
new file mode 100644
index 000000000000..e2730a9fd6c7
--- /dev/null
+++ b/science/afni/files/patch-SUMA_gts_src_rounding.h
@@ -0,0 +1,20 @@
+--- SUMA/gts/src/rounding.h.orig	2021-10-21 01:05:53 UTC
++++ SUMA/gts/src/rounding.h
+@@ -34,9 +34,14 @@
+ #  endif /* not FPU_EXTENDED */
+ #else /* not HAVE_FPU_CONTROL_H */
+ #  ifdef __FreeBSD__
+-#    include <floatingpoint.h>
+-#    define FPU_ROUND_DOUBLE  (fpsetprec(FP_PD))
+-#    define FPU_RESTORE       (fpsetprec(FP_PE))
++#    if defined(__amd64__) || defined(__i386__)
++#      include <floatingpoint.h>
++#      define FPU_ROUND_DOUBLE  (fpsetprec(FP_PD))
++#      define FPU_RESTORE       (fpsetprec(FP_PE))
++#    else /* not amd64 or i386 */
++#      define FPU_ROUND_DOUBLE
++#      define FPU_RESTORE
++#    endif
+ #  else /* not __FreeBSD__ */
+ #    ifdef WIN32
+ #      ifdef _MSC_VER