diff options
author | Pacho Ramos <pacho@gentoo.org> | 2011-01-28 19:39:18 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2011-01-28 19:39:18 +0000 |
commit | b206c9283edba3816861bb2f15e8e19eed2e7d04 (patch) | |
tree | 8416ad78b260bc7a9fe7d1d523ec07448d3d7ad9 /dev-python/pygobject | |
parent | x86 stable per bug 351345 (diff) | |
download | gentoo-2-b206c9283edba3816861bb2f15e8e19eed2e7d04.tar.gz gentoo-2-b206c9283edba3816861bb2f15e8e19eed2e7d04.tar.bz2 gentoo-2-b206c9283edba3816861bb2f15e8e19eed2e7d04.zip |
Fix building without threads and dependency on python (thanks a lot to Arfrever Frehtes Taifersar Arahesis for his help).
(Portage version: 2.1.9.35/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/pygobject')
-rw-r--r-- | dev-python/pygobject/ChangeLog | 7 | ||||
-rw-r--r-- | dev-python/pygobject/files/pygobject-2.26.0-disabled-threads.patch | 81 | ||||
-rw-r--r-- | dev-python/pygobject/pygobject-2.26.0-r1.ebuild | 10 |
3 files changed, 94 insertions, 4 deletions
diff --git a/dev-python/pygobject/ChangeLog b/dev-python/pygobject/ChangeLog index e4588d2a12b3..25f9cda1eb5e 100644 --- a/dev-python/pygobject/ChangeLog +++ b/dev-python/pygobject/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for dev-python/pygobject # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/ChangeLog,v 1.107 2011/01/27 19:05:25 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/ChangeLog,v 1.108 2011/01/28 19:39:18 pacho Exp $ + + 28 Jan 2011; Pacho Ramos <pacho@gentoo.org> pygobject-2.26.0-r1.ebuild, + +files/pygobject-2.26.0-disabled-threads.patch: + Fix building without threads and dependency on python (thanks a lot to + Arfrever Frehtes Taifersar Arahesis for his help). 27 Jan 2011; Pacho Ramos <pacho@gentoo.org> pygobject-2.26.0-r1.ebuild: dev-python/pygobject always needs python with threads support as reported by diff --git a/dev-python/pygobject/files/pygobject-2.26.0-disabled-threads.patch b/dev-python/pygobject/files/pygobject-2.26.0-disabled-threads.patch new file mode 100644 index 000000000000..e9f3a4e09c54 --- /dev/null +++ b/dev-python/pygobject/files/pygobject-2.26.0-disabled-threads.patch @@ -0,0 +1,81 @@ +From a4b210d69c832629894090b7154ae194209b0c60 Mon Sep 17 00:00:00 2001 +From: Arnaud Charlet <charlet@adacore.com> +Date: Tue, 18 Jan 2011 17:31:29 +0000 +Subject: Disable calls to PyGILState_* when threads are disabled + +Since threads may also be disabled in Python too, those symbols may not +be resolved. + +https://bugzilla.gnome.org/show_bug.cgi?id=374603 +--- +diff --git a/glib/pyglib.c b/glib/pyglib.c +index 8163e88..1e024c2 100644 +--- a/glib/pyglib.c ++++ b/glib/pyglib.c +@@ -94,7 +94,11 @@ pyglib_gil_state_ensure(void) + if (!_PyGLib_API->threads_enabled) + return PyGILState_LOCKED; + ++#ifdef DISABLE_THREADING ++ return PyGILState_LOCKED; ++#else + return PyGILState_Ensure(); ++#endif + } + + void +@@ -105,7 +109,9 @@ pyglib_gil_state_release(PyGILState_STATE state) + if (!_PyGLib_API->threads_enabled) + return; + ++#ifndef DISABLE_THREADING + PyGILState_Release(state); ++#endif + } + + /** +@@ -171,13 +177,19 @@ _pyglib_notify_on_enabling_threads(PyGLibThreadsEnabledFunc callback) + int + pyglib_gil_state_ensure_py23 (void) + { ++#ifdef DISABLE_THREADING ++ return 0; ++#else + return PyGILState_Ensure(); ++#endif + } + + void + pyglib_gil_state_release_py23 (int flag) + { ++#ifndef DISABLE_THREADING + PyGILState_Release(flag); ++#endif + } + + /** +diff --git a/gobject/pygobject-private.h b/gobject/pygobject-private.h +index ae4cfe1..a928cb1 100644 +--- a/gobject/pygobject-private.h ++++ b/gobject/pygobject-private.h +@@ -32,12 +32,18 @@ extern struct _PyGObject_Functions pygobject_api_functions; + + #define pyg_threads_enabled (pygobject_api_functions.threads_enabled) + ++#ifdef DISABLE_THREADING ++#define pyg_gil_state_ensure() 0 ++#define pyg_gil_state_release(state) G_STMT_START { \ ++ } G_STMT_END + ++#else + #define pyg_gil_state_ensure() (pygobject_api_functions.threads_enabled? (PyGILState_Ensure()) : 0) + #define pyg_gil_state_release(state) G_STMT_START { \ + if (pygobject_api_functions.threads_enabled) \ + PyGILState_Release(state); \ + } G_STMT_END ++#endif + + #define pyg_begin_allow_threads \ + G_STMT_START { \ +-- +cgit v0.8.3.1 diff --git a/dev-python/pygobject/pygobject-2.26.0-r1.ebuild b/dev-python/pygobject/pygobject-2.26.0-r1.ebuild index 8b26ff5b1030..3bdeed882783 100644 --- a/dev-python/pygobject/pygobject-2.26.0-r1.ebuild +++ b/dev-python/pygobject/pygobject-2.26.0-r1.ebuild @@ -1,13 +1,13 @@ # Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/pygobject-2.26.0-r1.ebuild,v 1.4 2011/01/27 19:05:25 pacho Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pygobject/pygobject-2.26.0-r1.ebuild,v 1.5 2011/01/28 19:39:18 pacho Exp $ EAPI="2" GCONF_DEBUG="no" SUPPORT_PYTHON_ABIS="1" PYTHON_DEPEND="2:2.5" RESTRICT_PYTHON_ABIS="2.4 3.* *-jython" -PYTHON_USE_WITH="threads" # Needed until upstream bug 640748 is fixed +PYTHON_USE_WITH="threads=" inherit alternatives autotools gnome2 python virtualx @@ -17,7 +17,7 @@ HOMEPAGE="http://www.pygtk.org/" LICENSE="LGPL-2.1" SLOT="2" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sh ~sparc ~x86 ~x86-fbsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris" -IUSE="doc cairo examples +introspection libffi test" +IUSE="doc cairo examples +introspection libffi test threads" RDEPEND=">=dev-libs/glib-2.22.4:2 !<dev-python/pygtk-2.13 @@ -41,6 +41,7 @@ pkg_setup() { $(use_enable doc docs) $(use_enable cairo) $(use_enable introspection) + $(use_enable threads thread) $(use_with libffi ffi)" } @@ -62,6 +63,9 @@ src_prepare() { # Fix crash in instance property; bug# 344459 epatch "${FILESDIR}/${PN}-2.26.0-nocrash.patch" + # Disable calls to PyGILState_* when threads are disabled + epatch "${FILESDIR}/${PN}-2.26.0-disabled-threads.patch" + # disable pyc compiling mv py-compile py-compile.orig ln -s $(type -P true) py-compile |