git: 489af2327e48 - main - math/kissfft: Add new ports: Mixed-radix Fast Fourier Transform

From: Max Brazhnikov <makc_at_FreeBSD.org>
Date: Mon, 26 Oct 2026 19:26:35 UTC
The branch main has been updated by makc:

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

commit 489af2327e4873b5bf822a022d21c79aba4f7806
Author:     Max Brazhnikov <makc@FreeBSD.org>
AuthorDate: 2026-10-26 19:26:03 +0000
Commit:     Max Brazhnikov <makc@FreeBSD.org>
CommitDate: 2026-10-26 19:26:03 +0000

    math/kissfft: Add new ports: Mixed-radix Fast Fourier Transform
    
    There are many great fft libraries already around. Kiss FFT is not trying to
    be better than any of them. It only attempts to be a reasonably efficient,
    moderately useful FFT that can use fixed or floating data types and can be
    incorporated into someone's C program in a few minutes with trivial licensing.
    
    WWW: https://github.com/mborgerding/kissfft/
---
 math/Makefile                           |  1 +
 math/kissfft/Makefile                   | 28 ++++++++++++++++++++++++++++
 math/kissfft/distinfo                   |  3 +++
 math/kissfft/files/patch-CMakeLists.txt | 29 +++++++++++++++++++++++++++++
 math/kissfft/pkg-descr                  |  7 +++++++
 math/kissfft/pkg-plist                  | 17 +++++++++++++++++
 6 files changed, 85 insertions(+)

diff --git a/math/Makefile b/math/Makefile
index 8280c71fadac..b875f3f77eff 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -445,6 +445,7 @@
     SUBDIR += kfr
     SUBDIR += kig
     SUBDIR += kissat
+    SUBDIR += kissfft
     SUBDIR += kktdirect
     SUBDIR += kmplot
     SUBDIR += labplot
diff --git a/math/kissfft/Makefile b/math/kissfft/Makefile
new file mode 100644
index 000000000000..11ddcc32cbb2
--- /dev/null
+++ b/math/kissfft/Makefile
@@ -0,0 +1,28 @@
+PORTNAME=	kissfft
+PORTVERSION=	131.2.0
+CATEGORIES=	math
+
+MAINTAINER=	kde@FreeBSD.org
+COMMENT=	Mixed-radix Fast Fourier Transform
+WWW=		https://github.com/mborgerding/kissfft/
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/COPYING
+
+USES=		cmake
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	mborgerding
+
+USE_LDCONFIG=	yes
+
+CMAKE_OFF=	KISSFFT_TEST
+
+OPTIONS_DEFINE=		TOOLS
+OPTIONS_SUB=		yes
+
+TOOLS_USES=		pkgconfig
+TOOLS_LIB_DEPENDS=	libpng.so:graphics/png
+TOOLS_CMAKE_BOOL=	KISSFFT_TOOLS
+
+.include <bsd.port.mk>
diff --git a/math/kissfft/distinfo b/math/kissfft/distinfo
new file mode 100644
index 000000000000..cecdedbe89f9
--- /dev/null
+++ b/math/kissfft/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1793012445
+SHA256 (mborgerding-kissfft-131.2.0_GH0.tar.gz) = 205a8f6a448ef12b091f8ac6a514b5091bb5f6b0b543431ed75f673116cf5cbf
+SIZE (mborgerding-kissfft-131.2.0_GH0.tar.gz) = 52477
diff --git a/math/kissfft/files/patch-CMakeLists.txt b/math/kissfft/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..791178ec76fd
--- /dev/null
+++ b/math/kissfft/files/patch-CMakeLists.txt
@@ -0,0 +1,29 @@
+--- CMakeLists.txt.orig	2025-09-12 05:55:11 UTC
++++ CMakeLists.txt
+@@ -105,7 +105,7 @@ endif()
+ # Add GNUInstallDirs for GNU infrastructure before target)include_directories
+ #
+ 
+-if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" AND NOT CMAKE_CROSSCOMPILING)
++if(UNIX AND NOT CMAKE_CROSSCOMPILING)
+     include(GNUInstallDirs)
+ endif()
+ 
+@@ -242,7 +242,7 @@ add_library(kissfft::kissfft-${KISSFFT_DATATYPE} ALIAS
+ # Build with libm (-lm) on Linux and kFreeBSD
+ #
+ 
+-if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" AND NOT CMAKE_CROSSCOMPILING)
++if(UNIX AND NOT CMAKE_CROSSCOMPILING)
+     target_link_libraries(kissfft PRIVATE m)
+ endif()
+ 
+@@ -258,7 +258,7 @@ function(add_kissfft_executable NAME)
+     # Build with libm (-lm) on Linux and kFreeBSD
+     #
+ 
+-    if(CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU)$" AND NOT CMAKE_CROSSCOMPILING)
++    if(UNIX AND NOT CMAKE_CROSSCOMPILING)
+         target_link_libraries(${NAME} PRIVATE m)
+     endif()
+ 
diff --git a/math/kissfft/pkg-descr b/math/kissfft/pkg-descr
new file mode 100644
index 000000000000..bed418ab4c57
--- /dev/null
+++ b/math/kissfft/pkg-descr
@@ -0,0 +1,7 @@
+KISS FFT - A mixed-radix Fast Fourier Transform based up on the principle
+"Keep It Simple, Stupid."
+
+There are many great fft libraries already around. Kiss FFT is not trying to
+be better than any of them. It only attempts to be a reasonably efficient,
+moderately useful FFT that can use fixed or floating data types and can be
+incorporated into someone's C program in a few minutes with trivial licensing.
diff --git a/math/kissfft/pkg-plist b/math/kissfft/pkg-plist
new file mode 100644
index 000000000000..a374eead6d2b
--- /dev/null
+++ b/math/kissfft/pkg-plist
@@ -0,0 +1,17 @@
+%%TOOLS%%bin/fastconv-float
+%%TOOLS%%bin/fastconvr-float
+%%TOOLS%%bin/fft-float
+%%TOOLS%%bin/psdpng-float
+include/kissfft/kiss_fft.h
+include/kissfft/kiss_fftnd.h
+include/kissfft/kiss_fftndr.h
+include/kissfft/kiss_fftr.h
+include/kissfft/kissfft.hh
+lib/cmake/kissfft/kissfft-config-version.cmake
+lib/cmake/kissfft/kissfft-config.cmake
+lib/cmake/kissfft/kissfft-float-shared-targets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/kissfft/kissfft-float-shared-targets.cmake
+lib/libkissfft-float.so
+lib/libkissfft-float.so.131
+lib/libkissfft-float.so.131.1.0
+libdata/pkgconfig/kissfft-float.pc