r27066 - in /desktop/experimental/pygobject/debian: changelog control control.in patches/50_gio_tests_for_separate_build_tree.patch patches/51_gschema_tests_for_separate_build_tree.patch patches/series rules

bigon at users.alioth.debian.org bigon at users.alioth.debian.org
Thu Mar 24 13:43:09 UTC 2011


Author: bigon
Date: Thu Mar 24 13:43:08 2011
New Revision: 27066

URL: http://svn.debian.org/wsvn/pkg-gnome/?sc=1&rev=27066
Log:
  - Build-dependends against dh-autoreconf
* debian/rules: Call dh_autoreconf{_clean} instead of handeling this by hand,
  should Closes: #558530
* Fix test suite calls during package build (Closes: #619257):
  - debian/rules: Copy Python files from our modules into build tree, so
    that the tests actually find them. In Python you can't have Python
    modules and compiled extensions which belong to the same import in
    different directories. (Unfortunately it's hard to upstream this, so
    keep it as a Debian specific hack for now.)
  - debian/rules: Run the tests under xvfb so that the Gdk/Gtk ones can
    succeed.
  - debian/rules: Disable fakeroot for the tests by unsetting $LD_PRELOAD.
    Otherwise the tests try to connect to root's session D-BUS.
  - Add 50_gio_tests_for_separate_build_tree.patch,
    51_gschema_tests_for_separate_build_tree.patch: Various fixes to allow
    the tests to succeed with a separate build tree. Also committed into
    upstream git.
  - debian/control.in: Add build dependencies: xvfb (as we now use it in
    debian/rules), dbus-x11 (as the test suite uses dbus-launch), and
    python-apt-dbg/python-cairo-dbg, so that the test cases for the debug
    builds have all dependencies met.

Added:
    desktop/experimental/pygobject/debian/patches/50_gio_tests_for_separate_build_tree.patch
    desktop/experimental/pygobject/debian/patches/51_gschema_tests_for_separate_build_tree.patch
Modified:
    desktop/experimental/pygobject/debian/changelog
    desktop/experimental/pygobject/debian/control
    desktop/experimental/pygobject/debian/control.in
    desktop/experimental/pygobject/debian/patches/series
    desktop/experimental/pygobject/debian/rules

Modified: desktop/experimental/pygobject/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/changelog?rev=27066&op=diff
==============================================================================
--- desktop/experimental/pygobject/debian/changelog [utf-8] (original)
+++ desktop/experimental/pygobject/debian/changelog [utf-8] Thu Mar 24 13:43:08 2011
@@ -7,10 +7,13 @@
     - Drop XB-Python-Version: ${python:Versions}
     - Make python-gobject-dbg Depends against ${python:Depends}
       instead of python-dbg
+    - Build-dependends against dh-autoreconf
   * Drop d/p/40_revert_libpython_link.patch,
     d/p/30_[gi-overrides]-fix-exception-block-so-it-works-in-Python-2.5.patch:
     Applied upstream
   * Drop debian/patches/99_autoreconf.patch: Not needed anymore
+  * debian/rules: Call dh_autoreconf{_clean} instead of handeling this by hand,
+    should Closes: #558530
 
   [ Martin Pitt ]
   * debian/rules: Move from pysupport (which is being deprecated) to
@@ -19,8 +22,26 @@
   * debian/rules: Install a library search path for a pysupport compatible
     gtk-2.0 directory, to avoid instantly breaking all reverse dependencies.
     This needs to stay until they get converted to dh_python2.
-
- -- Laurent Bigonville <bigon at debian.org>  Thu, 24 Mar 2011 14:15:01 +0100
+  * Fix test suite calls during package build (Closes: #619257):
+    - debian/rules: Copy Python files from our modules into build tree, so
+      that the tests actually find them. In Python you can't have Python
+      modules and compiled extensions which belong to the same import in
+      different directories. (Unfortunately it's hard to upstream this, so
+      keep it as a Debian specific hack for now.)
+    - debian/rules: Run the tests under xvfb so that the Gdk/Gtk ones can
+      succeed.
+    - debian/rules: Disable fakeroot for the tests by unsetting $LD_PRELOAD.
+      Otherwise the tests try to connect to root's session D-BUS.
+    - Add 50_gio_tests_for_separate_build_tree.patch,
+      51_gschema_tests_for_separate_build_tree.patch: Various fixes to allow
+      the tests to succeed with a separate build tree. Also committed into
+      upstream git.
+    - debian/control.in: Add build dependencies: xvfb (as we now use it in
+      debian/rules), dbus-x11 (as the test suite uses dbus-launch), and
+      python-apt-dbg/python-cairo-dbg, so that the test cases for the debug
+      builds have all dependencies met.
+
+ -- Laurent Bigonville <bigon at debian.org>  Thu, 24 Mar 2011 14:35:53 +0100
 
 pygobject (2.28.0-2) experimental; urgency=low
 

Modified: desktop/experimental/pygobject/debian/control
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/control?rev=27066&op=diff
==============================================================================
--- desktop/experimental/pygobject/debian/control [utf-8] (original)
+++ desktop/experimental/pygobject/debian/control [utf-8] Thu Mar 24 13:43:08 2011
@@ -10,6 +10,7 @@
 Uploaders: Debian GNOME Maintainers <pkg-gnome-maintainers at lists.alioth.debian.org>, Emilio Pozuelo Monfort <pochu at debian.org>, Laurent Bigonville <bigon at debian.org>
 Build-Depends: debhelper (>= 7),
                gnome-pkg-tools (>= 0.10),
+               dh-autoreconf,
                cdbs (>= 0.4.90~),
                quilt,
                python-all-dev (>= 2.6.6-3~),
@@ -20,9 +21,13 @@
                libgirepository1.0-dev (>= 0.10.2),
                python-cairo-dev (>= 1.2.0),
                xsltproc,
+               xvfb,
+               dbus-x11,
                docbook-xsl,
                autotools-dev,
                python-all-dbg,
+               python-apt-dbg,
+               python-cairo-dbg
 X-Python-Version: >= 2.5
 Standards-Version: 3.9.1
 Vcs-Svn: svn://svn.debian.org/svn/pkg-gnome/desktop/unstable/pygobject

Modified: desktop/experimental/pygobject/debian/control.in
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/control.in?rev=27066&op=diff
==============================================================================
--- desktop/experimental/pygobject/debian/control.in [utf-8] (original)
+++ desktop/experimental/pygobject/debian/control.in [utf-8] Thu Mar 24 13:43:08 2011
@@ -5,6 +5,7 @@
 Uploaders: @GNOME_TEAM@
 Build-Depends: debhelper (>= 7),
                gnome-pkg-tools (>= 0.10),
+               dh-autoreconf,
                cdbs (>= 0.4.90~),
                quilt,
                python-all-dev (>= 2.6.6-3~),
@@ -15,9 +16,13 @@
                libgirepository1.0-dev (>= 0.10.2),
                python-cairo-dev (>= 1.2.0),
                xsltproc,
+               xvfb,
+               dbus-x11,
                docbook-xsl,
                autotools-dev,
                python-all-dbg,
+               python-apt-dbg,
+               python-cairo-dbg
 X-Python-Version: >= 2.5
 Standards-Version: 3.9.1
 Vcs-Svn: svn://svn.debian.org/svn/pkg-gnome/desktop/unstable/pygobject

Added: desktop/experimental/pygobject/debian/patches/50_gio_tests_for_separate_build_tree.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/patches/50_gio_tests_for_separate_build_tree.patch?rev=27066&op=file
==============================================================================
--- desktop/experimental/pygobject/debian/patches/50_gio_tests_for_separate_build_tree.patch (added)
+++ desktop/experimental/pygobject/debian/patches/50_gio_tests_for_separate_build_tree.patch [utf-8] Thu Mar 24 13:43:08 2011
@@ -1,0 +1,85 @@
+From 178df3e438835bec9b40dea243867784dee35815 Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt at ubuntu.com>
+Date: Tue, 22 Mar 2011 13:21:27 +0100
+Subject: [PATCH] GIO tests: Fix for separate build tree
+
+When using a separate build tree, "test_gio.py" is not in the current working
+dir (which is the build tree), but in the srcdir. Use __file__ instead.
+---
+ tests/test_gio.py |   14 +++++++-------
+ 1 files changed, 7 insertions(+), 7 deletions(-)
+
+Index: pygobject-2.28.0/tests/test_gio.py
+===================================================================
+--- pygobject-2.28.0.orig/tests/test_gio.py	2011-03-08 00:55:32.000000000 +0100
++++ pygobject-2.28.0/tests/test_gio.py	2011-03-22 13:47:55.277516915 +0100
+@@ -516,13 +516,13 @@
+ 
+ class TestGFileEnumerator(unittest.TestCase):
+     def setUp(self):
+-        self.file = gio.File(".")
++        self.file = gio.File(os.path.dirname(__file__))
+ 
+     def testEnumerateChildren(self):
+         enumerator = self.file.enumerate_children(
+             "standard::*", gio.FILE_QUERY_INFO_NOFOLLOW_SYMLINKS)
+         for file_info in enumerator:
+-            if file_info.get_name() == 'test_gio.py':
++            if file_info.get_name() == os.path.basename(__file__):
+                 break
+         else:
+             raise AssertionError
+@@ -531,7 +531,7 @@
+         def callback(gfile, result):
+             try:
+                 for file_info in gfile.enumerate_children_finish(result):
+-                    if file_info.get_name() == 'test_gio.py':
++                    if file_info.get_name() == __file__:
+                         break
+                 else:
+                     raise AssertionError
+@@ -547,7 +547,7 @@
+         def callback(enumerator, result):
+             try:
+                 for file_info in enumerator.next_files_finish(result):
+-                    if file_info.get_name() == 'test_gio.py':
++                    if file_info.get_name() == __file__:
+                         break
+                 else:
+                     raise AssertionError
+@@ -594,7 +594,7 @@
+         self.assertEquals(self.stream.read(), '')
+ 
+         self.stream = gio.MemoryInputStream()
+-        some_data = open("test_gio.py", "rb").read()
++        some_data = open(__file__, "rb").read()
+         self.stream.add_data(some_data)
+         self.assertEquals(self.stream.read(), some_data)
+ 
+@@ -631,7 +631,7 @@
+                           'testing')
+ 
+         stream = gio.MemoryInputStream()
+-        some_data = open('test_gio.py', 'rb').read()
++        some_data = open(__file__, 'rb').read()
+         stream.add_data(some_data)
+         self.assertEquals(self._read_in_loop(stream,
+                                              lambda: stream.read_part(50),
+@@ -807,7 +807,7 @@
+ 
+     def test_write_part(self):
+         stream = gio.MemoryOutputStream()
+-        some_data = open('test_gio.py', 'rb').read()
++        some_data = open(__file__, 'rb').read()
+         buffer = some_data
+ 
+         # In fact this makes only one looping (memory stream is fast,
+@@ -963,7 +963,7 @@
+ 
+ class TestFileInfo(unittest.TestCase):
+     def setUp(self):
+-        self.fileinfo = gio.File("test_gio.py").query_info("*")
++        self.fileinfo = gio.File(__file__).query_info("*")
+ 
+     def testListAttributes(self):
+         attributes = self.fileinfo.list_attributes("standard")

Added: desktop/experimental/pygobject/debian/patches/51_gschema_tests_for_separate_build_tree.patch
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/patches/51_gschema_tests_for_separate_build_tree.patch?rev=27066&op=file
==============================================================================
--- desktop/experimental/pygobject/debian/patches/51_gschema_tests_for_separate_build_tree.patch (added)
+++ desktop/experimental/pygobject/debian/patches/51_gschema_tests_for_separate_build_tree.patch [utf-8] Thu Mar 24 13:43:08 2011
@@ -1,0 +1,46 @@
+From cd38572b9781502d3228e74c017cb7cc39a07b3d Mon Sep 17 00:00:00 2001
+From: Martin Pitt <martin.pitt at ubuntu.com>
+Date: Tue, 22 Mar 2011 15:04:01 +0100
+Subject: [PATCH] Fix GSchema tests for separate build tree
+
+When using a separate build tree, the compiled GSettings schema will be in the
+build tree, but as the test scripts are only in the source tree they won't find
+the compiled schema. Pass the build dir as environment variable and prefer it
+over test_overrides.py's directory.
+---
+ tests/Makefile.am       |    3 ++-
+ tests/test_overrides.py |    4 +++-
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index 9cdb57f..bad15f0 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -116,7 +116,8 @@ RUN_TESTS_ENV_VARS= \
+ 	PYTHONPATH=$(top_builddir):$(top_builddir)/tests:$${PYTHONPATH:+:$$PYTHONPATH} \
+ 	LD_LIBRARY_PATH=$(builddir)/.libs:$$LD_LIBRARY_PATH \
+ 	GI_TYPELIB_PATH=$(builddir):$$GI_TYPELIB_PATH \
+-	XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share
++	XDG_DATA_DIRS=$$XDG_DATA_DIRS:/usr/share \
++	TESTS_BUILDDIR=$(builddir)
+ RUN_TESTS_LAUNCH=$(RUN_TESTS_ENV_VARS) $(DBUS_LAUNCH) $(EXEC_NAME) $(PYTHON) $(srcdir)/runtests.py
+ 
+ # run tests in separately to avoid loading static and introspection bindings in the same process
+diff --git a/tests/test_overrides.py b/tests/test_overrides.py
+index ea28d18..3421c3a 100644
+--- a/tests/test_overrides.py
++++ b/tests/test_overrides.py
+@@ -1383,7 +1383,9 @@ class TestGtk(unittest.TestCase):
+ class TestGio(unittest.TestCase):
+     def setUp(self):
+         os.environ['GSETTINGS_BACKEND'] = 'memory'
+-        os.environ['GSETTINGS_SCHEMA_DIR'] = os.path.dirname(__file__)
++        # support a separate build tree, so look in build dir first
++        os.environ['GSETTINGS_SCHEMA_DIR'] = os.environ.get('TESTS_BUILDDIR', 
++                os.path.dirname(__file__))
+         self.settings = Gio.Settings('org.gnome.test')
+         # we change the values in the tests, so set them to predictable start
+         # value
+-- 
+1.7.4.1
+

Modified: desktop/experimental/pygobject/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/patches/series?rev=27066&op=diff
==============================================================================
--- desktop/experimental/pygobject/debian/patches/series [utf-8] (original)
+++ desktop/experimental/pygobject/debian/patches/series [utf-8] Thu Mar 24 13:43:08 2011
@@ -1,1 +1,3 @@
 20_deprecated_spam.patch
+50_gio_tests_for_separate_build_tree.patch
+51_gschema_tests_for_separate_build_tree.patch

Modified: desktop/experimental/pygobject/debian/rules
URL: http://svn.debian.org/wsvn/pkg-gnome/desktop/experimental/pygobject/debian/rules?rev=27066&op=diff
==============================================================================
--- desktop/experimental/pygobject/debian/rules [utf-8] (original)
+++ desktop/experimental/pygobject/debian/rules [utf-8] Thu Mar 24 13:43:08 2011
@@ -28,24 +28,10 @@
 
 patch-stamp:
 	dh_testdir
-	# backup the original files to restore them in the clean target
-	[ ! -r config.sub ]   || \
-	    (cp config.sub   config.sub.orig   && \
-	     cp /usr/share/misc/config.sub   config.sub)
-	[ ! -r config.guess ] || \
-	    (cp config.guess config.guess.orig && \
-	     cp /usr/share/misc/config.guess config.guess)
+	dh_autoreconf
 	touch $@
 
 patch: patch-stamp
-
-unpatch:
-	rm -f patch-stamp
-	# restore files from backup (before unpatching)
-	[ ! -r config.sub.orig ]   || \
-	    cp config.sub.orig   config.sub
-	[ ! -r config.guess.orig ]   || \
-	    cp config.guess.orig config.guess
 
 build-%/configure-stamp: patch-stamp
 	dh_testdir
@@ -76,11 +62,17 @@
 build: $(PYVERS:%=build-%/build-stamp) $(PYVERS:%=dbg-build-%/build-stamp)
 
 build-%/check-stamp: build-%/build-stamp
-	-PYTHON=/usr/bin/python$* $(MAKE) -C build-$* check
+	find gi glib gobject gio -name '*.py' -exec cp '$(CURDIR)/{}' build-$*/'{}' \;
+	# don't run the tests under fakeroot, otherwise they will try to
+	# connect to root's session D-BUS
+	-PYTHON=/usr/bin/python$* LD_PRELOAD= xvfb-run $(MAKE) -C build-$* check
 	touch $@
 
 dbg-build-%/check-stamp: dbg-build-%/build-stamp
-	-PYTHON=/usr/bin/python$*-dbg $(MAKE) -C dbg-build-$* check
+	find gi glib gobject gio -name '*.py' -exec cp '$(CURDIR)/{}' dbg-build-$*/'{}' \;
+	# don't run the tests under fakeroot, otherwise they will try to
+	# connect to root's session D-BUS
+	-PYTHON=/usr/bin/python$*-dbg LD_PRELOAD= xvfb-run $(MAKE) -C dbg-build-$* check
 	touch $@
 
 check: $(PYVERS:%=build-%/check-stamp) $(PYVERS:%=dbg-build-%/check-stamp)
@@ -136,8 +128,9 @@
 	dh_testdir
 	dh_testroot
 	rm -f install-stamp
+	rm -f patch-stamp
 	rm -rf build-* dbg-build-*
-	$(MAKE) -f debian/rules unpatch
+	dh_autoreconf_clean
 	dh_clean *.pyc */*.pyc
 
 maybe_check = $(if $(findstring nocheck,$(DEB_BUILD_OPTIONS)),,check)
@@ -182,4 +175,4 @@
 	dh_builddeb -s
 
 binary: binary-arch binary-indep
-.PHONY: patch unpatch build check install clean binary-indep binary-arch binary
+.PHONY: patch build check install clean binary-indep binary-arch binary




More information about the pkg-gnome-commits mailing list