Patchwork [1/3] ladspa-sdk: new package

login
register
mail settings
Submitter Martin Bark
Date April 24, 2014, 9:19 p.m.
Message ID <1398374384-8814-1-git-send-email-martin@barkynet.com>
Download mbox | patch
Permalink /patch/342479/
State Changes Requested
Headers show

Comments

Martin Bark - April 24, 2014, 9:19 p.m.
LADSPA is a standard that allows software audio processors and
effects to be plugged into a wide range of audio synthesis and
recording packages.

Signed-off-by: Martin Bark <martin@barkynet.com>
---
 package/Config.in                                  |    1 +
 package/ladspa-sdk/Config.in                       |    8 +++++
 .../ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch    |   18 ++++++++++
 .../ladspa-sdk-02-default-ladspa-path.patch        |   30 ++++++++++++++++
 .../ladspa-sdk-04-fix-linkage-C-plugins.diff       |   23 ++++++++++++
 .../ladspa-sdk/ladspa-sdk-05-linking-order.patch   |   37 ++++++++++++++++++++
 .../ladspa-sdk-06-cross-compile-fix.patch          |   35 ++++++++++++++++++
 package/ladspa-sdk/ladspa-sdk.mk                   |   27 ++++++++++++++
 8 files changed, 179 insertions(+)
 create mode 100644 package/ladspa-sdk/Config.in
 create mode 100644 package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch
 create mode 100644 package/ladspa-sdk/ladspa-sdk-02-default-ladspa-path.patch
 create mode 100644 package/ladspa-sdk/ladspa-sdk-04-fix-linkage-C-plugins.diff
 create mode 100644 package/ladspa-sdk/ladspa-sdk-05-linking-order.patch
 create mode 100644 package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch
 create mode 100644 package/ladspa-sdk/ladspa-sdk.mk
Thomas Petazzoni - Aug. 4, 2014, 8:23 p.m.
Dear Martin Bark,

Sorry for the lack of feedback until now on these patches. See below
for a number of comments.

On Thu, 24 Apr 2014 22:19:42 +0100, Martin Bark wrote:
> LADSPA is a standard that allows software audio processors and
> effects to be plugged into a wide range of audio synthesis and
> recording packages.
> 
> Signed-off-by: Martin Bark <martin@barkynet.com>

First, looking at LADSPA, it seems like there has been no releases
since 2007 or so. Is this still actively developed and used? Googling
around, I've seen mentions of a new thing called LV2 which would be a
LADSPA replacement.

> diff --git a/package/Config.in b/package/Config.in
> index 07fd166..5956154 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -493,6 +493,7 @@ source "package/alsa-lib/Config.in"
>  source "package/audiofile/Config.in"
>  source "package/celt051/Config.in"
>  source "package/fdk-aac/Config.in"
> +source "package/ladspa-sdk/Config.in"

This will have to be rebased on top of the latest master.

>  source "package/libao/Config.in"
>  source "package/libcdaudio/Config.in"
>  source "package/libcdio/Config.in"
> diff --git a/package/ladspa-sdk/Config.in b/package/ladspa-sdk/Config.in
> new file mode 100644
> index 0000000..ec3d568
> --- /dev/null
> +++ b/package/ladspa-sdk/Config.in
> @@ -0,0 +1,8 @@
> +config BR2_PACKAGE_LADSPA_SDK
> +	bool "ladspa-sdk"

I've at least seen that one of the plugins is developed in C++, so a
dependency on BR2_INSTALL_LIBSDTCPP is needed here. Look at the manual
and other examples on how to add this dependency properly (including
the relevant Config.in comment).

> diff --git a/package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch b/package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch
> new file mode 100644
> index 0000000..d424594
> --- /dev/null
> +++ b/package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch
> @@ -0,0 +1,18 @@
> +Use mkdir -p instead of mkdirhier to avoid build-dep on xutils-dev

There should be a Signed-off-by line in all patches, separated with a
newline from the patch description and patch contents.

