aboutsummaryrefslogtreecommitdiff
path: root/audio/noise-suppression-for-voice-lv2
diff options
context:
space:
mode:
Diffstat (limited to 'audio/noise-suppression-for-voice-lv2')
-rw-r--r--audio/noise-suppression-for-voice-lv2/Makefile63
-rw-r--r--audio/noise-suppression-for-voice-lv2/distinfo6
-rw-r--r--audio/noise-suppression-for-voice-lv2/files/patch-CMakeLists.txt21
-rw-r--r--audio/noise-suppression-for-voice-lv2/files/patch-src_common_CMakeLists.txt15
-rw-r--r--audio/noise-suppression-for-voice-lv2/files/patch-src_juce__plugin_CMakeLists.txt21
-rw-r--r--audio/noise-suppression-for-voice-lv2/pkg-descr2
-rw-r--r--audio/noise-suppression-for-voice-lv2/pkg-plist10
7 files changed, 124 insertions, 14 deletions
diff --git a/audio/noise-suppression-for-voice-lv2/Makefile b/audio/noise-suppression-for-voice-lv2/Makefile
index 1f45ba4de332..0a5d693b6da5 100644
--- a/audio/noise-suppression-for-voice-lv2/Makefile
+++ b/audio/noise-suppression-for-voice-lv2/Makefile
@@ -1,26 +1,71 @@
PORTNAME= noise-suppression-for-voice
DISTVERSIONPREFIX= v
-DISTVERSION= 0.91-2
-DISTVERSIONSUFFIX= -g6466b34
+DISTVERSION= 1.10
CATEGORIES= audio
PKGNAMESUFFIX= -lv2
MAINTAINER= yuri@FreeBSD.org
COMMENT= Real-time noise suppression plugin
+WWW= https://github.com/werman/noise-suppression-for-voice
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE
-BUILD_DEPENDS= lv2>0:audio/lv2
+BROKEN_armv7= link fails: ld: error: undefined symbol: __atomic_store and ld: error: undefined symbol: __atomic_load
-USES= cmake compiler:c11
+BUILD_DEPENDS= juce>0:devel/juce \
+ lv2>0:audio/lv2
+LIB_DEPENDS= libfreetype.so:print/freetype2 \
+ libpng16.so:graphics/png
+
+USES= cmake compiler:c11 localbase:ldflags pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= werman
-CMAKE_OFF= BUILD_VST_PLUGIN BUILD_LADSPA_PLUGIN # https://github.com/werman/noise-suppression-for-voice/issues/65
+# Remove bundled library
+EXTRACT_AFTER_ARGS= --exclude ${GH_PROJECT_DEFAULT}-${GH_TAGNAME_EXTRACT}/external/JUCE \
+ --no-same-owner --no-same-permissions
+
+CMAKE_ON= USE_SYSTEM_JUCE
+CMAKE_OFF= BUILD_TESTS
+CMAKE_OFF+= BUILD_VST_PLUGIN # https://github.com/werman/noise-suppression-for-voice/issues/65
+CXXFLAGS+= -DJUCE_CUSTOM_VST3_SDK=1 -DJUCE_INCLUDE_PNGLIB_CODE=0
+LDFLAGS+= -lpng16
+
+PLIST_SUB= XARCH=${ARCH:S/amd64/x86_64/}
+
+OPTIONS_DEFINE= LADSPA VST3
+OPTIONS_DEFAULT= LADSPA #VST3
+OPTIONS_SUB= yes
+
+LADSPA_CMAKE_BOOL= BUILD_LADSPA_PLUGIN
+
+VST3_CMAKE_BOOL= BUILD_VST3_PLUGIN
+VST3_BROKEN= fails to build with juce-7.0.6, see https://github.com/werman/noise-suppression-for-voice/issues/177
+
+.include <bsd.port.pre.mk>
+
+.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 180
+# Work around https://github.com/llvm/llvm-project/issues/88592
+CXXFLAGS+= -fclang-abi-compat=17
+.endif
+
+post-install: # move plugins to a proper place: workaround for https://github.com/juce-framework/JUCE/issues/1237 and strip binaries
+ @${MV} ${STAGEDIR}${WRKDIR}/.lv2 ${STAGEDIR}${PREFIX}/lib/lv2
+ # remove empty directories
+ @${FIND} ${STAGEDIR} -type d -empty -delete
+ # strip binaries
+ @cd ${STAGEDIR}${PREFIX} && ${STRIP_CMD} \
+ lib/lv2/rnnoise_mono.lv2/librnnoise_mono.so \
+ lib/lv2/rnnoise_stereo.lv2/librnnoise_stereo.so
+
+post-install-VST3-on:
+ @${MKDIR} ${STAGEDIR}${PREFIX}/lib/vst3
+ @${MV} `${FIND} ${STAGEDIR} -name rnnoise.vst3` ${STAGEDIR}${PREFIX}/lib/vst3
+ # strip binaries
+ @cd ${STAGEDIR}${PREFIX} && ${STRIP_CMD} \
+ lib/vst3/rnnoise.vst3/Contents/*/rnnoise.so
-PLIST_FILES= lib/lv2/rnnoise.lv2/manifest.ttl \
- lib/lv2/rnnoise.lv2/rnnoise.ttl \
- lib/lv2/rnnoise.lv2/rnnoise_lv2.so
+# the LADSPA plugin can be used directly from PulseAudio's config file
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/audio/noise-suppression-for-voice-lv2/distinfo b/audio/noise-suppression-for-voice-lv2/distinfo
index df8929f6d5f0..dedd798e7259 100644
--- a/audio/noise-suppression-for-voice-lv2/distinfo
+++ b/audio/noise-suppression-for-voice-lv2/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1617737546
-SHA256 (werman-noise-suppression-for-voice-v0.91-2-g6466b34_GH0.tar.gz) = d9665a60daef47ed052accae0c62aa3b822d7b04a2e3fab2ac718675a10c3906
-SIZE (werman-noise-suppression-for-voice-v0.91-2-g6466b34_GH0.tar.gz) = 207626
+TIMESTAMP = 1716182553
+SHA256 (werman-noise-suppression-for-voice-v1.10_GH0.tar.gz) = 6e0c11aeb8392891750b0243c2ba695dab07654bf3f4e01adbed927b36cc690a
+SIZE (werman-noise-suppression-for-voice-v1.10_GH0.tar.gz) = 37315188
diff --git a/audio/noise-suppression-for-voice-lv2/files/patch-CMakeLists.txt b/audio/noise-suppression-for-voice-lv2/files/patch-CMakeLists.txt
new file mode 100644
index 000000000000..a033a5f9a502
--- /dev/null
+++ b/audio/noise-suppression-for-voice-lv2/files/patch-CMakeLists.txt
@@ -0,0 +1,21 @@
+--- CMakeLists.txt.orig 2024-05-18 14:43:53 UTC
++++ CMakeLists.txt
+@@ -4,7 +4,7 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
+ include(GNUInstallDirs)
+
+ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+-set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
+ set(CMAKE_BINARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
+ set(MINGW_ADDITIONAL_LINKING_FLAGS "-static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic")
+@@ -36,7 +36,8 @@ if (BUILD_VST_PLUGIN OR BUILD_VST3_PLUGIN OR BUILD_LV2
+
+ if (BUILD_VST_PLUGIN OR BUILD_VST3_PLUGIN OR BUILD_LV2_PLUGIN OR BUILD_AU_PLUGIN OR BUILD_AUV3_PLUGIN)
+ if (USE_SYSTEM_JUCE)
+- find_package(JUCE)
++ find_package(JUCE REQUIRED)
++ message("-- Found JUCE Version=${JUCE_VERSION}")
+ else ()
+ # For install JUCE copies all its headers, no one needs them. It also doesn't install actual libraries.
+ # On the other hand JUCE could install libraries during build process (see COPY_PLUGIN_AFTER_BUILD option).
diff --git a/audio/noise-suppression-for-voice-lv2/files/patch-src_common_CMakeLists.txt b/audio/noise-suppression-for-voice-lv2/files/patch-src_common_CMakeLists.txt
new file mode 100644
index 000000000000..79042b6a7a1a
--- /dev/null
+++ b/audio/noise-suppression-for-voice-lv2/files/patch-src_common_CMakeLists.txt
@@ -0,0 +1,15 @@
+- fix build on platforms where sanitizer isn't available: armv7, aarch64, ...
+
+--- src/common/CMakeLists.txt.orig 2023-08-17 05:30:38 UTC
++++ src/common/CMakeLists.txt
+@@ -33,8 +33,8 @@ if (BUILD_TESTS)
+ $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/external/catch2>
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
+ target_link_libraries(common_plugin_tests PRIVATE ${LIBRARIES})
+- target_compile_options(common_plugin_tests PRIVATE -fsanitize=undefined)
+- target_link_options(common_plugin_tests PRIVATE -fsanitize=undefined)
++ #target_compile_options(common_plugin_tests PRIVATE -fsanitize=undefined)
++ #target_link_options(common_plugin_tests PRIVATE -fsanitize=undefined)
+
+ include(CTest)
+ include(Catch)
diff --git a/audio/noise-suppression-for-voice-lv2/files/patch-src_juce__plugin_CMakeLists.txt b/audio/noise-suppression-for-voice-lv2/files/patch-src_juce__plugin_CMakeLists.txt
new file mode 100644
index 000000000000..c7a1ecb8634b
--- /dev/null
+++ b/audio/noise-suppression-for-voice-lv2/files/patch-src_juce__plugin_CMakeLists.txt
@@ -0,0 +1,21 @@
+--- src/juce_plugin/CMakeLists.txt.orig 2024-05-18 14:43:53 UTC
++++ src/juce_plugin/CMakeLists.txt
+@@ -88,14 +88,14 @@ function(compile_plugins formats suffix default_channe
+ # JUCE has a terrible idea of installing plugin during the BUILD process instead of during the INSTALL,
+ # also JUCE wants to install its headers which we don't want at all.
+ # So it's easier to handle it ourselves.
+- if (UNIX AND NOT APPLE)
++ if (FALSE AND UNIX AND NOT APPLE)
+ foreach (format IN LISTS formats)
+ if (format STREQUAL "LV2")
+- install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/rnnoise${suffix}.lv2 DESTINATION ${CMAKE_INSTALL_LIBDIR}/lv2)
++ install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../src/juce_plugin/rnnoise_juce_plugin${suffix}_artefacts/Release/LV2/rnnoise${suffix}.lv2 DESTINATION lib/lv2)
+ elseif (format STREQUAL "VST")
+- install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vst/ DESTINATION ${CMAKE_INSTALL_LIBDIR}/lxvst)
++ install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/vst/ DESTINATION lib/lxvst)
+ elseif (format STREQUAL "VST3")
+- install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/rnnoise.vst3 DESTINATION ${CMAKE_INSTALL_LIBDIR}/vst3)
++ install(DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/../src/juce_plugin/rnnoise_juce_plugin_artefacts/Release/VST3/rnnoise.vst3 DESTINATION lib/vst3)
+ endif ()
+ endforeach ()
+ endif ()
diff --git a/audio/noise-suppression-for-voice-lv2/pkg-descr b/audio/noise-suppression-for-voice-lv2/pkg-descr
index ada988621a29..4a2bbf12804b 100644
--- a/audio/noise-suppression-for-voice-lv2/pkg-descr
+++ b/audio/noise-suppression-for-voice-lv2/pkg-descr
@@ -1,4 +1,2 @@
The plugin is meant to suppress a wide range of noise origins (from original
paper): computer fans, office, crowd, airplane, car, train, construction.
-
-WWW: https://github.com/werman/noise-suppression-for-voice
diff --git a/audio/noise-suppression-for-voice-lv2/pkg-plist b/audio/noise-suppression-for-voice-lv2/pkg-plist
new file mode 100644
index 000000000000..a9904af4cd15
--- /dev/null
+++ b/audio/noise-suppression-for-voice-lv2/pkg-plist
@@ -0,0 +1,10 @@
+%%LADSPA%%lib/ladspa/librnnoise_ladspa.so
+lib/lv2/rnnoise_mono.lv2/dsp.ttl
+lib/lv2/rnnoise_mono.lv2/librnnoise_mono.so
+lib/lv2/rnnoise_mono.lv2/manifest.ttl
+lib/lv2/rnnoise_mono.lv2/ui.ttl
+lib/lv2/rnnoise_stereo.lv2/dsp.ttl
+lib/lv2/rnnoise_stereo.lv2/librnnoise_stereo.so
+lib/lv2/rnnoise_stereo.lv2/manifest.ttl
+lib/lv2/rnnoise_stereo.lv2/ui.ttl
+%%VST3%%lib/vst3/rnnoise.vst3/Contents/%%XARCH%%-linux/rnnoise.so