diff options
author | khorben <khorben@pkgsrc.org> | 2017-11-16 15:05:31 +0000 |
---|---|---|
committer | khorben <khorben@pkgsrc.org> | 2017-11-16 15:05:31 +0000 |
commit | 06cd065ce0bad0e195576c40959c4f48debb26f0 (patch) | |
tree | 4e4f6cada3dd6d0e715dc9866afe13e2079d8268 /audio | |
parent | 6abaf38055bddbb90f7ed34db0dac64c6bf3648c (diff) | |
download | pkgsrc-06cd065ce0bad0e195576c40959c4f48debb26f0.tar.gz |
More generic fix for CFLAGS and LDFLAGS for audio/ladspa
In the C plug-ins, mark the constructor and destructor functions as
such. While there, comment out a new target to run the tests; they are
broken, but not because of this modification. This allows us to use
cc(1) to link the plug-ins, thus working around a bug in the cwrappers
for ld(1).
Bump PKGREVISION, since this generates a different binary now that SSP
and FORTIFY are enabled.
Diffstat (limited to 'audio')
-rw-r--r-- | audio/ladspa/Makefile | 12 | ||||
-rw-r--r-- | audio/ladspa/distinfo | 8 | ||||
-rw-r--r-- | audio/ladspa/patches/patch-aa | 39 | ||||
-rw-r--r-- | audio/ladspa/patches/patch-plugins_amp.c | 26 | ||||
-rw-r--r-- | audio/ladspa/patches/patch-plugins_delay.c | 26 | ||||
-rw-r--r-- | audio/ladspa/patches/patch-plugins_filter.c | 26 | ||||
-rw-r--r-- | audio/ladspa/patches/patch-plugins_noise.c | 26 |
7 files changed, 142 insertions, 21 deletions
diff --git a/audio/ladspa/Makefile b/audio/ladspa/Makefile index a45ef756517..484d27583d1 100644 --- a/audio/ladspa/Makefile +++ b/audio/ladspa/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.13 2017/07/15 18:12:51 wiz Exp $ +# $NetBSD: Makefile,v 1.14 2017/11/16 15:05:31 khorben Exp $ DISTNAME= ladspa_sdk_1.13 PKGNAME= ${DISTNAME:S/_sdk_/-/} +PKGREVISION= 1 CATEGORIES= audio MASTER_SITES= http://www.ladspa.org/download/ EXTRACT_SUFX= .tgz @@ -20,8 +21,13 @@ MAKE_FILE= makefile BUILDLINK_LIBS.dl+= ${BUILDLINK_LDADD.dl} INSTALLATION_DIRS+= bin include lib -REAL_LDFLAGS= ${LDFLAGS:S/-Wl,-z,/-z /g} -MAKEFLAGS+= REAL_LDFLAGS=${REAL_LDFLAGS:Q} + +MAKE_FLAGS+= CFLAGS=${CFLAGS:Q} +MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q} + +#XXX does not work (No rule to make target 'targets') +#do-test: +# cd ${WRKSRC} && && ${BUILD_MAKE_CMD} test .include "../../mk/dlopen.buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/audio/ladspa/distinfo b/audio/ladspa/distinfo index 975daba2b30..8757c0fb9e0 100644 --- a/audio/ladspa/distinfo +++ b/audio/ladspa/distinfo @@ -1,9 +1,13 @@ -$NetBSD: distinfo,v 1.11 2017/07/15 18:12:51 wiz Exp $ +$NetBSD: distinfo,v 1.12 2017/11/16 15:05:31 khorben 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) = bdfb2e82d2f7800a16275cb521f42f20799d998d +SHA1 (patch-aa) = 721eddb7269f2c20eecc45b64a293b44395a3fc3 SHA1 (patch-ab) = 1ad33baf6dcc4633e1459b6585cc8ccada57831f 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 diff --git a/audio/ladspa/patches/patch-aa b/audio/ladspa/patches/patch-aa index 6852b4540b6..8899b80cc6a 100644 --- a/audio/ladspa/patches/patch-aa +++ b/audio/ladspa/patches/patch-aa @@ -1,4 +1,8 @@ -$NetBSD: patch-aa,v 1.5 2017/07/15 18:12:51 wiz Exp $ +$NetBSD: patch-aa,v 1.6 2017/11/16 15:05:31 khorben Exp $ + +* Fix the destination directories +* Use cc(1) to link the plug-ins +* Add support for CFLAGS and LDFLAGS --- makefile.orig 2007-11-06 10:42:45.000000000 +0000 +++ makefile @@ -15,18 +19,21 @@ $NetBSD: patch-aa,v 1.5 2017/07/15 18:12:51 wiz Exp $ ############################################################################### # -@@ -14,8 +14,8 @@ INSTALL_BINARY_DIR = /usr/bin/ +@@ -14,9 +14,11 @@ INSTALL_BINARY_DIR = /usr/bin/ # INCLUDES = -I. -LIBRARIES = -ldl -lm -CFLAGS = $(INCLUDES) -Wall -Werror -O3 -fPIC -+LIBRARIES = $(DL_LIBS) -lm -+CFLAGS = $(INCLUDES) -Wall -Werror -fPIC ++CPPFLAGS = $(INCLUDES) ++CFLAGS = -Wall -Werror -fPIC CXXFLAGS = $(CFLAGS) ++LIBRARIES = $(DL_LIBS) -lm ++LDFLAGS = PLUGINS = ../plugins/amp.so \ ../plugins/delay.so \ -@@ -25,8 +25,8 @@ PLUGINS = ../plugins/amp.so \ + ../plugins/filter.so \ +@@ -25,8 +27,8 @@ PLUGINS = ../plugins/amp.so \ PROGRAMS = ../bin/analyseplugin \ ../bin/applyplugin \ ../bin/listplugins @@ -37,24 +44,24 @@ $NetBSD: patch-aa,v 1.5 2017/07/15 18:12:51 wiz Exp $ ############################################################################### # -@@ -34,12 +34,12 @@ CPP = c++ +@@ -34,12 +36,12 @@ CPP = c++ # ../plugins/%.so: plugins/%.c ladspa.h - $(CC) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c - $(LD) -o ../plugins/$*.so plugins/$*.o -shared -+ $(CC) $(CFLAGS) $(LDFLAGS) -o plugins/$*.o -c plugins/$*.c -+ $(LD) $(REAL_LDFLAGS) -o ../plugins/$*.so plugins/$*.o -shared ++ $(CC) $(CPPFLAGS) $(CFLAGS) -o plugins/$*.o -c plugins/$*.c ++ $(CC) -shared $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o ../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) $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o -shared ++ $(CXX) $(CPPFLAGS) $(CXXFLAGS) -o plugins/$*.o -c plugins/$*.cpp ++ $(CXX) -shared $(LDFLAGS) -o ../plugins/$*.so plugins/$*.o ############################################################################### # -@@ -58,13 +58,13 @@ test: /tmp/test.wav ../snd/noise.wav alw +@@ -58,13 +60,13 @@ test: /tmp/test.wav ../snd/noise.wav alw -sndfile-play /tmp/test.wav @echo Test complete. @@ -75,7 +82,7 @@ $NetBSD: patch-aa,v 1.5 2017/07/15 18:12:51 wiz Exp $ /tmp/test.wav: targets ../snd/noise.wav ../bin/listplugins -@@ -82,7 +82,7 @@ install: targets +@@ -82,7 +84,7 @@ install: targets ../plugins/delay.so delay_5s 1 0.1 \ ../plugins/amp.so amp_mono 4 \ @@ -84,24 +91,24 @@ $NetBSD: patch-aa,v 1.5 2017/07/15 18:12:51 wiz Exp $ ############################################################################### # -@@ -90,17 +90,17 @@ targets: $(PLUGINS) $(PROGRAMS) +@@ -90,17 +92,17 @@ targets: $(PLUGINS) $(PROGRAMS) # ../bin/applyplugin: applyplugin.o load.o default.o - $(CC) $(CFLAGS) $(LIBRARIES) \ -+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIBRARIES) \ ++ $(CC) $(LDFLAGS) $(LIBRARIES) \ -o ../bin/applyplugin \ applyplugin.o load.o default.o ../bin/analyseplugin: analyseplugin.o load.o default.o - $(CC) $(CFLAGS) $(LIBRARIES) \ -+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIBRARIES) \ ++ $(CC) $(LDFLAGS) $(LIBRARIES) \ -o ../bin/analyseplugin \ analyseplugin.o load.o default.o ../bin/listplugins: listplugins.o search.o - $(CC) $(CFLAGS) $(LIBRARIES) \ -+ $(CC) $(CFLAGS) $(LDFLAGS) $(LIBRARIES) \ ++ $(CC) $(LDFLAGS) $(LIBRARIES) \ -o ../bin/listplugins \ listplugins.o search.o diff --git a/audio/ladspa/patches/patch-plugins_amp.c b/audio/ladspa/patches/patch-plugins_amp.c new file mode 100644 index 00000000000..5aea45f81d4 --- /dev/null +++ b/audio/ladspa/patches/patch-plugins_amp.c @@ -0,0 +1,26 @@ +$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 new file mode 100644 index 00000000000..02bf7b31b34 --- /dev/null +++ b/audio/ladspa/patches/patch-plugins_delay.c @@ -0,0 +1,26 @@ +$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 new file mode 100644 index 00000000000..e490a9d383d --- /dev/null +++ b/audio/ladspa/patches/patch-plugins_filter.c @@ -0,0 +1,26 @@ +$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 new file mode 100644 index 00000000000..b70a58dd244 --- /dev/null +++ b/audio/ladspa/patches/patch-plugins_noise.c @@ -0,0 +1,26 @@ +$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) { |