git: 58a36e23c617 - main - multimedia/obs-waveform: New port: OBS Studio Plugin: Audio spectral analyser

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 29 Dec 2022 22:15:49 UTC
The branch main has been updated by yuri:

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

commit 58a36e23c61789053291af4b29412abdf40a345b
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-12-29 19:08:35 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-12-29 22:15:36 +0000

    multimedia/obs-waveform: New port: OBS Studio Plugin: Audio spectral analyser
---
 multimedia/Makefile                                |  1 +
 multimedia/obs-waveform/Makefile                   | 33 ++++++++++++++++++++++
 multimedia/obs-waveform/distinfo                   |  5 ++++
 multimedia/obs-waveform/files/patch-CMakeLists.txt | 28 ++++++++++++++++++
 multimedia/obs-waveform/pkg-descr                  |  2 ++
 5 files changed, 69 insertions(+)

diff --git a/multimedia/Makefile b/multimedia/Makefile
index 46bbc46bccff..a2b1b1ef17cc 100644
--- a/multimedia/Makefile
+++ b/multimedia/Makefile
@@ -268,6 +268,7 @@
     SUBDIR += obs-studio
     SUBDIR += obs-transition-matrix
     SUBDIR += obs-v4l2sink
+    SUBDIR += obs-waveform
     SUBDIR += obs-websocket
     SUBDIR += oggvideotools
     SUBDIR += ogmrip
diff --git a/multimedia/obs-waveform/Makefile b/multimedia/obs-waveform/Makefile
new file mode 100644
index 000000000000..653da8acd5e7
--- /dev/null
+++ b/multimedia/obs-waveform/Makefile
@@ -0,0 +1,33 @@
+PORTNAME=	obs-waveform
+DISTVERSIONPREFIX=	v
+DISTVERSION=	1.5.0
+CATEGORIES=	multimedia
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	OBS Studio Plugin: Audio spectral analyser
+WWW=		https://obsproject.com/forum/resources/waveform.1423/
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+BUILD_DEPENDS=	cpu_features>0:devel/cpu_features
+LIB_DEPENDS=	libcpu_features.so:devel/cpu_features \
+		libfftw3f.so:math/fftw3-float \
+		libobs.so:multimedia/obs-studio
+
+USES=		cmake localbase:ldflags
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	phandasm
+GH_PROJECT=	waveform
+
+CMAKE_ON=	PACKAGED_INSTALL
+
+LDFLAGS+=	-lcpu_features
+
+PLIST_FILES=	lib/obs-plugins/waveform.so \
+		share/obs/obs-plugins/waveform/gradient.effect \
+		share/obs/obs-plugins/waveform/locale/en-US.ini \
+		share/obs/obs-plugins/waveform/locale/zh-CN.ini
+
+.include <bsd.port.mk>
diff --git a/multimedia/obs-waveform/distinfo b/multimedia/obs-waveform/distinfo
new file mode 100644
index 000000000000..7302faa8db50
--- /dev/null
+++ b/multimedia/obs-waveform/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1672306543
+SHA256 (phandasm-waveform-v1.5.0_GH0.tar.gz) = fca6645f3cb3e25445132d6708f4c57f52994b61214368605351868cb8788f5a
+SIZE (phandasm-waveform-v1.5.0_GH0.tar.gz) = 34829631
+SHA256 (google-cpu_features-a8397ba_GH0.tar.gz) = 6bbde4a95981903becf6f185f9ac8d8f5aca579f56572e1677e00b564805c9f0
+SIZE (google-cpu_features-a8397ba_GH0.tar.gz) = 63257
diff --git a/multimedia/obs-waveform/files/patch-CMakeLists.txt b/multimedia/obs-waveform/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..0882d248f214
--- /dev/null
+++ b/multimedia/obs-waveform/files/patch-CMakeLists.txt
@@ -0,0 +1,28 @@
+--- CMakeLists.txt.orig	2022-09-11 15:31:21 UTC
++++ CMakeLists.txt
+@@ -165,10 +165,12 @@ if(NOT DISABLE_X86_SIMD)
+         set_source_files_properties("src/filter_fma3.cpp" PROPERTIES COMPILE_FLAGS "-mavx -mfma")
+     endif()
+ 
+-    add_subdirectory(deps/cpu_features EXCLUDE_FROM_ALL)
+-    if(NOT MSVC AND NOT BUILD_SHARED_LIBS) # Clang complains
+-        target_compile_options(cpu_features PRIVATE "-fPIC")
+-    endif()
++    #add_subdirectory(deps/cpu_features EXCLUDE_FROM_ALL)
++    #if(NOT MSVC AND NOT BUILD_SHARED_LIBS) # Clang complains
++    #    target_compile_options(cpu_features PRIVATE "-fPIC")
++    #endif()
++    find_package(CpuFeatures REQUIRED)
++    include_directories(${CMAKE_INSTALL_PREFIX}/include/cpu_features)
+ endif()
+ 
+ if(MAKE_BUNDLE)
+@@ -191,7 +193,7 @@ set_target_properties(waveform PROPERTIES PREFIX "")
+ target_include_directories(waveform PRIVATE ${FFTW_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}/include)
+ target_link_libraries(waveform PRIVATE OBS::libobs ${FFTW_LIBRARIES})
+ if(NOT DISABLE_X86_SIMD)
+-    target_link_libraries(waveform PRIVATE cpu_features)
++    add_dependencies(waveform CpuFeatures::cpu_features)
+ endif()
+ target_compile_definitions(waveform PRIVATE _USE_MATH_DEFINES)
+ if(MSVC)
diff --git a/multimedia/obs-waveform/pkg-descr b/multimedia/obs-waveform/pkg-descr
new file mode 100644
index 000000000000..3ce3ebf5619f
--- /dev/null
+++ b/multimedia/obs-waveform/pkg-descr
@@ -0,0 +1,2 @@
+Waveform is an audio spectral analysis plugin for OBS Studio.
+It is based on FFTW and optimized for AVX2/FMA3.