[Pkg-php-commits] r1424 - modules/trunk/php-imagick/debian

Guillaume Delacour kcd-guest at alioth.debian.org
Tue Jun 1 20:47:44 UTC 2010


Author: kcd-guest
Date: 2010-06-01 20:47:43 +0000 (Tue, 01 Jun 2010)
New Revision: 1424

Added:
   modules/trunk/php-imagick/debian/ltmain.patch
Modified:
   modules/trunk/php-imagick/debian/changelog
   modules/trunk/php-imagick/debian/rules
Log:
Don't link against some libX11

Modified: modules/trunk/php-imagick/debian/changelog
===================================================================
--- modules/trunk/php-imagick/debian/changelog	2010-05-31 19:18:53 UTC (rev 1423)
+++ modules/trunk/php-imagick/debian/changelog	2010-06-01 20:47:43 UTC (rev 1424)
@@ -15,6 +15,7 @@
       (lintian package-contains-ancient-file rule)
     + Delete unnecessary patch rule
     + phpize5 --clean is now called in clean rule
+    + Set CFLAGS to -Wl,--as-needed, to not link against some libX11
   * Bump to Standards-Version 3.8.4 (move section from web to php)
   * Bump to compatibility 7 in debian/{control,compat}
   * debian/phpX-imagick.post{inst,rm}:
@@ -26,6 +27,8 @@
   * debian/{changelog,copyright}: suppress unnecessary spaces
   * Switch to dpkg-source 3.0 (quilt) format
   * debian/watch: mangle version according Debian Policy 5.6.12
+  * debian/ltmain.patch: Patch to reorder linker argument after phpize
+    (From BTS#347650)
 
  -- Guillaume Delacour <gui at iroqwa.org>  Tue, 09 Mar 2010 17:58:50 +0000
 

Added: modules/trunk/php-imagick/debian/ltmain.patch
===================================================================
--- modules/trunk/php-imagick/debian/ltmain.patch	                        (rev 0)
+++ modules/trunk/php-imagick/debian/ltmain.patch	2010-06-01 20:47:43 UTC (rev 1424)
@@ -0,0 +1,30 @@
+--- ltmain.sh.old	2010-06-01 19:21:42.000000000 +0000
++++ ltmain.sh	2010-06-01 19:23:14.000000000 +0000
+@@ -4716,6 +4716,11 @@
+ 	arg=$func_stripname_result
+ 	;;
+ 
++      -Wl,--as-needed)
++	deplibs="$deplibs $arg"
++	continue
++	;;
++
+       -Wl,*)
+ 	func_stripname '-Wl,' '' "$arg"
+ 	args=$func_stripname_result
+@@ -5070,6 +5075,15 @@
+ 	lib=
+ 	found=no
+ 	case $deplib in
++	-Wl,--as-needed)
++	  if test "$linkmode,$pass" = "prog,link"; then
++	    compile_deplibs="$deplib $compile_deplibs"
++	    finalize_deplibs="$deplib $finalize_deplibs"
++	  else
++	    deplibs="$deplib $deplibs"
++	  fi
++	  continue
++	  ;;
+ 	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ 	  if test "$linkmode,$pass" = "prog,link"; then
+ 	    compile_deplibs="$deplib $compile_deplibs"

Modified: modules/trunk/php-imagick/debian/rules
===================================================================
--- modules/trunk/php-imagick/debian/rules	2010-05-31 19:18:53 UTC (rev 1423)
+++ modules/trunk/php-imagick/debian/rules	2010-06-01 20:47:43 UTC (rev 1424)
@@ -9,6 +9,9 @@
 DEB_INSTALL_EXAMPLES_php5-imagick = $(DEB_SRCDIR)/examples/*
 DEB_INSTALL_DOCS_php5-imagick = $(DEB_SRCDIR)/CREDITS
 
+# don't link against unnecessary libraries such as libX11
+LDFLAGS := -Wl,--as-needed $(LDFLAGS)
+
 #
 # local hacks
 #
@@ -19,7 +22,13 @@
 	cd $(DEB_SRCDIR) && phpize5 --clean
 
 configure_for_php5::
+	# Hack here because:
+	# - we don't want the module linked against some libx* (unused symbols)
+	# We want to link with just needed libraries
+	# - "-Wl,--as-needed" is ignored if not the first argument of the linker
+	# We have to patch the linker call script ltmain.sh
 	cd $(DEB_SRCDIR) && phpize5 && \
+	    patch -p1 < ../debian/ltmain.patch ltmain.sh && \
 	    ./configure --with-imagick --with-php-config=/usr/bin/php-config5 \
 	    --disable-static --with-imagick=shared,/usr
 	sed -e 's/phpX/php5/g' < debian/phpX-imagick.postinst > debian/php5-imagick.postinst




More information about the Pkg-php-commits mailing list