aboutsummaryrefslogtreecommitdiffstats
path: root/unmaintained/ladspa
diff options
context:
space:
mode:
Diffstat (limited to 'unmaintained/ladspa')
-rw-r--r--unmaintained/ladspa/0001-proper-build.patch111
-rw-r--r--unmaintained/ladspa/0002-plugin-constructor-destructor.patch119
-rw-r--r--unmaintained/ladspa/0003-plugindir.patch42
-rw-r--r--unmaintained/ladspa/APKBUILD44
4 files changed, 316 insertions, 0 deletions
diff --git a/unmaintained/ladspa/0001-proper-build.patch b/unmaintained/ladspa/0001-proper-build.patch
new file mode 100644
index 0000000000..fa3a6c43ee
--- /dev/null
+++ b/unmaintained/ladspa/0001-proper-build.patch
@@ -0,0 +1,111 @@
+From b87125e3eeb3e3446f80566083e5d66e7a667567 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Sat, 4 Feb 2012 21:22:13 +0000
+Subject: [PATCH 1/3] proper build
+
+---
+ src/makefile | 50 +++++++++++++++++++++++++++++---------------------
+ 1 files changed, 29 insertions(+), 21 deletions(-)
+
+diff --git a/src/makefile b/src/makefile
+index 886237f..10ce82d 100644
+--- a/src/makefile
++++ b/src/makefile
+@@ -13,10 +13,12 @@ INSTALL_BINARY_DIR = /usr/bin/
+ # GENERAL
+ #
+
++CFLAGS ?= -Wall -Werror -O3
++CXXFLAGS ?= -Wall -Werror -O3
++
+ INCLUDES = -I.
+-LIBRARIES = -ldl -lm
+-CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC
+-CXXFLAGS = $(CFLAGS)
++DYNAMIC_LD_LIBS = -ldl
++LIBRARIES = $(DYNAMIC_LD_LIBS) -lm
+ PLUGINS = ../plugins/amp.so \
+ ../plugins/delay.so \
+ ../plugins/filter.so \
+@@ -25,21 +27,27 @@ PLUGINS = ../plugins/amp.so \
+ PROGRAMS = ../bin/analyseplugin \
+ ../bin/applyplugin \
+ ../bin/listplugins
+-CC = cc
+-CPP = c++
++CC ?= cc
++CXX ?= c++
++MKDIR_P ?= mkdir -p
+
+ ###############################################################################
+ #
+ # RULES TO BUILD PLUGINS FROM C OR C++ CODE
+ #
+
++LDFLAGS_filter = -lm
++
+ ../plugins/%.so: plugins/%.c ladspa.h
+- $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
+- $(LD) -o ../plugins/$*.so plugins/$*.o -shared
++ $(CC) $(CFLAGS) $(INCLUDES) -fPIC -o plugins/$*.o -c plugins/$*.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o -shared $(LDFLAGS_$*)
+
+ ../plugins/%.so: plugins/%.cpp ladspa.h
+- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
+- $(CPP) -o ../plugins/$*.so plugins/$*.o -shared
++ $(CXX) $(CXXFLAGS) $(INCLUDES) -fPIC -o plugins/$*.o -c plugins/$*.cpp
++ $(CXX) $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o -shared $(LDFLAGS_$*)
++
++%.o: %.c
++ $(CC) $(CFLAGS) -DPLUGINDIR=\"$(INSTALL_PLUGINS_DIR)\" -c $<
+
+ ###############################################################################
+ #
+@@ -59,12 +67,12 @@ test: /tmp/test.wav ../snd/noise.wav always
+ @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)
++ -$(MKDIR_P) $(DESTDIR)$(INSTALL_PLUGINS_DIR)
++ -$(MKDIR_P) $(DESTDIR)$(INSTALL_INCLUDE_DIR)
++ -$(MKDIR_P) $(DESTDIR)$(INSTALL_BINARY_DIR)
++ cp ../plugins/* $(DESTDIR)$(INSTALL_PLUGINS_DIR)
++ cp ladspa.h $(DESTDIR)$(INSTALL_INCLUDE_DIR)
++ cp ../bin/* $(DESTDIR)$(INSTALL_BINARY_DIR)
+
+ /tmp/test.wav: targets ../snd/noise.wav
+ ../bin/listplugins
+@@ -90,19 +98,19 @@ targets: $(PLUGINS) $(PROGRAMS)
+ #
+
+ ../bin/applyplugin: applyplugin.o load.o default.o
+- $(CC) $(CFLAGS) $(LIBRARIES) \
++ $(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) \
+ -o ../bin/applyplugin \
+- applyplugin.o load.o default.o
++ applyplugin.o load.o default.o $(LIBRARIES)
+
+ ../bin/analyseplugin: analyseplugin.o load.o default.o
+- $(CC) $(CFLAGS) $(LIBRARIES) \
++ $(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) \
+ -o ../bin/analyseplugin \
+- analyseplugin.o load.o default.o
++ analyseplugin.o load.o default.o $(LIBRARIES)
+
+ ../bin/listplugins: listplugins.o search.o
+- $(CC) $(CFLAGS) $(LIBRARIES) \
++ $(CC) $(CFLAGS) $(INCLUDES) $(LDFLAGS) \
+ -o ../bin/listplugins \
+- listplugins.o search.o
++ listplugins.o search.o $(LIBRARIES)
+
+ ###############################################################################
+ #
+--
+1.7.9
+
diff --git a/unmaintained/ladspa/0002-plugin-constructor-destructor.patch b/unmaintained/ladspa/0002-plugin-constructor-destructor.patch
new file mode 100644
index 0000000000..f0061e823d
--- /dev/null
+++ b/unmaintained/ladspa/0002-plugin-constructor-destructor.patch
@@ -0,0 +1,119 @@
+From d281f99e3776027e98f3b9d952fad0d456a75b8a Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Sat, 4 Feb 2012 22:04:33 +0000
+Subject: [PATCH 2/3] plugin constructor destructor
+
+---
+ src/plugins/amp.c | 8 ++++----
+ src/plugins/delay.c | 8 ++++----
+ src/plugins/filter.c | 8 ++++----
+ src/plugins/noise.c | 8 ++++----
+ 4 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/src/plugins/amp.c b/src/plugins/amp.c
+index b6d2345..a447fa1 100644
+--- a/src/plugins/amp.c
++++ b/src/plugins/amp.c
+@@ -152,8 +152,8 @@ LADSPA_Descriptor * g_psStereoDescriptor = NULL;
+
+ /* _init() is called automatically when the plugin library is first
+ loaded. */
+-void
+-_init() {
++void __attribute__ ((constructor))
++my_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -335,8 +335,8 @@ deleteDescriptor(LADSPA_Descriptor * psDescriptor) {
+ /*****************************************************************************/
+
+ /* _fini() is called automatically when the library is unloaded. */
+-void
+-_fini() {
++void __attribute__ ((destructor))
++my_fini() {
+ deleteDescriptor(g_psMonoDescriptor);
+ deleteDescriptor(g_psStereoDescriptor);
+ }
+diff --git a/src/plugins/delay.c b/src/plugins/delay.c
+index 8b03979..22e477b 100644
+--- a/src/plugins/delay.c
++++ b/src/plugins/delay.c
+@@ -228,8 +228,8 @@ LADSPA_Descriptor * g_psDescriptor = NULL;
+
+ /* _init() is called automatically when the plugin library is first
+ loaded. */
+-void
+-_init() {
++void __attribute__ ((constructor))
++my_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -322,8 +322,8 @@ _init() {
+ /*****************************************************************************/
+
+ /* _fini() is called automatically when the library is unloaded. */
+-void
+-_fini() {
++void __attribute__ ((destructor))
++my_fini() {
+ long lIndex;
+ if (g_psDescriptor) {
+ free((char *)g_psDescriptor->Label);
+diff --git a/src/plugins/filter.c b/src/plugins/filter.c
+index 3f50457..06f7bc6 100644
+--- a/src/plugins/filter.c
++++ b/src/plugins/filter.c
+@@ -252,8 +252,8 @@ LADSPA_Descriptor * g_psHPFDescriptor = NULL;
+
+ /* _init() is called automatically when the plugin library is first
+ loaded. */
+-void
+-_init() {
++void __attribute__ ((constructor))
++my_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -431,8 +431,8 @@ deleteDescriptor(LADSPA_Descriptor * psDescriptor) {
+ /*****************************************************************************/
+
+ /* _fini() is called automatically when the library is unloaded. */
+-void
+-_fini() {
++void __attribute__ ((destructor))
++my_fini() {
+ deleteDescriptor(g_psLPFDescriptor);
+ deleteDescriptor(g_psHPFDescriptor);
+ }
+diff --git a/src/plugins/noise.c b/src/plugins/noise.c
+index 0fdd938..de6fc81 100644
+--- a/src/plugins/noise.c
++++ b/src/plugins/noise.c
+@@ -142,8 +142,8 @@ LADSPA_Descriptor * g_psDescriptor;
+
+ /* _init() is called automatically when the plugin library is first
+ loaded. */
+-void
+-_init() {
++void __attribute__ ((constructor))
++my_init() {
+
+ char ** pcPortNames;
+ LADSPA_PortDescriptor * piPortDescriptors;
+@@ -219,8 +219,8 @@ _init() {
+ /*****************************************************************************/
+
+ /* _fini() is called automatically when the library is unloaded. */
+-void
+-_fini() {
++void __attribute__ ((destructor))
++my_fini() {
+ long lIndex;
+ if (g_psDescriptor) {
+ free((char *)g_psDescriptor->Label);
+--
+1.7.9
+
diff --git a/unmaintained/ladspa/0003-plugindir.patch b/unmaintained/ladspa/0003-plugindir.patch
new file mode 100644
index 0000000000..bd78ee51fc
--- /dev/null
+++ b/unmaintained/ladspa/0003-plugindir.patch
@@ -0,0 +1,42 @@
+From 8e18df685c5fe747c6d250460d265a402f7900b1 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Sat, 4 Feb 2012 22:05:24 +0000
+Subject: [PATCH 3/3] plugindir
+
+---
+ src/load.c | 2 ++
+ src/search.c | 5 +----
+ 2 files changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/src/load.c b/src/load.c
+index c2a5aa7..e221c10 100644
+--- a/src/load.c
++++ b/src/load.c
+@@ -54,6 +54,8 @@ dlopenLADSPA(const char * pcFilename, int iFlag) {
+ to search. */
+
+ pcLADSPAPath = getenv("LADSPA_PATH");
++ if (! pcLADSPAPath)
++ pcLADSPAPath = PLUGINDIR;
+
+ if (pcLADSPAPath) {
+
+diff --git a/src/search.c b/src/search.c
+index 0006712..a6b2e78 100644
+--- a/src/search.c
++++ b/src/search.c
+@@ -99,10 +99,7 @@ LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction) {
+
+ pcLADSPAPath = getenv("LADSPA_PATH");
+ if (!pcLADSPAPath) {
+- fprintf(stderr,
+- "Warning: You do not have a LADSPA_PATH "
+- "environment variable set.\n");
+- return;
++ pcLADSPAPath = PLUGINDIR;
+ }
+
+ pcStart = pcLADSPAPath;
+--
+1.7.9
+
diff --git a/unmaintained/ladspa/APKBUILD b/unmaintained/ladspa/APKBUILD
new file mode 100644
index 0000000000..573bccf9fd
--- /dev/null
+++ b/unmaintained/ladspa/APKBUILD
@@ -0,0 +1,44 @@
+# Contributor: Natanael Copa <ncopa@alpinelinux.org>
+# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
+pkgname=ladspa
+pkgver=1.13
+pkgrel=0
+pkgdesc="Linux Audio Developer's Simple Plug-in API, examples and tools"
+url="http://www.ladspa.org/"
+arch="all"
+license="LGPLv2+"
+depends=""
+makedepends=""
+install=""
+subpackages="$pkgname-dev"
+source="http://www.ladspa.org/download/ladspa_sdk_$pkgver.tgz
+ 0001-proper-build.patch
+ 0002-plugin-constructor-destructor.patch
+ 0003-plugindir.patch
+ "
+
+_builddir="$srcdir"/ladspa_sdk
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+}
+
+build() {
+ cd "$_builddir"
+ make -C src targets || return 1
+}
+
+package() {
+ cd "$_builddir"
+ make -C src install DESTDIR="$pkgdir" || return 1
+}
+
+md5sums="671be3e1021d0722cadc7fb27054628e ladspa_sdk_1.13.tgz
+0e834af5f341081b772848ed3a753d5d 0001-proper-build.patch
+4b5c8831519e7485f2dacc5663375872 0002-plugin-constructor-destructor.patch
+95943ab38a96051ff4a6caf33182634c 0003-plugindir.patch"