Skip to content

Commit

Permalink
audio/noise-suppression-for-voice-lv2: Update 0.91-2 → 1.03
Browse files Browse the repository at this point in the history
  • Loading branch information
yurivict committed Jun 9, 2023
1 parent 26db27d commit 6f4c248
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 13 deletions.
33 changes: 23 additions & 10 deletions audio/noise-suppression-for-voice-lv2/Makefile
@@ -1,8 +1,6 @@
PORTNAME= noise-suppression-for-voice
DISTVERSIONPREFIX= v
DISTVERSION= 0.91-2
PORTREVISION= 1
DISTVERSIONSUFFIX= -g6466b34
DISTVERSION= 1.03
CATEGORIES= audio
PKGNAMESUFFIX= -lv2

Expand All @@ -13,18 +11,33 @@ WWW= https://github.com/werman/noise-suppression-for-voice
LICENSE= GPLv2
LICENSE_FILE= ${WRKSRC}/LICENSE

BUILD_DEPENDS= lv2>0:audio/lv2
BUILD_DEPENDS= juce>0:devel/juce \
lv2>0:audio/lv2
LIB_DEPENDS= libfreetype.so:print/freetype2

USES= cmake compiler:c11
USES= cmake compiler:c11 pkgconfig
USE_GITHUB= yes
GH_ACCOUNT= werman

CMAKE_OFF= BUILD_VST_PLUGIN # https://github.com/werman/noise-suppression-for-voice/issues/65

PLIST_FILES= lib/ladspa/librnnoise_ladspa.so \
lib/lv2/rnnoise.lv2/manifest.ttl \
lib/lv2/rnnoise.lv2/rnnoise.ttl \
lib/lv2/rnnoise.lv2/rnnoise_lv2.so
CXXFLAGS+= -DJUCE_CUSTOM_VST3_SDK=1

post-extract: # remove bundled JUCE
@${RM} -rf ${WRKSRC}/external/JUCE

post-install: # move plugins to a proper place: workaround for https://github.com/juce-framework/JUCE/issues/1237
# LV2 plugin
@${MV} ${STAGEDIR}${WRKDIR}/.lv2 ${STAGEDIR}${PREFIX}/lib/lv2
# VST3 plugin
@${MKDIR} ${STAGEDIR}${PREFIX}/lib/vst3
@${MV} `${FIND} ${STAGEDIR} -name rnnoise.vst3` ${STAGEDIR}${PREFIX}/lib/vst3
# 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 \
lib/vst3/rnnoise.vst3/Contents/x86_64-linux/rnnoise.so

# the LADSPA plugin can be used directly from PulseAudio's config file

Expand Down
6 changes: 3 additions & 3 deletions 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 = 1686287620
SHA256 (werman-noise-suppression-for-voice-v1.03_GH0.tar.gz) = 8c85cae3ebbb3a18facc38930a3b67ca90e3ad609526a0018c71690de35baf04
SIZE (werman-noise-suppression-for-voice-v1.03_GH0.tar.gz) = 19486457
20 changes: 20 additions & 0 deletions audio/noise-suppression-for-voice-lv2/files/patch-CMakeLists.txt
@@ -0,0 +1,20 @@
--- CMakeLists.txt.orig 2022-07-28 08:24:44 UTC
+++ CMakeLists.txt
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.6)
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")
@@ -35,6 +35,7 @@ if (BUILD_VST_PLUGIN OR BUILD_VST3_PLUGIN OR BUILD_LV2
# 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).
# So we have to manually install plugins.
- add_subdirectory(external/JUCE EXCLUDE_FROM_ALL)
+ #add_subdirectory(external/JUCE EXCLUDE_FROM_ALL)
+ find_package(JUCE REQUIRED)
add_subdirectory(src/juce_plugin)
endif ()
@@ -0,0 +1,28 @@
--- src/juce_plugin/CMakeLists.txt.orig 2022-07-28 08:24:44 UTC
+++ src/juce_plugin/CMakeLists.txt
@@ -87,14 +89,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 ()
@@ -135,4 +137,4 @@ endif ()

if (FORMATS)
compile_plugins("${FORMATS}" "" 1)
-endif ()
\ No newline at end of file
+endif ()
10 changes: 10 additions & 0 deletions audio/noise-suppression-for-voice-lv2/pkg-plist
@@ -0,0 +1,10 @@
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
lib/vst3/rnnoise.vst3/Contents/x86_64-linux/rnnoise.so

0 comments on commit 6f4c248

Please sign in to comment.