From 5ec46e206a60e0bd8a4e36a167a26791b046c77844422bf688c8204e9ba7394d Mon Sep 17 00:00:00 2001 From: Dave Plater Date: Sat, 4 Nov 2017 09:20:53 +0000 Subject: [PATCH] Accepting request 538910 from home:plater Add ladspa-find-plugin-path.patch to enable listplugins to find plugins without LADSPA_PATH variable set. Add ladspa-pie.patch to enable position independent executables. OBS-URL: https://build.opensuse.org/request/show/538910 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/ladspa?expand=0&rev=37 --- ladspa-find-plugin-path.patch | 67 +++++++++++++++++++++++++++++++++++ ladspa-pie.patch | 37 +++++++++++++++++++ ladspa.changes | 7 ++++ ladspa.spec | 7 +++- 4 files changed, 117 insertions(+), 1 deletion(-) create mode 100644 ladspa-find-plugin-path.patch create mode 100644 ladspa-pie.patch diff --git a/ladspa-find-plugin-path.patch b/ladspa-find-plugin-path.patch new file mode 100644 index 0000000..f71951d --- /dev/null +++ b/ladspa-find-plugin-path.patch @@ -0,0 +1,67 @@ +From: Dave Plater +Date: 2007-11-06 12:48:06 +0200 +Subject: Find plugins +References: +Upstream: email + +Allow binary listplugins to find plugins without LADSPA_PATH set. +Index: src/search.c +=================================================================== +--- src/search.c.orig 2007-11-06 12:48:06.000000000 +0200 ++++ src/search.c 2017-11-04 09:00:29.169621959 +0200 +@@ -23,7 +23,7 @@ + /* Search just the one directory. */ + static void + LADSPADirectoryPluginSearch +-(const char * pcDirectory, ++(const char * pcDirectory, + LADSPAPluginSearchCallbackFunction fCallbackFunction) { + + char * pcFilename; +@@ -61,7 +61,7 @@ LADSPADirectoryPluginSearch + if (iNeedSlash) + strcat(pcFilename, "/"); + strcat(pcFilename, psDirectoryEntry->d_name); +- ++ + pvPluginHandle = dlopen(pcFilename, RTLD_LAZY); + if (pvPluginHandle) { + /* This is a file and the file is a shared library! */ +@@ -89,7 +89,7 @@ LADSPADirectoryPluginSearch + + /*****************************************************************************/ + +-void ++void + LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction) { + + char * pcBuffer; +@@ -99,23 +99,24 @@ LADSPAPluginSearch(LADSPAPluginSearchCal + + pcLADSPAPath = getenv("LADSPA_PATH"); + if (!pcLADSPAPath) { ++ pcLADSPAPath = "/usr/local/lib/ladspa:/usr/lib/ladspa:/usr/local/lib64/ladspa:/usr/lib64/ladspa"; + fprintf(stderr, + "Warning: You do not have a LADSPA_PATH " + "environment variable set.\n"); +- return; ++ //return; + } +- ++ + pcStart = pcLADSPAPath; + while (*pcStart != '\0') { + pcEnd = pcStart; + while (*pcEnd != ':' && *pcEnd != '\0') + pcEnd++; +- ++ + pcBuffer = malloc(1 + pcEnd - pcStart); + if (pcEnd > pcStart) + strncpy(pcBuffer, pcStart, pcEnd - pcStart); + pcBuffer[pcEnd - pcStart] = '\0'; +- ++ + LADSPADirectoryPluginSearch(pcBuffer, fCallbackFunction); + free(pcBuffer); + diff --git a/ladspa-pie.patch b/ladspa-pie.patch new file mode 100644 index 0000000..e662372 --- /dev/null +++ b/ladspa-pie.patch @@ -0,0 +1,37 @@ +From: Dave Plater - davejplater@gmail.co.za +Date: 2017-11-04 10:48:22 +0200 +Subject: Build position independent executables +References: +Upstream: email + +Build position independent executables. +Index: src/makefile +=================================================================== +--- src/makefile.orig 2017-11-04 10:51:34.635255160 +0200 ++++ src/makefile 2017-11-04 11:08:08.154323693 +0200 +@@ -14,14 +14,14 @@ INSTALL_BINARY_DIR = /usr/bin/ + # + + INCLUDES = -I. +-LIBRARIES = -ldl -lm ++LIBRARIES = -fPIE -pie -ldl -lm + CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC + CXXFLAGS = $(CFLAGS) + PLUGINS = ../plugins/amp.so \ + ../plugins/delay.so \ + ../plugins/filter.so \ + ../plugins/noise.so \ +- ../plugins/sine.so ++ ../plugins/sine.so + PROGRAMS = ../bin/analyseplugin \ + ../bin/applyplugin \ + ../bin/listplugins +@@ -112,7 +112,7 @@ targets: $(PLUGINS) $(PROGRAMS) + # UTILITIES + # + +-always: ++always: + + clean: + -rm -f `find . -name "*.o"` ../bin/* ../plugins/* diff --git a/ladspa.changes b/ladspa.changes index 3dae4e2..28efaa7 100644 --- a/ladspa.changes +++ b/ladspa.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Nov 4 08:39:00 UTC 2017 - davejplater@gmail.com + +- Add ladspa-find-plugin-path.patch to enable listplugins to find + plugins without LADSPA_PATH variable set. +- Add ladspa-pie.patch to enable position independent executables. + ------------------------------------------------------------------- Mon Mar 3 11:58:41 CET 2014 - tiwai@suse.de diff --git a/ladspa.spec b/ladspa.spec index f9d869d..1398cc1 100644 --- a/ladspa.spec +++ b/ladspa.spec @@ -1,7 +1,7 @@ # # spec file for package ladspa # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,10 @@ License: LGPL-2.1+ Group: Productivity/Multimedia/Sound/Utilities Url: http://www.ladspa.org/ Source: http://www.ladspa.org/download/%{name}_sdk_%{version}.tgz +Source1: baselibs.conf Patch0: ladspa.dif +Patch1: ladspa-find-plugin-path.patch +Patch2: ladspa-pie.patch BuildRequires: gcc-c++ BuildRoot: %{_tmppath}/%{name}-%{version}-build AutoReq: on @@ -48,6 +51,8 @@ This package contains include files to develop LADSPA plugins. %prep %setup -q -n ladspa_sdk %patch0 -p1 +%patch1 +%patch2 ln -s ../ladspa.h src/plugins/ladspa.h %build