git: 15286a76707b - main - math/ssht: New port: Fast and exact spin spherical harmonic transforms

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Sat, 06 Aug 2022 19:56:57 UTC
The branch main has been updated by yuri:

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

commit 15286a76707bc8686bd3beb9c5be0f5d181dee4e
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-08-06 19:36:39 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-08-06 19:56:54 +0000

    math/ssht: New port: Fast and exact spin spherical harmonic transforms
---
 math/Makefile                              |  1 +
 math/ssht/Makefile                         | 22 ++++++++++++++++++++++
 math/ssht/distinfo                         |  3 +++
 math/ssht/files/patch-CMakeLists.txt       | 11 +++++++++++
 math/ssht/files/patch-src_c_CMakeLists.txt |  8 ++++++++
 math/ssht/pkg-descr                        | 13 +++++++++++++
 math/ssht/pkg-plist                        | 13 +++++++++++++
 7 files changed, 71 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index 39f6fafd12bd..e21357cce66b 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -1058,6 +1058,7 @@
     SUBDIR += spooles-mpich
     SUBDIR += spot
     SUBDIR += sprng
+    SUBDIR += ssht
     SUBDIR += stan
     SUBDIR += stanmath
     SUBDIR += stp
diff --git a/math/ssht/Makefile b/math/ssht/Makefile
new file mode 100644
index 000000000000..2e3a00f94235
--- /dev/null
+++ b/math/ssht/Makefile
@@ -0,0 +1,22 @@
+PORTNAME=	ssht
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.5.1
+CATEGORIES=	math
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	Fast and exact spin spherical harmonic transforms
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	fftw3>0:math/fftw3 # see https://github.com/astro-informatics/ssht/issues/6
+
+USES=		cmake:testing pkgconfig # tests clone cmocka, see https://github.com/astro-informatics/ssht/issues/63
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	astro-informatics
+
+CMAKE_ON=	BUILD_SHARED_LIBS
+CMAKE_OFF=	BUILD_TESTING
+
+.include <bsd.port.mk>
diff --git a/math/ssht/distinfo b/math/ssht/distinfo
new file mode 100644
index 000000000000..15f2ffc62a81
--- /dev/null
+++ b/math/ssht/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1659813524
+SHA256 (astro-informatics-ssht-v1.5.1_GH0.tar.gz) = f0b6fb6a1de40354fcf4eafe09b953c96a72ba9c533a42e290802e93cd14170c
+SIZE (astro-informatics-ssht-v1.5.1_GH0.tar.gz) = 2332554
diff --git a/math/ssht/files/patch-CMakeLists.txt b/math/ssht/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..79922d5319e5
--- /dev/null
+++ b/math/ssht/files/patch-CMakeLists.txt
@@ -0,0 +1,11 @@
+--- CMakeLists.txt.orig	2022-08-06 19:21:48 UTC
++++ CMakeLists.txt
+@@ -42,7 +42,7 @@ elseif(NOT CONAN_EXPORTED)
+ endif()
+ 
+ # only run documentation if this is not a sub-project
+-if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
++if(FREEBSD_BUILD_DOCS AND CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
+     find_package(Doxygen)
+     if(DOXYGEN_FOUND)
+         set(DOXYGEN_OPTIMIZE_OUTPUT_FOR_C "YES")
diff --git a/math/ssht/files/patch-src_c_CMakeLists.txt b/math/ssht/files/patch-src_c_CMakeLists.txt
new file mode 100644
index 000000000000..443085f6e1be
--- /dev/null
+++ b/math/ssht/files/patch-src_c_CMakeLists.txt
@@ -0,0 +1,8 @@
+--- src/c/CMakeLists.txt.orig	2022-08-06 19:20:16 UTC
++++ src/c/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-add_library(ssht STATIC ssht_adjoint.c ssht_core.c ssht_dl.c ssht_sampling.c)
++add_library(ssht ssht_adjoint.c ssht_core.c ssht_dl.c ssht_sampling.c)
+ target_link_libraries(ssht PUBLIC FFTW3::FFTW3 ${MATH_LIBRARY})
+ target_include_directories(
+     ssht
diff --git a/math/ssht/pkg-descr b/math/ssht/pkg-descr
new file mode 100644
index 000000000000..ef65a84bec82
--- /dev/null
+++ b/math/ssht/pkg-descr
@@ -0,0 +1,13 @@
+The SSHT code provides functionality to perform fast and exact spin spherical
+harmonic transforms based on the sampling theorem on the sphere derived in
+McEwen & Wiaux (2011).
+
+SSHT can also interface with ducc0 and use it as a backend for the forward,
+inverse and inverse adjoint transforms.
+
+In some applications adjoint forward and inverse spherical harmonic transforms
+are also required (for example, when solving convex optimisation problems).
+Functionality is also provided to perform fast and exact adjoint transforms,
+based on the fast algorithms derived in McEwen et al. (2013).
+
+WWW: https://astro-informatics.github.io/ssht/
diff --git a/math/ssht/pkg-plist b/math/ssht/pkg-plist
new file mode 100644
index 000000000000..7f160493e9a3
--- /dev/null
+++ b/math/ssht/pkg-plist
@@ -0,0 +1,13 @@
+include/ssht/ssht.h
+include/ssht/ssht_adjoint.h
+include/ssht/ssht_core.h
+include/ssht/ssht_dl.h
+include/ssht/ssht_error.h
+include/ssht/ssht_sampling.h
+include/ssht/ssht_types.h
+include/ssht/ssht_version.h
+lib/cmake/ssht/sshtConfig.cmake
+lib/cmake/ssht/sshtConfigVersion.cmake
+lib/cmake/ssht/sshtTargets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/ssht/sshtTargets.cmake
+lib/libssht.so