> diff --git a/package/ladspa-sdk/ladspa-sdk-04-fix-linkage-C-plugins.diff b/package/ladspa-sdk/ladspa-sdk-04-fix-linkage-C-plugins.diff

This one does not get applied, as it is named ".diff". And is it really
needed?

Also, the sequence number is not consecutive with 02 of the previous
patch.


> diff --git a/package/ladspa-sdk/ladspa-sdk-05-linking-order.patch b/package/ladspa-sdk/ladspa-sdk-05-linking-order.patch
> new file mode 100644
> index 0000000..a66def7
> --- /dev/null
> +++ b/package/ladspa-sdk/ladspa-sdk-05-linking-order.patch
> @@ -0,0 +1,37 @@
> +Description: Correct linking order to prevent FTBFS with GCC4.5 + binutils-gold.
> +Author: Alessio Treglia <quadrispro@ubuntu.com>

Please add your Signed-off-by here as well, in addition to the Author:
information.

That's typically the kind of patch that worries me: gcc 4.5 has been
released years and years ago, and still issues with this compiler have
not been solved upstream.

> diff --git a/package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch b/package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch
> new file mode 100644
> index 0000000..549b6eb
> --- /dev/null
> +++ b/package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch

Missing description + Signed-off-by.


> +################################################################################
> +#
> +# ladspa-sdk
> +#
> +################################################################################
> +
> +LADSPA_SDK_VERSION = 1.13
> +LADSPA_SDK_SOURCE = ladspa_sdk_$(LADSPA_SDK_VERSION).tgz
> +LADSPA_SDK_SITE = http://www.ladspa.org/download/
> +LADSPA_SDK_LICENSE = LGPLv2.1+
> +LADSPA_SDK_LICENSE_FILES = doc/COPYING
> +LADSPA_SDK_INSTALL_STAGING = YES
> +
> +define LADSPA_SDK_BUILD_CMDS
> +	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/src targets
> +endef
> +
> +define LADSPA_SDK_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0644 $(@D)/plugins/*.so $(TARGET_DIR)/usr/lib/ladspa/.

The "." at the end is making the installation fail.

> +	$(INSTALL) -D -m 0755 $(@D)/bin/* $(TARGET_DIR)/usr/bin/.
> +endef
> +
> +define LADSPA_SDK_INSTALL_STAGING_CMDS
> +	$(INSTALL) -D -m 0644 $(@D)/src/ladspa.h $(STAGING_DIR)/usr/include/.

Same here.

Also, what about using "make install" instead? Either by patching the
makefile to add $(DESTDIR) support, or by passing explicitly values for
INSTALL_PLUGINS_DIR, INSTALL_INCLUDE_DIR and INSTALL_BINARY_DIR ?

While waiting for your new version of this patch, I'll mark this patch
as "Changes Requested" in our patch tracking system.

Thanks for your contribution!

Thomas
Martin Bark - Aug. 5, 2014, 8:50 p.m.
Thomas,

On 04/08/14 21:23, Thomas Petazzoni wrote:
> Dear Martin Bark,
>
> Sorry for the lack of feedback until now on these patches. See below
> for a number of comments.

That's fine, to be honest I forgot I submitted these patches :)

>
> On Thu, 24 Apr 2014 22:19:42 +0100, Martin Bark wrote:
>> LADSPA is a standard that allows software audio processors and
>> effects to be plugged into a wide range of audio synthesis and
>> recording packages.
>>
>> Signed-off-by: Martin Bark <martin@barkynet.com>
>
> First, looking at LADSPA, it seems like there has been no releases
> since 2007 or so. Is this still actively developed and used? Googling
> around, I've seen mentions of a new thing called LV2 which would be a
> LADSPA replacement.

Originally I started this because I wanted an equaliser for some work i 
was doing with acoustic echo cancellation. alsaeqaul was a quick easy 
way to add a equaliser i could change real time.  alsaequal needs caps 
which is an ladsp module hence the 3 patches.

I don't know if ladsp is under active development.  Really it's just the 
definition of an API in a C header file so I think it's not meant to 
change.  It's the packages like caps which implement the interface which 
i expect to be active.

caps is self contained (it includes a copy of ladsp.h) and does not need 
this ladsp-sdk package, i added it for completeness.

Is the lack of development activity an issue?  I could drop ladsp-sdk if 
you like.  Please let me know your thoughts.

Thanks

Martin
Thomas Petazzoni - Aug. 6, 2014, 7:59 a.m.
Dear Martin Bark,

On Tue, 05 Aug 2014 21:50:28 +0100, Martin Bark wrote:

> > Sorry for the lack of feedback until now on these patches. See below
> > for a number of comments.
> 
> That's fine, to be honest I forgot I submitted these patches :)

Yeah, it's been a while, but I'm trying to do some clean up of the
patch backlog.

> Originally I started this because I wanted an equaliser for some work i 
> was doing with acoustic echo cancellation. alsaeqaul was a quick easy 
> way to add a equaliser i could change real time.  alsaequal needs caps 
> which is an ladsp module hence the 3 patches.

Ok.

> I don't know if ladsp is under active development.  Really it's just the 
> definition of an API in a C header file so I think it's not meant to 
> change.  It's the packages like caps which implement the interface which 
> i expect to be active.

Ok, makes sense. I was a bit worried about the lack of upstream
activity, but it is indeed just an API definition, so probably it
doesn't make sense for it to move very often.

> caps is self contained (it includes a copy of ladsp.h) and does not need 
> this ladsp-sdk package, i added it for completeness.

Ah, ok.

> Is the lack of development activity an issue?  I could drop ladsp-sdk if 
> you like.  Please let me know your thoughts.

Well, if it's not needed for caps, I'd say leave it aside for now.

And for both packages, if you do patches on them to make them work in
Buildroot, we generally prefer when some patches are submitted
upstream. So that one day, maybe, we can drop those patches when
upstream releases a new version.

Thanks!

Thomas

Patch

diff --git a/package/Config.in b/package/Config.in
index 07fd166..5956154 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -493,6 +493,7 @@  source "package/alsa-lib/Config.in"
 source "package/audiofile/Config.in"
 source "package/celt051/Config.in"
 source "package/fdk-aac/Config.in"
+source "package/ladspa-sdk/Config.in"
 source "package/libao/Config.in"
 source "package/libcdaudio/Config.in"
 source "package/libcdio/Config.in"
diff --git a/package/ladspa-sdk/Config.in b/package/ladspa-sdk/Config.in
new file mode 100644
index 0000000..ec3d568
--- /dev/null
+++ b/package/ladspa-sdk/Config.in
@@ -0,0 +1,8 @@ 
+config BR2_PACKAGE_LADSPA_SDK
+	bool "ladspa-sdk"
+	help
+	  LADSPA is a standard that allows software audio processors and
+	  effects to be plugged into a wide range of audio synthesis and
+	  recording packages.
+
+	  http://www.ladspa.org/
diff --git a/package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch b/package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch
new file mode 100644
index 0000000..d424594
--- /dev/null
+++ b/package/ladspa-sdk/ladspa-sdk-01-no-mkdirhier.patch
@@ -0,0 +1,18 @@ 
+Use mkdir -p instead of mkdirhier to avoid build-dep on xutils-dev
+Index: ladspa-sdk/src/makefile
+===================================================================
+--- ladspa-sdk.orig/src/makefile	2009-06-05 14:49:37.000000000 +1000
++++ ladspa-sdk/src/makefile	2009-06-05 14:50:07.000000000 +1000
+@@ -59,9 +59,9 @@
+ 	@echo Test complete.
+ 
+ install:	targets
+-	-mkdirhier $(INSTALL_PLUGINS_DIR)
+-	-mkdirhier $(INSTALL_INCLUDE_DIR)
+-	-mkdirhier $(INSTALL_BINARY_DIR)
++	-mkdir -p $(INSTALL_PLUGINS_DIR)
++	-mkdir -p $(INSTALL_INCLUDE_DIR)
++	-mkdir -p $(INSTALL_BINARY_DIR)
+ 	cp ../plugins/* $(INSTALL_PLUGINS_DIR)
+ 	cp ladspa.h $(INSTALL_INCLUDE_DIR)
+ 	cp ../bin/* $(INSTALL_BINARY_DIR)
diff --git a/package/ladspa-sdk/ladspa-sdk-02-default-ladspa-path.patch b/package/ladspa-sdk/ladspa-sdk-02-default-ladspa-path.patch
new file mode 100644
index 0000000..05f5122
--- /dev/null
+++ b/package/ladspa-sdk/ladspa-sdk-02-default-ladspa-path.patch
@@ -0,0 +1,30 @@ 
+Use a default ladspa path instead of failing when LADSPA_PATH is undefined
+Index: ladspa-sdk/src/load.c
+===================================================================
+--- ladspa-sdk.orig/src/load.c	2009-06-05 14:52:05.000000000 +1000
++++ ladspa-sdk/src/load.c	2009-06-05 14:54:04.000000000 +1000
+@@ -54,6 +54,8 @@
+        to search. */
+ 
+     pcLADSPAPath = getenv("LADSPA_PATH");
++    if (!pcLADSPAPath)
++      pcLADSPAPath = "/usr/lib/ladspa";
+     
+     if (pcLADSPAPath) {
+ 
+Index: ladspa-sdk/src/search.c
+===================================================================
+--- ladspa-sdk.orig/src/search.c	2009-06-05 14:52:05.000000000 +1000
++++ ladspa-sdk/src/search.c	2009-06-05 14:52:57.000000000 +1000
+@@ -99,10 +99,10 @@
+ 
+   pcLADSPAPath = getenv("LADSPA_PATH");
+   if (!pcLADSPAPath) {
++    pcLADSPAPath = "/usr/lib/ladspa/";
+     fprintf(stderr,
+ 	    "Warning: You do not have a LADSPA_PATH "
+ 	    "environment variable set.\n");
+-    return;
+   }
+   
+   pcStart = pcLADSPAPath;
diff --git a/package/ladspa-sdk/ladspa-sdk-04-fix-linkage-C-plugins.diff b/package/ladspa-sdk/ladspa-sdk-04-fix-linkage-C-plugins.diff
new file mode 100644
index 0000000..5934f75
--- /dev/null
+++ b/package/ladspa-sdk/ladspa-sdk-04-fix-linkage-C-plugins.diff
@@ -0,0 +1,23 @@ 
+LD does not automatically insert needed libraries, we must specify them
+Index: ladspa-sdk/src/makefile
+===================================================================
+--- ladspa-sdk.orig/src/makefile	2009-11-03 20:36:21.000000000 -0300
++++ ladspa-sdk/src/makefile	2009-11-03 20:37:25.000000000 -0300
+@@ -14,7 +14,7 @@
+ #
+ 
+ INCLUDES	=	-I.
+-LIBRARIES	=	-ldl -lm
++LIBRARIES	=	-ldl -lm -lc
+ CFLAGS		=	$(INCLUDES) -Wall -Werror -O2 -fPIC
+ CXXFLAGS	=	$(CFLAGS)
+ PLUGINS		=	../plugins/amp.so				\
+@@ -35,7 +35,7 @@
+ 
+ ../plugins/%.so:	plugins/%.c ladspa.h
+ 	$(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
+-	$(LD) -o ../plugins/$*.so plugins/$*.o -shared
++	$(LD) -o ../plugins/$*.so plugins/$*.o -shared $(LIBRARIES)
+ 
+ ../plugins/%.so:	plugins/%.cpp ladspa.h
+ 	$(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
diff --git a/package/ladspa-sdk/ladspa-sdk-05-linking-order.patch b/package/ladspa-sdk/ladspa-sdk-05-linking-order.patch
new file mode 100644
index 0000000..a66def7
--- /dev/null
+++ b/package/ladspa-sdk/ladspa-sdk-05-linking-order.patch
@@ -0,0 +1,37 @@ 
+Description: Correct linking order to prevent FTBFS with GCC4.5 + binutils-gold.
+Author: Alessio Treglia <quadrispro@ubuntu.com>
+---
+ src/makefile |   15 +++++++++------
+ 1 file changed, 9 insertions(+), 6 deletions(-)
+
+--- ladspa-sdk-1.13.orig/src/makefile
++++ ladspa-sdk-1.13/src/makefile
+@@ -90,19 +90,22 @@ targets:	$(PLUGINS) $(PROGRAMS)
+ #
+ 
+ ../bin/applyplugin:	applyplugin.o load.o default.o
+-	$(CC) $(CFLAGS) $(LIBRARIES)					\
++	$(CC) $(CFLAGS)					\
+ 		-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)					\
+ 		-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)					\
+ 		-o ../bin/listplugins	 				\
+-		listplugins.o search.o
++		listplugins.o search.o \
++		$(LIBRARIES)
+ 
+ ###############################################################################
+ #
diff --git a/package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch b/package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch
new file mode 100644
index 0000000..549b6eb
--- /dev/null
+++ b/package/ladspa-sdk/ladspa-sdk-06-cross-compile-fix.patch
@@ -0,0 +1,35 @@ 
+--- ladspa-sdk-1.13.original/src/makefile	2014-04-24 19:59:18.151359520 +0100
++++ ladspa-sdk-1.13/src/makefile	2014-04-24 20:01:42.820770007 +0100
+@@ -15,8 +15,8 @@
+ 
+ INCLUDES	=	-I.
+ LIBRARIES	=	-ldl -lm
+-CFLAGS		=	$(INCLUDES) -Wall -Werror -O3 -fPIC
+-CXXFLAGS	=	$(CFLAGS)
++CFLAGS		+=	$(INCLUDES) -Wall -fPIC
++CXXFLAGS	+=	$(CFLAGS)
+ PLUGINS		=	../plugins/amp.so				\
+ 			../plugins/delay.so				\
+ 			../plugins/filter.so				\
+@@ -25,8 +25,8 @@
+ PROGRAMS	=	../bin/analyseplugin				\
+ 			../bin/applyplugin 				\
+ 			../bin/listplugins
+-CC		=	cc
+-CPP		=	c++
++CC		?=	cc
++CXX		?=	c++
+ 
+ ###############################################################################
+ #
+@@ -38,8 +38,8 @@
+ 	$(LD) -o ../plugins/$*.so plugins/$*.o -shared
+ 
+ ../plugins/%.so:	plugins/%.cpp ladspa.h
+-	$(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
+-	$(CPP) -o ../plugins/$*.so plugins/$*.o -shared
++	$(CXX) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
++	$(CXX) -o ../plugins/$*.so plugins/$*.o -shared
+ 
+ ###############################################################################
+ #
diff --git a/package/ladspa-sdk/ladspa-sdk.mk b/package/ladspa-sdk/ladspa-sdk.mk
new file mode 100644
index 0000000..f6f4cf0
--- /dev/null
+++ b/package/ladspa-sdk/ladspa-sdk.mk
@@ -0,0 +1,27 @@ 
+################################################################################
+#
+# ladspa-sdk
+#
+################################################################################
+
+LADSPA_SDK_VERSION = 1.13
+LADSPA_SDK_SOURCE = ladspa_sdk_$(LADSPA_SDK_VERSION).tgz
+LADSPA_SDK_SITE = http://www.ladspa.org/download/
+LADSPA_SDK_LICENSE = LGPLv2.1+
+LADSPA_SDK_LICENSE_FILES = doc/COPYING
+LADSPA_SDK_INSTALL_STAGING = YES
+
+define LADSPA_SDK_BUILD_CMDS
+	$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D)/src targets
+endef
+
+define LADSPA_SDK_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/plugins/*.so $(TARGET_DIR)/usr/lib/ladspa/.
+	$(INSTALL) -D -m 0755 $(@D)/bin/* $(TARGET_DIR)/usr/bin/.
+endef
+
+define LADSPA_SDK_INSTALL_STAGING_CMDS
+	$(INSTALL) -D -m 0644 $(@D)/src/ladspa.h $(STAGING_DIR)/usr/include/.
+endef
+
+$(eval $(generic-package))