[SCM] hydrogen/master: Add patch to fix linking order. This avoids build failure with --as-needed (Closes: #632229, LP: #803182).

alessio at users.alioth.debian.org alessio at users.alioth.debian.org
Fri Jul 1 07:31:34 UTC 2011


The following commit has been merged in the master branch:
commit 3d5e73571427d2f8887eb42577aec95ebe466eea
Author: Alessio Treglia <alessio at debian.org>
Date:   Fri Jul 1 09:30:25 2011 +0200

    Add patch to fix linking order. This avoids build failure with --as-needed (Closes: #632229, LP: #803182).

diff --git a/debian/patches/1004_indirect_linking.patch b/debian/patches/1004_indirect_linking.patch
new file mode 100644
index 0000000..f7c2425
--- /dev/null
+++ b/debian/patches/1004_indirect_linking.patch
@@ -0,0 +1,100 @@
+Description: fix build with ld --as-needed
+ libraries must be added to LIBS instead of ldflags so they are
+ ordered correctly on the command line.
+ With ld --as-needed the object files must be before the libraries providing
+ the symbols they need.
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/hydrogen/+bug/803182
+Author: Julian Taylor <jtaylor.debian at googlemail.com>
+Forwarded: no
+---
+ Sconstruct |   23 ++++++++++++-----------
+ 1 file changed, 12 insertions(+), 11 deletions(-)
+
+--- hydrogen.orig/Sconstruct
++++ hydrogen/Sconstruct
+@@ -44,6 +44,7 @@ def get_platform_flags( opts ):
+ 	includes = []
+ 	cppflags = []
+ 	ldflags = []
++	libs = []
+ 
+ 	env = Environment( options = opts )
+ 
+@@ -92,10 +93,10 @@ def get_platform_flags( opts ):
+ 		includes.append( '/usr/local/include/jack' )
+ 
+ 	elif sys.platform[:6] == 'linux2':
+-		ldflags.append('-lpthread')
+-		ldflags.append('-lasound')
+-		ldflags.append('-lporttime')
+-	#	ldflags.append('-lrubberband')
++		libs.append('-lpthread')
++		libs.append('-lasound')
++		libs.append('-lporttime')
++	#	libs.append('-lrubberband')
+ 
+ 	elif sys.platform == "win32":
+ 		includes.append( '3rdparty\libsndfile-1_0_17' )
+@@ -106,7 +107,7 @@ def get_platform_flags( opts ):
+ 	else:
+ 		raise Exception( "Platform '%s' not supported" % sys.platform )
+ 
+-	return (includes, cppflags, ldflags)
++	return (includes, cppflags, ldflags, libs)
+ 
+ 
+ 
+@@ -175,7 +176,7 @@ def get_svn_revision():
+ 
+ 
+ def get_hydrogen_lib( opts ):
+-	includes, cppflags, ldflags = get_platform_flags( opts )
++	includes, cppflags, ldflags, libs = get_platform_flags( opts )
+ 
+ 	includes.append( "libs/hydrogen/include" )
+ 	
+@@ -185,7 +186,7 @@ def get_hydrogen_lib( opts ):
+ 	#location of qt4.py
+ 	qt4ToolLocation="."
+ 
+-	env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags )
++	env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags, LIBS=libs )
+ 	env.EnableQt4Modules( ['QtCore', 'QtGui','QtXml'], debug=False)
+ 	env.CacheDir( "scons_cache" )
+ 	
+@@ -223,7 +224,7 @@ def install_images( arg , dir , files):
+ 			env.Alias(target="install", source=env.Install(dir= env['DESTDIR'] + env['prefix'] + '/share/hydrogen/' + dname, source= dir + "/" + file))
+ 
+ def get_hydrogen_gui( lib_hydrogen , opts ):
+-	includes, cppflags, ldflags = get_platform_flags( opts )
++	includes, cppflags, ldflags, libs = get_platform_flags( opts )
+ 
+ 	includes.append( "libs/hydrogen/include" )
+ 	includes.append( "gui/src/UI" )
+@@ -231,7 +232,7 @@ def get_hydrogen_gui( lib_hydrogen , opt
+ 	#location of qt4.py
+ 	qt4ToolLocation="."
+ 
+-	env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags )
++	env = Environment(options = opts , tools=['default','qt4'], toolpath=[qt4ToolLocation], ENV=os.environ, CPPPATH = includes, CPPFLAGS = cppflags, CCFLAGS = "", LINKFLAGS=ldflags, LIBS=libs )
+ 	
+ 	if str(env['gui']) == "1":
+ 	    env.EnableQt4Modules( ['QtCore', 'QtGui','QtNetwork','QtXml'], debug=False)
+@@ -259,7 +260,7 @@ def get_hydrogen_gui( lib_hydrogen , opt
+ 
+ 	src = scanFiles( directory, ['*.cpp', '*.cc', '*.c' ], [ 'moc_'] )
+ 
+-	env.Append( LIBS = lib_hydrogen )
++	env.Prepend( LIBS = lib_hydrogen )
+ 	
+ 	if sys.platform != "win32":
+ 		env.Append( LIBS = ["sndfile"] )
+@@ -378,7 +379,7 @@ else:
+ 
+ #get includes ( important if you compile on non-standard envorionments)
+ 
+-includes, a , b = get_platform_flags( opts )
++includes, a , b, c = get_platform_flags( opts )
+ 
+ env = Environment(options = opts, CPPPATH = includes)
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 7ebf5e1..7ed8df6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@
 1001_rubberband_path.patch
 1002_relax_SCons_linux2_resolving.patch
 1003_gcc45.patch
+1004_indirect_linking.patch

-- 
hydrogen packaging



More information about the pkg-multimedia-commits mailing list