summaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authornia <nia@pkgsrc.org>2019-10-05 17:39:38 +0000
committernia <nia@pkgsrc.org>2019-10-05 17:39:38 +0000
commit528c5bd22d874da2d88eb1dfadffe495998b29ac (patch)
tree64cafc370f171ae09f48babc25192db74ee0079b /audio
parent6e153a4d38b7eeab7a6f9a18fc3c0a072ff12dd9 (diff)
downloadpkgsrc-528c5bd22d874da2d88eb1dfadffe495998b29ac.tar.gz
ladspa: Update to 1.15
Version 1.14 - 3 Jan 2019 Rename Makefile. Modernise C++ #include style. Make some globals static. Use mkdir -p rather than mkdirhier during build. Use GCC export map to ensure only the ladspa_descriptor() exported. Put libraries at the end of link instructions. Package with version number in archive and directory names. Tweaks to documentation processing. Fix bug in LADSPA plugin search which did not handle shared libraries that are not plugins correctly. Introduce a default LADSPA plugin search path. Version 1.15 - 6 Jan 2019 Perform macro string expansion in C code rather than in Makefile for better portability. Modernise init()/fini() style in GNU C plugin builds (not C++), tweak link line to correspond.
Diffstat (limited to 'audio')
-rw-r--r--audio/ladspa/Makefile34
-rw-r--r--audio/ladspa/PLIST14
-rw-r--r--audio/ladspa/distinfo19
-rw-r--r--audio/ladspa/patches/patch-aa172
-rw-r--r--audio/ladspa/patches/patch-ac29
-rw-r--r--audio/ladspa/patches/patch-plugins_amp.c26
-rw-r--r--audio/ladspa/patches/patch-plugins_delay.c26
-rw-r--r--audio/ladspa/patches/patch-plugins_filter.c26
-rw-r--r--audio/ladspa/patches/patch-plugins_noise.c26
-rw-r--r--audio/ladspa/patches/patch-src_Makefile161
-rw-r--r--audio/ladspa/patches/patch-src_applyplugin.c (renamed from audio/ladspa/patches/patch-ab)8
11 files changed, 204 insertions, 337 deletions
diff --git a/audio/ladspa/Makefile b/audio/ladspa/Makefile
index ecf638c2184..2f28f2e9f43 100644
--- a/audio/ladspa/Makefile
+++ b/audio/ladspa/Makefile
@@ -1,33 +1,37 @@
-# $NetBSD: Makefile,v 1.15 2019/07/15 22:58:50 nia Exp $
+# $NetBSD: Makefile,v 1.16 2019/10/05 17:39:38 nia Exp $
-DISTNAME= ladspa_sdk_1.13
+DISTNAME= ladspa_sdk_1.15
PKGNAME= ${DISTNAME:S/_sdk_/-/}
-PKGREVISION= 2
CATEGORIES= audio
-MASTER_SITES= http://www.ladspa.org/download/
+MASTER_SITES= https://www.ladspa.org/download/
EXTRACT_SUFX= .tgz
MAINTAINER= pkgsrc-users@NetBSD.org
-HOMEPAGE= http://www.ladspa.org/
+HOMEPAGE= https://www.ladspa.org/
COMMENT= Linux Audio Developers Simple Plugin API
LICENSE= gnu-lgpl-v2.1
-USE_LIBTOOL= yes
+WRKSRC= ${WRKDIR}/ladspa_sdk_${PKGVERSION_NOREV}
-WRKSRC= ${WRKDIR}/ladspa_sdk/src
+BUILD_DIRS= src
USE_TOOLS+= gmake
+USE_LIBTOOL= yes
USE_LANGUAGES= c c++
-MAKE_FILE= makefile
-
-BUILDLINK_LIBS.dl+= ${BUILDLINK_LDADD.dl}
-
+MAKE_FILE= Makefile
+BUILD_TARGET= targets
+TEST_TARGET= test
-MAKE_FLAGS+= CFLAGS=${CFLAGS:Q}
-MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q}
+INSTALLATION_DIRS+= bin include
+INSTALLATION_DIRS+= lib/ladspa
+INSTALLATION_DIRS+= share/doc/ladspa
-#do-test:
-# cd ${WRKSRC} && && ${BUILD_MAKE_CMD} test
+do-install:
+ ${INSTALL_DATA} ${WRKSRC}/doc/* ${DESTDIR}${PREFIX}/share/doc/ladspa
+ ${LIBTOOL} --mode=install ${INSTALL_LIB} ${WRKSRC}/plugins/*.la ${DESTDIR}${PREFIX}/lib/ladspa
+ ${LIBTOOL} --mode=install ${INSTALL_DATA} ${WRKSRC}/src/ladspa.h ${DESTDIR}${PREFIX}/include
+ ${LIBTOOL} --mode=install ${INSTALL_PROGRAM} ${WRKSRC}/bin/* ${DESTDIR}${PREFIX}/bin
.include "../../mk/dlopen.buildlink3.mk"
+LDFLAGS+= ${BUILDLINK_LDADD.dl}
.include "../../mk/bsd.pkg.mk"
diff --git a/audio/ladspa/PLIST b/audio/ladspa/PLIST
index 6b335fc94d7..f1ec37d9bd5 100644
--- a/audio/ladspa/PLIST
+++ b/audio/ladspa/PLIST
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.3 2019/07/15 22:58:50 nia Exp $
+@comment $NetBSD: PLIST,v 1.4 2019/10/05 17:39:38 nia Exp $
bin/analyseplugin
bin/applyplugin
bin/listplugins
@@ -8,3 +8,15 @@ lib/ladspa/delay.la
lib/ladspa/filter.la
lib/ladspa/noise.la
lib/ladspa/sine.la
+share/doc/ladspa/COPYING
+share/doc/ladspa/background.html
+share/doc/ladspa/changes.html
+share/doc/ladspa/download.html
+share/doc/ladspa/example_plugins.html
+share/doc/ladspa/index.html
+share/doc/ladspa/installation.html
+share/doc/ladspa/ladspa.h.txt
+share/doc/ladspa/license.html
+share/doc/ladspa/overview.html
+share/doc/ladspa/shared_plugins.html
+share/doc/ladspa/unique_ids.html
diff --git a/audio/ladspa/distinfo b/audio/ladspa/distinfo
index e07e913d315..8975d7bc888 100644
--- a/audio/ladspa/distinfo
+++ b/audio/ladspa/distinfo
@@ -1,13 +1,8 @@
-$NetBSD: distinfo,v 1.15 2019/07/20 19:45:57 nia Exp $
+$NetBSD: distinfo,v 1.16 2019/10/05 17:39:38 nia Exp $
-SHA1 (ladspa_sdk_1.13.tgz) = 2b69e28afb62c0d97943124f48ed82de796f83ed
-RMD160 (ladspa_sdk_1.13.tgz) = e9eeae8edd24a6890fac3e34c4b55f844f44f8a0
-SHA512 (ladspa_sdk_1.13.tgz) = a1dab807fda58e08869d3f519be5fa91c394690eb13006fbe7f20b332548e4676b32b01273f5695bf36c8da72190c07618662a76d50f991b3f05068ac2b346ef
-Size (ladspa_sdk_1.13.tgz) = 70540 bytes
-SHA1 (patch-aa) = c233427fd90b701841f113bd980e7538cb4b2b62
-SHA1 (patch-ab) = 1357f25ef53c24c737a4888ba7d01fb724a3f315
-SHA1 (patch-ac) = 40108e5e4fdba9b2be322d0de532a97322d22325
-SHA1 (patch-plugins_amp.c) = e0336ff7fe078aa6b4e6b3d25b21b70ac6dc127d
-SHA1 (patch-plugins_delay.c) = ee551be35938b69d7b535640858d67ceeb261ee0
-SHA1 (patch-plugins_filter.c) = 79b050f99a68ebd87e76f552054592331c31828e
-SHA1 (patch-plugins_noise.c) = 9e996f5f9ad4e39974cafea52af143e9db4603f7
+SHA1 (ladspa_sdk_1.15.tgz) = b7bbbf47e00b6c5248b35796a362644393457878
+RMD160 (ladspa_sdk_1.15.tgz) = 94ade7b6286d0536a80d748e33ed94162beef9cf
+SHA512 (ladspa_sdk_1.15.tgz) = a521622e23d988284244003e4ccfc3b42f6ddc7944cb00e7949b87e09d7f39a0cbb64b6d8b5a5af0a5ccf7179f88815416a88f02d3912957167e54b74accfc65
+Size (ladspa_sdk_1.15.tgz) = 71179 bytes
+SHA1 (patch-src_Makefile) = 9b5f12cdb32b88e9d0354ddc4f7539ca8da95eb0
+SHA1 (patch-src_applyplugin.c) = 88127403707150d8646f85a7a5d6a146c812b34e
diff --git a/audio/ladspa/patches/patch-aa b/audio/ladspa/patches/patch-aa
deleted file mode 100644
index 4468b395e31..00000000000
--- a/audio/ladspa/patches/patch-aa
+++ /dev/null
@@ -1,172 +0,0 @@
-$NetBSD: patch-aa,v 1.9 2019/07/20 19:45:57 nia Exp $
-
-* Fix the destination directories
-* Use cc(1) to link the plug-ins
-* Add support for CFLAGS and LDFLAGS
-* Add libtool support in install and build targets
-* Add libtool support to test target
-
---- makefile.orig 2007-11-06 10:42:45.000000000 +0000
-+++ makefile
-@@ -4,9 +4,9 @@
- #
- # Change these if you want to install somewhere else.
-
--INSTALL_PLUGINS_DIR = /usr/lib/ladspa/
--INSTALL_INCLUDE_DIR = /usr/include/
--INSTALL_BINARY_DIR = /usr/bin/
-+INSTALL_PLUGINS_DIR = ${PREFIX}/lib/ladspa/
-+INSTALL_INCLUDE_DIR = ${PREFIX}/include/
-+INSTALL_BINARY_DIR = ${PREFIX}/bin/
-
- ###############################################################################
- #
-@@ -14,9 +14,10 @@ INSTALL_BINARY_DIR = /usr/bin/
- #
-
- INCLUDES = -I.
--LIBRARIES = -ldl -lm
--CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC
--CXXFLAGS = $(CFLAGS)
-+LOCAL_CPPFLAGS = $(INCLUDES) -fPIC $(CPPFLAGS)
-+LOCAL_CFLAGS = $(INCLUDES) -fPIC $(CFLAGS)
-+LIBRARIES = $(DL_LIBS) -lm
-+LOCAL_LDFLAGS = $(LDFLAGS)
- PLUGINS = ../plugins/amp.so \
- ../plugins/delay.so \
- ../plugins/filter.so \
-@@ -25,8 +26,8 @@ PLUGINS = ../plugins/amp.so \
- PROGRAMS = ../bin/analyseplugin \
- ../bin/applyplugin \
- ../bin/listplugins
--CC = cc
--CPP = c++
-+#CC = cc
-+#CPP = c++
-
- ###############################################################################
- #
-@@ -34,12 +35,12 @@ CPP = c++
- #
-
- ../plugins/%.so: plugins/%.c ladspa.h
-- $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
-- $(LD) -o ../plugins/$*.so plugins/$*.o -shared
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(LOCAL_CPPFLAGS) $(LOCAL_CFLAGS) -o plugins/$*.lo -c plugins/$*.c
-+ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LOCAL_LDFLAGS) -o ../plugins/$*.la plugins/$*.lo -rpath $(INSTALL_PLUGINS_DIR) -module -avoid-version
-
- ../plugins/%.so: plugins/%.cpp ladspa.h
-- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
-- $(CPP) -o ../plugins/$*.so plugins/$*.o -shared
-+ ${LIBTOOL} --tag=CXX --mode=compile $(CXX) $(LOCAL_CPPFLAGS) $(LOCAL_CXXFLAGS) -o plugins/$*.lo -c plugins/$*.cpp
-+ ${LIBTOOL} --tag=CXX --mode=link $(CXX) $(LOCAL_LDFLAGS) -o ../plugins/$*.la plugins/$*.lo -rpath $(INSTALL_PLUGINS_DIR) -module -avoid-version
-
- ###############################################################################
- #
-@@ -50,59 +51,71 @@ test: /tmp/test.wav ../snd/noise.wav alw
- @echo ---------------------------------------------
- @echo First listen to the white noise input signal:
- @echo ---------------------------------------------
-- -sndfile-play ../snd/noise.wav
-+ #-sndfile-play ../snd/noise.wav
- @echo -------------------------
- @echo Compare to plugin output.
- @echo -------------------------
- @echo Should be a noise band around 6000Hz, repeated quietly after 1s.
-- -sndfile-play /tmp/test.wav
-+ #-sndfile-play /tmp/test.wav
- @echo Test complete.
-
--install: targets
-- -mkdirhier $(INSTALL_PLUGINS_DIR)
-- -mkdirhier $(INSTALL_INCLUDE_DIR)
-- -mkdirhier $(INSTALL_BINARY_DIR)
-- cp ../plugins/* $(INSTALL_PLUGINS_DIR)
-- cp ladspa.h $(INSTALL_INCLUDE_DIR)
-- cp ../bin/* $(INSTALL_BINARY_DIR)
--
--/tmp/test.wav: targets ../snd/noise.wav
-- ../bin/listplugins
-- ../bin/analyseplugin ../plugins/filter.so
-- ../bin/analyseplugin ../plugins/delay.so
-- ../bin/analyseplugin ../plugins/sine.so
-- echo ; ../bin/analyseplugin -l ../plugins/sine.so ; echo
-- ../bin/analyseplugin ../plugins/amp.so
-- ../bin/analyseplugin ../plugins/noise.so
-- ../bin/applyplugin -s 1 \
-- ../snd/noise.wav /tmp/test.wav \
-- ../plugins/filter.so lpf 500 \
-- ../plugins/filter.so lpf 500 \
-- ../plugins/sine.so sine_fcaa 6000 \
-- ../plugins/delay.so delay_5s 1 0.1 \
-- ../plugins/amp.so amp_mono 4 \
-+install:
-+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(INSTALL_PLUGINS_DIR)
-+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(INSTALL_INCLUDE_DIR)
-+ $(BSD_INSTALL_DATA_DIR) ${DESTDIR}$(INSTALL_BINARY_DIR)
-+ ${LIBTOOL} --mode=install $(BSD_INSTALL_LIB) ../plugins/*.la ${DESTDIR}$(INSTALL_PLUGINS_DIR)
-+ ${LIBTOOL} --mode=install $(BSD_INSTALL_DATA) ladspa.h ${DESTDIR}$(INSTALL_INCLUDE_DIR)
-+ ${LIBTOOL} --mode=install $(BSD_INSTALL_PROGRAM) ../bin/* ${DESTDIR}$(INSTALL_BINARY_DIR)
-+
-+/tmp/test.wav: ../snd/noise.wav
-+ ${LIBTOOL} --mode=execute ../bin/listplugins
-+ ${LIBTOOL} --mode=execute -dlopen ../plugins/filter.la ../bin/analyseplugin ../plugins/filter.so
-+ ${LIBTOOL} --mode=execute -dlopen ../plugins/delay.la ../bin/analyseplugin ../plugins/delay.so
-+ ${LIBTOOL} --mode=execute -dlopen ../plugins/sine.la ../bin/analyseplugin ../plugins/sine.so
-+ echo ; ${LIBTOOL} --mode=execute -dlopen -dlopen ../plugins/sine.la ../bin/analyseplugin -l ../plugins/sine.so ; echo
-+ ${LIBTOOL} --mode=execute -dlopen ../plugins/amp.la ../bin/analyseplugin ../plugins/amp.so
-+ ${LIBTOOL} --mode=execute -dlopen ../plugins/noise.la../bin/analyseplugin ../plugins/noise.so
-+ ${LIBTOOL} --mode=execute -dlopen ../plugins/filter.la ../bin/applyplugin -s 1 \
-+ ../snd/noise.wav /tmp/test.wav \
-+ ../plugins/filter.so lpf 500 \
-+ ../plugins/filter.so lpf 500 \
-+ ../plugins/sine.so sine_fcaa 6000 \
-+ ../plugins/delay.so delay_5s 1 0.1 \
-+ ../plugins/amp.so amp_mono 4 \
-
--targets: $(PLUGINS) $(PROGRAMS)
-+all: $(PLUGINS) $(PROGRAMS)
-
- ###############################################################################
- #
- # PROGRAMS
- #
-
-+default.o:
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) -c default.c
-+
-+load.o:
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) -c load.c
-+
-+applyplugin.o:
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) -c applyplugin.c
-+
-+analyseplugin.o:
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) -c analyseplugin.c
-+
-+listplugins.o:
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) -c listplugins.c
-+
-+search.o:
-+ ${LIBTOOL} --tag=CC --mode=compile $(CC) -c search.c
-+
- ../bin/applyplugin: applyplugin.o load.o default.o
-- $(CC) $(CFLAGS) $(LIBRARIES) \
-- -o ../bin/applyplugin \
-- applyplugin.o load.o default.o
-+ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LOCAL_LDFLAGS) -o $@ $(^:.o=.lo) $(LIBRARIES) \
-
- ../bin/analyseplugin: analyseplugin.o load.o default.o
-- $(CC) $(CFLAGS) $(LIBRARIES) \
-- -o ../bin/analyseplugin \
-- analyseplugin.o load.o default.o
-+ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LOCAL_LDFLAGS) -o $@ $(^:.o=.lo) $(LIBRARIES)
-
- ../bin/listplugins: listplugins.o search.o
-- $(CC) $(CFLAGS) $(LIBRARIES) \
-- -o ../bin/listplugins \
-- listplugins.o search.o
-+ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LOCAL_LDFLAGS) -o $@ $(^:.o=.lo) $(LIBRARIES)
-
- ###############################################################################
- #
diff --git a/audio/ladspa/patches/patch-ac b/audio/ladspa/patches/patch-ac
deleted file mode 100644
index 8945f094ef7..00000000000
--- a/audio/ladspa/patches/patch-ac
+++ /dev/null
@@ -1,29 +0,0 @@
-$NetBSD: patch-ac,v 1.2 2013/09/13 09:11:13 jperkin Exp $
-
-Avoid "error: call of overloaded 'pow(int, unsigned int)' is ambiguous"
-
---- plugins/sine.cpp.orig 2007-11-06 10:13:34.000000000 +0000
-+++ plugins/sine.cpp
-@@ -62,12 +62,21 @@ initialise_sine_table() {
- g_pfSineTable[lIndex] = LADSPA_Data(sin(dShift * lIndex));
- }
- if (g_fPhaseStepBase == 0) {
-- g_fPhaseStepBase = (LADSPA_Data)pow(2, sizeof(unsigned long) * 8);
-+ g_fPhaseStepBase = (LADSPA_Data)pow((float)2, (float)sizeof(unsigned long) * 8);
- }
- }
-
- /*****************************************************************************/
-
-+LADSPA_Handle instantiateSineOscillator(const LADSPA_Descriptor *, unsigned long SampleRate);
-+void connectPortToSineOscillator(LADSPA_Handle Instance, unsigned long Port, LADSPA_Data * DataLocation);
-+void activateSineOscillator(void * pvHandle);
-+void runSineOscillator_FreqAudio_AmpAudio(LADSPA_Handle Instance, unsigned long SampleCount);
-+void runSineOscillator_FreqAudio_AmpCtrl(LADSPA_Handle Instance, unsigned long SampleCount);
-+void runSineOscillator_FreqCtrl_AmpAudio(LADSPA_Handle Instance, unsigned long SampleCount);
-+void runSineOscillator_FreqCtrl_AmpCtrl(LADSPA_Handle Instance, unsigned long SampleCount);
-+void cleanupSineOscillator(void *pvHandle);
-+
- class SineOscillator {
- private:
-
diff --git a/audio/ladspa/patches/patch-plugins_amp.c b/audio/ladspa/patches/patch-plugins_amp.c
deleted file mode 100644
index 5aea45f81d4..00000000000
--- a/audio/ladspa/patches/patch-plugins_amp.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-plugins_amp.c,v 1.1 2017/11/16 15:05:31 khorben Exp $
-
-Mark the constructor and destructor functions as such.
-
---- plugins/amp.c.orig 2002-07-06 17:20:19.000000000 +0000
-+++ plugins/amp.c
-@@ -152,7 +152,8 @@ LADSPA_Descriptor * g_psStereoDescriptor
-
- /* _init() is called automatically when the plugin library is first
- loaded. */
--void
-+static void _init() __attribute__((constructor));
-+static void
- _init() {
-
- char ** pcPortNames;
-@@ -335,7 +336,8 @@ deleteDescriptor(LADSPA_Descriptor * psD
- /*****************************************************************************/
-
- /* _fini() is called automatically when the library is unloaded. */
--void
-+static void _fini() __attribute__((destructor));
-+static void
- _fini() {
- deleteDescriptor(g_psMonoDescriptor);
- deleteDescriptor(g_psStereoDescriptor);
diff --git a/audio/ladspa/patches/patch-plugins_delay.c b/audio/ladspa/patches/patch-plugins_delay.c
deleted file mode 100644
index 02bf7b31b34..00000000000
--- a/audio/ladspa/patches/patch-plugins_delay.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-plugins_delay.c,v 1.1 2017/11/16 15:05:31 khorben Exp $
-
-Mark the constructor and destructor functions as such.
-
---- plugins/delay.c.orig 2002-07-06 17:21:20.000000000 +0000
-+++ plugins/delay.c
-@@ -228,7 +228,8 @@ LADSPA_Descriptor * g_psDescriptor = NUL
-
- /* _init() is called automatically when the plugin library is first
- loaded. */
--void
-+static void _init() __attribute__((constructor));
-+static void
- _init() {
-
- char ** pcPortNames;
-@@ -322,7 +323,8 @@ _init() {
- /*****************************************************************************/
-
- /* _fini() is called automatically when the library is unloaded. */
--void
-+static void _fini() __attribute__((destructor));
-+static void
- _fini() {
- long lIndex;
- if (g_psDescriptor) {
diff --git a/audio/ladspa/patches/patch-plugins_filter.c b/audio/ladspa/patches/patch-plugins_filter.c
deleted file mode 100644
index e490a9d383d..00000000000
--- a/audio/ladspa/patches/patch-plugins_filter.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-plugins_filter.c,v 1.1 2017/11/16 15:05:31 khorben Exp $
-
-Mark the constructor and destructor functions as such.
-
---- plugins/filter.c.orig 2002-07-06 17:22:01.000000000 +0000
-+++ plugins/filter.c
-@@ -252,7 +252,8 @@ LADSPA_Descriptor * g_psHPFDescriptor =
-
- /* _init() is called automatically when the plugin library is first
- loaded. */
--void
-+static void _init() __attribute__((constructor));
-+static void
- _init() {
-
- char ** pcPortNames;
-@@ -431,7 +432,8 @@ deleteDescriptor(LADSPA_Descriptor * psD
- /*****************************************************************************/
-
- /* _fini() is called automatically when the library is unloaded. */
--void
-+static void _fini() __attribute__((destructor));
-+static void
- _fini() {
- deleteDescriptor(g_psLPFDescriptor);
- deleteDescriptor(g_psHPFDescriptor);
diff --git a/audio/ladspa/patches/patch-plugins_noise.c b/audio/ladspa/patches/patch-plugins_noise.c
deleted file mode 100644
index b70a58dd244..00000000000
--- a/audio/ladspa/patches/patch-plugins_noise.c
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD: patch-plugins_noise.c,v 1.1 2017/11/16 15:05:31 khorben Exp $
-
-Mark the constructor and destructor functions as such.
-
---- plugins/noise.c.orig 2002-07-06 17:22:34.000000000 +0000
-+++ plugins/noise.c
-@@ -142,7 +142,8 @@ LADSPA_Descriptor * g_psDescriptor;
-
- /* _init() is called automatically when the plugin library is first
- loaded. */
--void
-+static void _init() __attribute__((constructor));
-+static void
- _init() {
-
- char ** pcPortNames;
-@@ -219,7 +220,8 @@ _init() {
- /*****************************************************************************/
-
- /* _fini() is called automatically when the library is unloaded. */
--void
-+static void _fini() __attribute__((destructor));
-+static void
- _fini() {
- long lIndex;
- if (g_psDescriptor) {
diff --git a/audio/ladspa/patches/patch-src_Makefile b/audio/ladspa/patches/patch-src_Makefile
new file mode 100644
index 00000000000..de58490ccab
--- /dev/null
+++ b/audio/ladspa/patches/patch-src_Makefile
@@ -0,0 +1,161 @@
+$NetBSD: patch-src_Makefile,v 1.1 2019/10/05 17:39:38 nia Exp $
+
+Libtool support.
+
+--- src/Makefile.orig 2019-01-06 12:27:52.000000000 +0000
++++ src/Makefile
+@@ -4,9 +4,9 @@
+ #
+ # Change these if you want to install somewhere else.
+
+-INSTALL_PLUGINS_DIR = /usr/lib/ladspa/
+-INSTALL_INCLUDE_DIR = /usr/include/
+-INSTALL_BINARY_DIR = /usr/bin/
++INSTALL_PLUGINS_DIR = ${PREFIX}/lib/ladspa/
++INSTALL_INCLUDE_DIR = ${PREFIX}/include/
++INSTALL_BINARY_DIR = ${PREFIX}/bin/
+
+ ###############################################################################
+ #
+@@ -14,11 +14,12 @@ INSTALL_BINARY_DIR = /usr/bin/
+ #
+
+ INCLUDES = -I.
+-LIBRARIES = -ldl -lm
+-CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC \
++LIBRARIES += -lm
++CFLAGS += $(INCLUDES) -Wall -fPIC \
++ -DDEFAULT_LADSPA_PATH=$(INSTALL_PLUGINS_DIR)
++CXXFLAGS += $(INCLUDES) -Wall -fPIC \
+ -DDEFAULT_LADSPA_PATH=$(INSTALL_PLUGINS_DIR)
+ BINFLAGS = -fPIE -pie
+-CXXFLAGS = $(CFLAGS)
+ PLUGINS = ../plugins/amp.so \
+ ../plugins/delay.so \
+ ../plugins/filter.so \
+@@ -27,35 +28,19 @@ PLUGINS = ../plugins/amp.so \
+ PROGRAMS = ../bin/analyseplugin \
+ ../bin/applyplugin \
+ ../bin/listplugins
+-CC = cc
+-CPP = c++
+
+ ###############################################################################
+ #
+ # RULES TO BUILD PLUGINS FROM C OR C++ CODE
+ #
+
+-../plugins/%.so: plugins/%.c ladspa.h gcc_exports.map
+- $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
+- $(CC) -o ../plugins/$*.so \
+- plugins/$*.o \
+- -shared \
+- $(CFLAGS) \
+- -fvisibility=hidden \
+- -fvisibility-inlines-hidden \
+- -s \
+- -Wl,--version-script=gcc_exports.map
+-
+-../plugins/%.so: plugins/%.cpp ladspa.h gcc_exports.map
+- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
+- $(CPP) -o ../plugins/$*.so \
+- plugins/$*.o \
+- -shared \
+- $(CXXFLAGS) \
+- -fvisibility=hidden \
+- -fvisibility-inlines-hidden \
+- -s \
+- -Wl,--version-script=gcc_exports.map
++../plugins/%.so: plugins/%.c ladspa.h gcc_exports.map
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o plugins/$*.lo -c plugins/$*.c
++ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -o ../plugins/$*.la plugins/$*.lo -rpath $(INSTALL_PLUGINS_DIR) -module -avoid-version
++
++../plugins/%.so: plugins/%.cpp ladspa.h
++ ${LIBTOOL} --tag=CXX --mode=compile $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o plugins/$*.lo -c plugins/$*.cpp
++ ${LIBTOOL} --tag=CXX --mode=link $(CXX) $(LDFLAGS) -o ../plugins/$*.la plugins/$*.lo -rpath $(INSTALL_PLUGINS_DIR) -module -avoid-version
+
+ ###############################################################################
+ #
+@@ -84,19 +69,19 @@ install: targets
+
+ /tmp/test.wav: targets ../snd/noise.wav
+ ../bin/listplugins
+- ../bin/analyseplugin ../plugins/filter.so
+- ../bin/analyseplugin ../plugins/delay.so
+- ../bin/analyseplugin ../plugins/sine.so
+- echo ; ../bin/analyseplugin -l ../plugins/sine.so ; echo
+- ../bin/analyseplugin ../plugins/amp.so
+- ../bin/analyseplugin ../plugins/noise.so
+- ../bin/applyplugin -s 1 \
+- ../snd/noise.wav /tmp/test.wav \
+- ../plugins/filter.so lpf 500 \
+- ../plugins/filter.so lpf 500 \
+- ../plugins/sine.so sine_fcaa 6000 \
+- ../plugins/delay.so delay_5s 1 0.1 \
+- ../plugins/amp.so amp_mono 4 \
++ ../bin/analyseplugin ../plugins/.libs/filter.so
++ ../bin/analyseplugin ../plugins/.libs/delay.so
++ ../bin/analyseplugin ../plugins/.libs/sine.so
++ echo ; ../bin/analyseplugin -l ../plugins/.libs/sine.so ; echo
++ ../bin/analyseplugin ../plugins/.libs/amp.so
++ ../bin/analyseplugin ../plugins/.libs/noise.so
++ ../bin/applyplugin -s 1 \
++ ../snd/noise.wav /tmp/test.wav \
++ ../plugins/.libs/filter.so lpf 500 \
++ ../plugins/.libs/filter.so lpf 500 \
++ ../plugins/.libs/sine.so sine_fcaa 6000 \
++ ../plugins/.libs/delay.so delay_5s 1 0.1 \
++ ../plugins/.libs/amp.so amp_mono 4 \
+
+ targets: $(PLUGINS) $(PROGRAMS)
+
+@@ -105,23 +90,32 @@ targets: $(PLUGINS) $(PROGRAMS)
+ # PROGRAMS
+ #
+
+-../bin/applyplugin: applyplugin.o load.o default.o
+- $(CC) $(CFLAGS) $(BINFLAGS) \
+- -o ../bin/applyplugin \
+- applyplugin.o load.o default.o \
+- $(LIBRARIES)
+-
+-../bin/analyseplugin: analyseplugin.o load.o default.o
+- $(CC) $(CFLAGS) $(BINFLAGS) \
+- -o ../bin/analyseplugin \
+- analyseplugin.o load.o default.o \
+- $(LIBRARIES)
+-
+-../bin/listplugins: listplugins.o search.o
+- $(CC) $(CFLAGS) $(BINFLAGS) \
+- -o ../bin/listplugins \
+- listplugins.o search.o \
+- $(LIBRARIES)
++default.o:
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c default.c
++
++load.o:
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c load.c
++
++applyplugin.o:
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c applyplugin.c
++
++analyseplugin.o:
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c analyseplugin.c
++
++listplugins.o:
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c listplugins.c
++
++search.o:
++ ${LIBTOOL} --tag=CC --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -c search.c
++
++../bin/applyplugin: applyplugin.o load.o default.o
++ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -o $@ $(^:.o=.lo) $(LIBRARIES) \
++
++../bin/analyseplugin: analyseplugin.o load.o default.o
++ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -o $@ $(^:.o=.lo) $(LIBRARIES)
++
++../bin/listplugins: listplugins.o search.o
++ ${LIBTOOL} --tag=CC --mode=link $(CC) $(LDFLAGS) -o $@ $(^:.o=.lo) $(LIBRARIES)
+
+ ###############################################################################
+ #
diff --git a/audio/ladspa/patches/patch-ab b/audio/ladspa/patches/patch-src_applyplugin.c
index fa5ee15a49a..ad194db8921 100644
--- a/audio/ladspa/patches/patch-ab
+++ b/audio/ladspa/patches/patch-src_applyplugin.c
@@ -1,9 +1,9 @@
-$NetBSD: patch-ab,v 1.5 2019/07/15 22:58:50 nia Exp $
+$NetBSD: patch-src_applyplugin.c,v 1.1 2019/10/05 17:39:38 nia Exp $
-Add endian.h header for macosx
+Endian support for SunOS and macOS.
---- applyplugin.c.orig 2007-11-06 10:52:56.000000000 +0000
-+++ applyplugin.c
+--- src/applyplugin.c.orig 2019-01-06 12:27:52.000000000 +0000
++++ src/applyplugin.c
@@ -6,7 +6,19 @@
/*****************************************************************************/