summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPacho Ramos <pacho@gentoo.org>2011-01-28 19:39:18 +0000
committerPacho Ramos <pacho@gentoo.org>2011-01-28 19:39:18 +0000
commita7739de3e12d53845f067bfa7728d345f872f00a (patch)
tree2592ed78154386bae7593a1e944a1dcf797bca0f /dev-python/pygobject/files
parentUpdate eapi to 3. (diff)
downloadhistorical-a7739de3e12d53845f067bfa7728d345f872f00a.tar.gz
historical-a7739de3e12d53845f067bfa7728d345f872f00a.tar.bz2
historical-a7739de3e12d53845f067bfa7728d345f872f00a.zip
Fix building without threads and dependency on python (thanks a lot to Arfrever Frehtes Taifersar Arahesis for his help).
Package-Manager: portage-2.1.9.35/cvs/Linux x86_64
Diffstat (limited to 'dev-python/pygobject/files')
-rw-r--r--dev-python/pygobject/files/pygobject-2.26.0-disabled-threads.patch81
1 files changed, 81 insertions, 0 deletions
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