Package: libpeas Version: 1.4.0-2 Severity: normal -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Dear Maintainer, Upstream libpeas supports both Python 2 and Python 3. As part of our effort in Ubuntu to promote Python 3, we'd like to be able to load Python 3 libpeas plugins. Enabling Python 3 plugins is a fairly simple matter of recompiling the libpeas with $PYTHON=python3. We want to prevent using both Python 2 and Python 3 plugins in the same application, but of course we want to continue to allow different applications on the same system to use either Python 2 or Python 3. Fortunately, we can do this without any changes to the code. The approach taken here is to essentially build libpeas twice, into two separatre build directories. The first build is the normal one, which builds the Python 2 version. The second build builds into tmp-py3, but the only thing we need from the second build is the libpythonloader.so, which must be renamed to libpython3loader.so. This allows an application to enable both the Python 2 and Python 3 loader, but the first one loaded wins. You can see how this works by running the peas-demo program. After loading either the Python 2 or Python 3 plugin, the second one will properly fail to load, without causing any other problems. Hopefully the changes in the debdiff make sense. Thanks to Dmitrij Ledkovs for helping figure out the cdbs flavors magic. - -- System Information: Debian Release: wheezy/sid APT prefers precise-updates APT policy: (500, 'precise-updates'), (500, 'precise-security'), (500, 'precise'), (100, 'precise-backports') Architecture: amd64 (x86_64) Kernel: Linux 3.2.0-25-generic (SMP w/8 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAEBCAAGBQJP4ox3AAoJEBJutWOnSwa/4d0P/1ED6J4NAJKtFqGqzueXE5wS 3cuDanZOEFNzA0RtnHxt/CpE2+qPQfbwgziwRiAs4RwBiL6tdDCvJaXg4NFcoDo+ UGYmW/iv20LmklqiUEVWsYy+b5tB4uqHHV/Qz6QlMdL7NZtYrYKymShUnxeD196D vcit8tVk7h6+N0WKkNbywJwOWaq71FdT0TV7PcJHadYQo+q6j7f4i2qOpgu3VKUE X6i9sYYYWTQug5E4MdlT2kND10sYDCaiX2otHXcgvCQORqIEjKULsahiosmON756 vkeSw6i5JFRZ5CrzfbSysaoVtnJ/SQDXcjrBG4+H6QQRIZoWn7Ra88HVb/kqxver 6LaJeup2xhlr7BcLlyfIz4YTZneVB88mkNuMbbnpXSEhw3GbCPsJMNzOhI7Lz6G1 b09PJgtceBbfriKOfzlf9nJB/B7M0zz2LriYvvHi26g6mRGTm4jeH/QidnLxUcDj PMmIDqFfRg5BdOicfV9jtm8mcKPyI07JIpvyvB12KlSoW1jY0ff5FnuAGL8JSJWo hsYHYwVxPEOz5QH79QZVOGFypHUkm3cF1N96C2ifvgyM61+fBLetvM7FpMCmnMWM V7RS+2gO/s7IkqydVN1b8/aXF1eUXr4w/hylF3NSBE+MlUn3R6Drv0iLwI+kf62T UJ1YjfnaaCgjXIIDtVWr =MvZR -----END PGP SIGNATURE-----
diff -Nru libpeas-1.4.0/debian/changelog libpeas-1.4.0/debian/changelog --- libpeas-1.4.0/debian/changelog 2012-05-28 00:40:22.000000000 -0400 +++ libpeas-1.4.0/debian/changelog 2012-06-20 22:31:30.000000000 -0400 @@ -1,3 +1,11 @@ +libpeas (1.4.0-2ubuntu2) quantal; urgency=low + + * Build the Python 3 plugin, and enable it to exist next to the Python 2 + plugin (though only one can be used by an application at a time). Add + Python 3 support to peas-demo. + + -- Barry Warsaw <ba...@ubuntu.com> Tue, 19 Jun 2012 11:16:15 -0400 + libpeas (1.4.0-2ubuntu1) quantal; urgency=low * Merge with Debian unstable, remaining Ubuntu changes: diff -Nru libpeas-1.4.0/debian/control libpeas-1.4.0/debian/control --- libpeas-1.4.0/debian/control 2012-06-20 22:33:01.000000000 -0400 +++ libpeas-1.4.0/debian/control 2012-06-20 22:31:35.000000000 -0400 @@ -10,6 +10,8 @@ Uploaders: Debian GNOME Maintainers <pkg-gnome-maintain...@lists.alioth.debian.org>, Michael Biebl <bi...@debian.org>, Sjoerd Simons <sjo...@debian.org> Build-Depends: cdbs (>= 0.4.90), debhelper (>= 8), + quilt, + autoconf, gnome-pkg-tools, intltool (>= 0.40), gtk-doc-tools (>= 1.11), @@ -20,6 +22,7 @@ libgtk-3-dev, python-dev (>= 2.5.2), python-gi-dev (>= 3.0.0), + python3-dev, valac-0.14, gnome-icon-theme Standards-Version: 3.9.3 diff -Nru libpeas-1.4.0/debian/control.in libpeas-1.4.0/debian/control.in --- libpeas-1.4.0/debian/control.in 2012-05-28 00:40:22.000000000 -0400 +++ libpeas-1.4.0/debian/control.in 2012-06-20 17:14:04.000000000 -0400 @@ -5,6 +5,8 @@ Uploaders: @GNOME_TEAM@ Build-Depends: cdbs (>= 0.4.90), debhelper (>= 8), + quilt, + autoconf, gnome-pkg-tools, intltool (>= 0.40), gtk-doc-tools (>= 1.11), @@ -15,6 +17,7 @@ libgtk-3-dev, python-dev (>= 2.5.2), python-gi-dev (>= 3.0.0), + python3-dev, valac-0.14, gnome-icon-theme Standards-Version: 3.9.3 diff -Nru libpeas-1.4.0/debian/patches/python3-demo.patch libpeas-1.4.0/debian/patches/python3-demo.patch --- libpeas-1.4.0/debian/patches/python3-demo.patch 1969-12-31 19:00:00.000000000 -0500 +++ libpeas-1.4.0/debian/patches/python3-demo.patch 2012-06-20 20:25:35.000000000 -0400 @@ -0,0 +1,154 @@ +Description: Add Python 3 demo. + This patch mostly just copies the existing Python plugin demo, but tweaks the + visible strings to show how a Python 2 or Python 3 (but not both) plugin can + be used in a single application. +Author: Barry Warsaw <ba...@python.org> +Forwarded: no + +--- a/peas-demo/peas-demo.c ++++ b/peas-demo/peas-demo.c +@@ -126,6 +126,7 @@ + + peas_engine_enable_loader (engine, "gjs"); + peas_engine_enable_loader (engine, "python"); ++ peas_engine_enable_loader (engine, "python3"); + peas_engine_enable_loader (engine, "seed"); + + if (run_from_build_dir) +--- /dev/null ++++ b/peas-demo/plugins/python3hello/Makefile.am +@@ -0,0 +1,8 @@ ++plugindir = $(libdir)/peas-demo/plugins/python3hello ++ ++plugin_PYTHON = \ ++ python3hello.py ++ ++plugin_DATA = python3hello.plugin ++ ++EXTRA_DIST = $(plugin_DATA) +--- /dev/null ++++ b/peas-demo/plugins/python3hello/python3hello.plugin +@@ -0,0 +1,13 @@ ++[Plugin] ++Module=python3hello ++Loader=python3 ++IAge=2 ++Name=Python 3 Says Hello ++Description=Inserts a box containing "Python 3 Says Hello" in every windows. ++Authors=Steve Frécinaux <c...@istique.net> ++Copyright=Copyright © 2009 Steve Frécinaux ++Website=http://code.istique.net/ ++Help=http://git.gnome.org/browse/error ++Help-Windows=http://git.gnome.org/browse/libpeas ++Help-MacOS-X=http://git.gnome.org/browse/libpeas ++Help-GNOME=http://git.gnome.org/browse/libpeas +--- /dev/null ++++ b/peas-demo/plugins/python3hello/python3hello.py +@@ -0,0 +1,61 @@ ++# -*- coding: utf-8 -*- ++# ex:set ts=4 et sw=4 ai: ++ ++## ++# python3hello.py ++# This file is part of libpeas ++# ++# Copyright (C) 2009-2010 Steve Frécinaux ++# ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU Library General Public License as published by ++# the Free Software Foundation; either version 2 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU Library General Public License for more details. ++# ++# You should have received a copy of the GNU Library General Public License ++# along with this program; if not, write to the Free Software ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++## ++ ++import sys ++ ++from gi.repository import GObject ++from gi.repository import Peas ++from gi.repository import PeasGtk ++from gi.repository import Gtk ++ ++LABEL_STRING="Python {}.{} Says Hello!".format(*sys.version_info[:2]) ++ ++class Python3HelloPlugin(GObject.Object, Peas.Activatable): ++ __gtype_name__ = 'Python3HelloPlugin' ++ ++ object = GObject.property(type=GObject.Object) ++ ++ def do_activate(self): ++ window = self.object ++ print("Python3HelloPlugin.do_activate", repr(window)) ++ window._pythonhello_label = Gtk.Label() ++ window._pythonhello_label.set_text(LABEL_STRING) ++ window._pythonhello_label.show() ++ window.get_child().pack_start(window._pythonhello_label, True, True, 0) ++ ++ def do_deactivate(self): ++ window = self.object ++ print("Python3HelloPlugin.do_deactivate", repr(window)) ++ window.get_child().remove(window._pythonhello_label) ++ window._pythonhello_label.destroy() ++ ++ def do_update_state(self): ++ print("Python3HelloPlugin.do_update_state", repr(self.object)) ++ ++class Python3HelloConfigurable(GObject.Object, PeasGtk.Configurable): ++ __gtype_name__ = 'Python3HelloConfigurable' ++ ++ def do_create_configure_widget(self): ++ return Gtk.Label.new("Python {}.{} Hello configure widget".format( ++ *sys.version_info[:2])) +--- a/peas-demo/plugins/Makefile.am ++++ b/peas-demo/plugins/Makefile.am +@@ -5,7 +5,7 @@ + endif + + if ENABLE_PYTHON +-SUBDIRS += pythonhello ++SUBDIRS += pythonhello python3hello + endif + + if ENABLE_SEED +--- a/configure.ac ++++ b/configure.ac +@@ -490,6 +490,7 @@ + peas-demo/plugins/gjshello/Makefile + peas-demo/plugins/helloworld/Makefile + peas-demo/plugins/pythonhello/Makefile ++peas-demo/plugins/python3hello/Makefile + peas-demo/plugins/secondtime/Makefile + peas-demo/plugins/seedhello/Makefile + peas-demo/plugins/valahello/Makefile +--- a/peas-demo/plugins/pythonhello/pythonhello.py ++++ b/peas-demo/plugins/pythonhello/pythonhello.py +@@ -22,12 +22,14 @@ + # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + ## + ++import sys ++ + from gi.repository import GObject + from gi.repository import Peas + from gi.repository import PeasGtk + from gi.repository import Gtk + +-LABEL_STRING="Python Says Hello!" ++LABEL_STRING="Python {}.{} Says Hello!".format(*sys.version_info[:2]) + + class PythonHelloPlugin(GObject.Object, Peas.Activatable): + __gtype_name__ = 'PythonHelloPlugin' +@@ -55,4 +57,5 @@ + __gtype_name__ = 'PythonHelloConfigurable' + + def do_create_configure_widget(self): +- return Gtk.Label.new("Python Hello configure widget") ++ return Gtk.Label.new("Python {}.{} Hello configure widget".format( ++ *sys.version_info[:2])) diff -Nru libpeas-1.4.0/debian/patches/series libpeas-1.4.0/debian/patches/series --- libpeas-1.4.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 +++ libpeas-1.4.0/debian/patches/series 2012-06-19 10:57:37.000000000 -0400 @@ -0,0 +1 @@ +python3-demo.patch diff -Nru libpeas-1.4.0/debian/rules libpeas-1.4.0/debian/rules --- libpeas-1.4.0/debian/rules 2012-05-28 00:40:22.000000000 -0400 +++ libpeas-1.4.0/debian/rules 2012-06-20 17:13:03.000000000 -0400 @@ -1,15 +1,37 @@ #!/usr/bin/make -f +DEB_MAKE_FLAVORS = py2 py3 +DEB_BUILDDIR = build +DEB_MAKE_DESTDIRSKEL_py2 = $(CURDIR)/debian/tmp +DEB_MAKE_DESTDIRSKEL_py3 = $(CURDIR)/debian/tmp-py3 + include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/class/gnome.mk include /usr/share/cdbs/1/rules/utils.mk +include /usr/share/cdbs/1/rules/patchsys-quilt.mk include /usr/share/gnome-pkg-tools/1/rules/uploaders.mk include /usr/share/gnome-pkg-tools/1/rules/gnome-get-source.mk -DEB_CONFIGURE_EXTRA_FLAGS += --enable-gtk-doc \ - --enable-vala \ - --enable-python \ - --disable-gjs +debian/stamp-autotools/py2:: DEB_CONFIGURE_SCRIPT_ENV=PYTHON=python + +DEB_CONFIGURE_FLAGS_py2 += --enable-gtk-doc \ + --enable-vala \ + --enable-python \ + --disable-gjs + +debian/stamp-autotools/py3:: DEB_CONFIGURE_SCRIPT_ENV=PYTHON=python3 + +DEB_CONFIGURE_FLAGS_py3 += --disable-gtk-doc \ + --disable-vala \ + --enable-python \ + --disable-gjs + +makebuilddir:: + autoreconf + +common-install-arch:: + cp -a debian/tmp-py3/usr/lib/libpeas-1.0/loaders/libpythonloader.so \ + debian/tmp/usr/lib/libpeas-1.0/loaders/libpython3loader.so # Seed disabled since not in main #ifeq (,$(filter $(DEB_HOST_ARCH),ia64 mips))