[SCM] ladspa-sdk/master: Rework makefile patches
fsateler at users.alioth.debian.org
fsateler at users.alioth.debian.org
Wed Jun 19 19:11:56 UTC 2013
The following commit has been merged in the master branch:
commit e83d8440f4cb56b1d8968dc11c47004d01264f07
Author: Felipe Sateler <fsateler at debian.org>
Date: Wed Jun 19 15:10:52 2013 -0400
Rework makefile patches
Most patches are only needed because the makefile does not respect
standard variables. Make it obey standard variables, and drop all that
are unnecessary.
diff --git a/debian/patches/00_standard-makefile.patch b/debian/patches/00_standard-makefile.patch
new file mode 100644
index 0000000..fbec2fb
--- /dev/null
+++ b/debian/patches/00_standard-makefile.patch
@@ -0,0 +1,47 @@
+Allow overriding of build parameters via the standard make variables
+--- a/src/makefile
++++ b/src/makefile
+@@ -15,8 +15,9 @@
+
+ INCLUDES = -I.
+ LIBRARIES = -ldl -lm
+-CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC
+-CXXFLAGS = $(CFLAGS)
++MANDATORY = $(INCLUDES) -fPIC
++CFLAGS ?= -Wall -Werror -O3
++CXXFLAGS ?= $(CFLAGS)
+ PLUGINS = ../plugins/amp.so \
+ ../plugins/delay.so \
+ ../plugins/filter.so \
+@@ -25,21 +26,25 @@
+ PROGRAMS = ../bin/analyseplugin \
+ ../bin/applyplugin \
+ ../bin/listplugins
+-CC = cc
+-CPP = c++
++CC ?= cc
++CXX ?= c++
++
++WITH_INIT = noise amp delay filter
+
+ ###############################################################################
+ #
+ # RULES TO BUILD PLUGINS FROM C OR C++ CODE
+ #
+
++$(patsubst %, ../plugins/%.so, $(WITH_INIT)) : NOSTART = -nostartfiles
++
+ ../plugins/%.so: plugins/%.c ladspa.h
+- $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
+- $(LD) -o ../plugins/$*.so plugins/$*.o -shared
++ $(CC) $(MANDATORY) $(CPPFLAGS) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c
++ $(CC) $(NOSTART) $(MANDATORY) -o ../plugins/$*.so plugins/$*.o -shared $(CFLAGS) $(LDFLAGS) $(LIBRARIES)
+
+ ../plugins/%.so: plugins/%.cpp ladspa.h
+- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
+- $(CPP) -o ../plugins/$*.so plugins/$*.o -shared
++ $(CXX) $(MANDATORY) $(CPPFLAGS) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
++ $(CXX) $(MANDATORY) -o ../plugins/$*.so plugins/$*.o -shared $(CXXFLAGS) $(LDFLAGS) $(LIBRARIES)
+
+ ###############################################################################
+ #
diff --git a/debian/patches/01_no-mkdirhier.diff b/debian/patches/01_no-mkdirhier.diff
index d424594..5768380 100644
--- a/debian/patches/01_no-mkdirhier.diff
+++ b/debian/patches/01_no-mkdirhier.diff
@@ -1,9 +1,7 @@
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 @@
+--- a/src/makefile
++++ b/src/makefile
+@@ -64,9 +64,9 @@
@echo Test complete.
install: targets
diff --git a/debian/patches/02_default-ladspa-path.diff b/debian/patches/02_default-ladspa-path.diff
index 05f5122..07ae8e4 100644
--- a/debian/patches/02_default-ladspa-path.diff
+++ b/debian/patches/02_default-ladspa-path.diff
@@ -1,8 +1,6 @@
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
+--- a/src/load.c
++++ b/src/load.c
@@ -54,6 +54,8 @@
to search. */
@@ -12,10 +10,8 @@ Index: ladspa-sdk/src/load.c
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
+--- a/src/search.c
++++ b/src/search.c
@@ -99,10 +99,10 @@
pcLADSPAPath = getenv("LADSPA_PATH");
diff --git a/debian/patches/03_m68k_workaround.diff b/debian/patches/03_m68k_workaround.diff
deleted file mode 100644
index 37669b3..0000000
--- a/debian/patches/03_m68k_workaround.diff
+++ /dev/null
@@ -1,16 +0,0 @@
-02_m68k_workaround by Junichi Uekawa <dancer at debian.org>
-m68k gcc ICE's with -O3, reduce to -O2.
-closes: #328285
-Index: ladspa-sdk/src/makefile
-===================================================================
---- ladspa-sdk.orig/src/makefile 2009-06-14 13:48:36.000000000 +1000
-+++ ladspa-sdk/src/makefile 2009-06-14 13:49:13.000000000 +1000
-@@ -15,7 +15,7 @@
-
- INCLUDES = -I.
- LIBRARIES = -ldl -lm
--CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC
-+CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC
- CXXFLAGS = $(CFLAGS)
- PLUGINS = ../plugins/amp.so \
- ../plugins/delay.so \
diff --git a/debian/patches/04_fix-linkage-C-plugins.diff b/debian/patches/04_fix-linkage-C-plugins.diff
deleted file mode 100644
index 5934f75..0000000
--- a/debian/patches/04_fix-linkage-C-plugins.diff
+++ /dev/null
@@ -1,23 +0,0 @@
-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/debian/patches/05_linking_order.diff b/debian/patches/05_linking_order.diff
index 8b1057c..40d07f2 100644
--- a/debian/patches/05_linking_order.diff
+++ b/debian/patches/05_linking_order.diff
@@ -5,9 +5,9 @@ Forwarded: no
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)
+--- a/src/makefile
++++ b/src/makefile
+@@ -95,19 +95,22 @@
#
../bin/applyplugin: applyplugin.o load.o default.o
diff --git a/debian/patches/06_include_fix.patch b/debian/patches/06_include_fix.patch
deleted file mode 100644
index c7cb388..0000000
--- a/debian/patches/06_include_fix.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-Description: Fix include
-Author: Jaromír Mikeš <mira.mikes at seznam.cz>
-Forwarded: no
-
-Index: ladspa-sdk/src/plugins/amp.c
-===================================================================
---- ladspa-sdk.orig/src/plugins/amp.c 2013-06-14 00:24:15.000000000 +0200
-+++ ladspa-sdk/src/plugins/amp.c 2013-06-14 00:35:11.112196770 +0200
-@@ -15,7 +15,7 @@
-
- /*****************************************************************************/
-
--#include "ladspa.h"
-+#include "../ladspa.h"
-
- /*****************************************************************************/
-
-Index: ladspa-sdk/src/plugins/delay.c
-===================================================================
---- ladspa-sdk.orig/src/plugins/delay.c 2013-06-14 00:24:15.000000000 +0200
-+++ ladspa-sdk/src/plugins/delay.c 2013-06-14 00:34:42.516197492 +0200
-@@ -17,7 +17,7 @@
-
- /*****************************************************************************/
-
--#include "ladspa.h"
-+#include "../ladspa.h"
-
- /*****************************************************************************/
-
-Index: ladspa-sdk/src/plugins/filter.c
-===================================================================
---- ladspa-sdk.orig/src/plugins/filter.c 2013-06-14 00:24:15.000000000 +0200
-+++ ladspa-sdk/src/plugins/filter.c 2013-06-14 00:34:48.192197348 +0200
-@@ -17,7 +17,7 @@
-
- /*****************************************************************************/
-
--#include "ladspa.h"
-+#include "../ladspa.h"
-
- /*****************************************************************************/
-
-Index: ladspa-sdk/src/plugins/noise.c
-===================================================================
---- ladspa-sdk.orig/src/plugins/noise.c 2013-06-14 00:24:15.000000000 +0200
-+++ ladspa-sdk/src/plugins/noise.c 2013-06-14 00:34:52.912197229 +0200
-@@ -15,7 +15,7 @@
-
- /*****************************************************************************/
-
--#include "ladspa.h"
-+#include "../ladspa.h"
-
- /*****************************************************************************/
-
-Index: ladspa-sdk/src/plugins/sine.cpp
-===================================================================
---- ladspa-sdk.orig/src/plugins/sine.cpp 2013-06-14 00:24:15.000000000 +0200
-+++ ladspa-sdk/src/plugins/sine.cpp 2013-06-14 00:34:57.624197110 +0200
-@@ -21,7 +21,7 @@
-
- /*****************************************************************************/
-
--#include "ladspa.h"
-+#include "../ladspa.h"
-
- /*****************************************************************************/
-
diff --git a/debian/patches/07-hardening-fix.patch b/debian/patches/07-hardening-fix.patch
deleted file mode 100644
index 9df8a42..0000000
--- a/debian/patches/07-hardening-fix.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Description: Fix hardening
-Author: Jaromír Mikeš <mira.mikes at seznam.cz>
-Forwarded: no
-
-Index: ladspa-sdk/src/makefile
-===================================================================
---- ladspa-sdk.orig/src/makefile 2013-06-15 12:05:32.948969369 +0200
-+++ ladspa-sdk/src/makefile 2013-06-15 12:07:39.308974508 +0200
-@@ -14,9 +14,10 @@
- #
-
- INCLUDES = -I.
--LIBRARIES = -ldl -lm -lc
--CFLAGS = $(INCLUDES) -Wall -Werror -O2 -fPIC
--CXXFLAGS = $(CFLAGS)
-+LIBRARIES = -ldl -lm -lc -z relro -z now
-+CFLAGS =
-+CXXFLAGS =
-+LDFLAGS =
- PLUGINS = ../plugins/amp.so \
- ../plugins/delay.so \
- ../plugins/filter.so \
-@@ -39,7 +40,7 @@
-
- ../plugins/%.so: plugins/%.cpp ladspa.h
- $(CPP) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp
-- $(CPP) -o ../plugins/$*.so plugins/$*.o -shared
-+ $(CPP) -o ../plugins/$*.so plugins/$*.o -shared $(LDFLAGS)
-
- ###############################################################################
- #
diff --git a/debian/patches/series b/debian/patches/series
index a62370e..9235cdb 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,7 +1,4 @@
+00_standard-makefile.patch
01_no-mkdirhier.diff
02_default-ladspa-path.diff
-03_m68k_workaround.diff
-04_fix-linkage-C-plugins.diff
05_linking_order.diff
-06_include_fix.patch
-07-hardening-fix.patch
diff --git a/debian/rules b/debian/rules
index ffbd66e..6f35c23 100755
--- a/debian/rules
+++ b/debian/rules
@@ -13,9 +13,6 @@ DEB_MAKE_INSTALL_TARGET = install DESTDIR=$(CURDIR)/debian/ladspa-sdk \
INSTALL_INCLUDE_DIR=$(CURDIR)/debian/ladspa-sdk/usr/include/ \
INSTALL_BINARY_DIR=$(CURDIR)/debian/ladspa-sdk/usr/bin/
-CFLAGS += -fPIC
-CXXFLAGS += -fPIC
-
pre-build::
# git doesn't preserve empty dirs, this is for git-buildpackage
mkdir -p plugins
--
ladspa-sdk packaging
More information about the pkg-multimedia-commits
mailing list