From d924ab91f610f93c793701519d22dc11ae84bd55 Mon Sep 17 00:00:00 2001
From: Kazuhiko Shiozaki <kazuhiko@nexedi.com>
Date: Thu, 25 Nov 2010 10:02:21 +0000
Subject: [PATCH] link wish our own zlib in lxml.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@40651 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 buildout/software-profiles/lxml-python.cfg |  2 +
 buildout/tests/assertSoftware.py           | 49 ++++++++++++++++++++--
 2 files changed, 47 insertions(+), 4 deletions(-)

diff --git a/buildout/software-profiles/lxml-python.cfg b/buildout/software-profiles/lxml-python.cfg
index 7becf2f0c6..c1a0299644 100644
--- a/buildout/software-profiles/lxml-python.cfg
+++ b/buildout/software-profiles/lxml-python.cfg
@@ -2,6 +2,7 @@
 extends =
   ../software-profiles/libxml2.cfg
   ../software-profiles/libxslt.cfg
+  ../software-profiles/zlib.cfg
 
 parts =
   lxml-python
@@ -15,4 +16,5 @@ egg = lxml
 rpath =
   ${libxml2:location}/lib/
   ${libxslt:location}/lib/
+  ${zlib:location}/lib/
 environment = lxml-python-env
diff --git a/buildout/tests/assertSoftware.py b/buildout/tests/assertSoftware.py
index f0dc59295d..282d55c9ee 100644
--- a/buildout/tests/assertSoftware.py
+++ b/buildout/tests/assertSoftware.py
@@ -106,6 +106,13 @@ def readElfAsDict(f):
     runpath_list=sorted(runpath_list)
   )
 
+def getPythonVersion():
+  return '%s.%s' % util.sys.version_info[0:2]
+
+def getDevelopEggName(name, version):
+  return '%s-%s-py%s-%s.egg' % (name, version, getPythonVersion(),
+                                util.get_platform())
+
 def readLddInfoList(f):
   popen = subprocess.Popen(['ldd', f], stdout=subprocess.PIPE,
       stderr=subprocess.STDOUT)
@@ -1448,10 +1455,9 @@ class AssertBzip2(AssertSoftwareMixin):
 
 class AssertPysvn(AssertSoftwareMixin):
   def test_ld_pysvn(self):
-    python_version_major, python_version_minor = util.sys.version_info[0:2]
-    self.assertLibraryList('develop-eggs/pysvn-1.7.4-py%s.%s-%s.egg/pysvn/_pysvn_%s_%s.so' % (
-      python_version_major, python_version_minor, util.get_platform(),
-      python_version_major, python_version_minor), [
+    self.assertLibraryList('develop-eggs/%s/pysvn/_pysvn_%s.so' % (
+      getDevelopEggName('pysvn', '1.7.4'),
+      getPythonVersion().replace('.', '_')), [
       'libc',
       'libcom_err',
       'libgcc_s',
@@ -1465,6 +1471,41 @@ class AssertPysvn(AssertSoftwareMixin):
       'subversion'
       ])
 
+class AssertLxml(AssertSoftwareMixin):
+  def test_ld_etree_so(self):
+    egg_name = getDevelopEggName('lxml', '2.2.8')
+    python_version_major, python_version_minor = util.sys.version_info[0:2]
+    self.assertLibraryList('develop-eggs/%s/lxml/etree.so' % (egg_name), [
+      'libc',
+      'libexslt',
+      'libm',
+      'libpthread',
+      'libxml2',
+      'libxslt',
+      'libz',
+      ], [
+      'libxml2',
+      'libxslt',
+      'zlib',
+      ])
+
+  def test_ld_objectify_so(self):
+    egg_name = getDevelopEggName('lxml', '2.2.8')
+    python_version_major, python_version_minor = util.sys.version_info[0:2]
+    self.assertLibraryList('develop-eggs/%s/lxml/objectify.so' % (egg_name), [
+      'libc',
+      'libexslt',
+      'libm',
+      'libpthread',
+      'libxml2',
+      'libxslt',
+      'libz',
+      ], [
+      'libxml2',
+      'libxslt',
+      'zlib',
+      ])
+
 class AssertElfLinkedInternally(AssertSoftwareMixin):
   def test(self):
     result_dict = {}
-- 
2.30.9