diff options
author | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2011-04-09 20:31:07 +0000 |
---|---|---|
committer | Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> | 2011-04-09 20:31:07 +0000 |
commit | 125668919c8d5bda079760cce96c965556d06f74 (patch) | |
tree | 92bb4fc041295c56bc7e13687812f71ea4da7131 /dev-python/greenlet | |
parent | Fix some net_unittests failures, bug #361939. (diff) | |
download | gentoo-2-125668919c8d5bda079760cce96c965556d06f74.tar.gz gentoo-2-125668919c8d5bda079760cce96c965556d06f74.tar.bz2 gentoo-2-125668919c8d5bda079760cce96c965556d06f74.zip |
Fix building with Python 3.2 (bug #343385).
(Portage version: 2.2.0_alpha29_p10/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/greenlet')
-rw-r--r-- | dev-python/greenlet/ChangeLog | 8 | ||||
-rw-r--r-- | dev-python/greenlet/files/greenlet-0.3.1-python-3.2.patch | 50 | ||||
-rw-r--r-- | dev-python/greenlet/greenlet-0.3.1.ebuild | 12 |
3 files changed, 65 insertions, 5 deletions
diff --git a/dev-python/greenlet/ChangeLog b/dev-python/greenlet/ChangeLog index 4a3f16343972..84a3ef17ac10 100644 --- a/dev-python/greenlet/ChangeLog +++ b/dev-python/greenlet/ChangeLog @@ -1,6 +1,10 @@ # ChangeLog for dev-python/greenlet -# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/greenlet/ChangeLog,v 1.1 2010/10/18 15:14:07 arfrever Exp $ +# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/greenlet/ChangeLog,v 1.2 2011/04/09 20:31:07 arfrever Exp $ + + 09 Apr 2011; Arfrever Frehtes Taifersar Arahesis <arfrever@gentoo.org> + greenlet-0.3.1.ebuild, +files/greenlet-0.3.1-python-3.2.patch: + Fix building with Python 3.2 (bug #343385). *greenlet-0.3.1 (18 Oct 2010) diff --git a/dev-python/greenlet/files/greenlet-0.3.1-python-3.2.patch b/dev-python/greenlet/files/greenlet-0.3.1-python-3.2.patch new file mode 100644 index 000000000000..d4b158b54016 --- /dev/null +++ b/dev-python/greenlet/files/greenlet-0.3.1-python-3.2.patch @@ -0,0 +1,50 @@ +https://bitbucket.org/ambroff/greenlet/changeset/f61fffb6feeb + +--- greenlet.c ++++ greenlet.c +@@ -1267,7 +1267,11 @@ + _PyGreenlet_API[PyGreenlet_SetParent_NUM] = + (void *) PyGreenlet_SetParent; + ++#ifdef GREENLET_USE_PYCAPSULE ++ c_api_object = PyCapsule_New((void *) _PyGreenlet_API, "greenlet._C_API", NULL); ++#else + c_api_object = PyCObject_FromVoidPtr((void *) _PyGreenlet_API, NULL); ++#endif + if (c_api_object != NULL) + { + PyModule_AddObject(m, "_C_API", c_api_object); +--- greenlet.h ++++ greenlet.h +@@ -31,6 +31,10 @@ + #define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL) + #define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent) + ++#if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 7) || (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 1) || PY_MAJOR_VERSION > 3 ++#define GREENLET_USE_PYCAPSULE ++#endif ++ + /* C API functions */ + + /* Total number of symbols that are exported */ +@@ -108,6 +112,12 @@ + _PyGreenlet_API[PyGreenlet_SetParent_NUM]) + + /* Macro that imports greenlet and initializes C API */ ++#ifdef GREENLET_USE_PYCAPSULE ++#define PyGreenlet_Import() \ ++{ \ ++ _PyGreenlet_API = (void**)PyCapsule_Import("greenlet._C_API", 0); \ ++} ++#else + #define PyGreenlet_Import() \ + { \ + PyObject *module = PyImport_ImportModule("greenlet"); \ +@@ -122,6 +132,7 @@ + Py_DECREF(module); \ + } \ + } ++#endif + + #endif /* GREENLET_MODULE */ + diff --git a/dev-python/greenlet/greenlet-0.3.1.ebuild b/dev-python/greenlet/greenlet-0.3.1.ebuild index 0d4dacd12b57..c52320b084cc 100644 --- a/dev-python/greenlet/greenlet-0.3.1.ebuild +++ b/dev-python/greenlet/greenlet-0.3.1.ebuild @@ -1,12 +1,13 @@ -# Copyright 1999-2010 Gentoo Foundation +# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/greenlet/greenlet-0.3.1.ebuild,v 1.1 2010/10/18 15:14:07 arfrever Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/greenlet/greenlet-0.3.1.ebuild,v 1.2 2011/04/09 20:31:07 arfrever Exp $ EAPI="3" SUPPORT_PYTHON_ABIS="1" +RESTRICT_PYTHON_ABIS="*-jython" DISTUTILS_SRC_TEST="setup.py" -inherit distutils +inherit distutils eutils DESCRIPTION="Lightweight in-process concurrent programming" HOMEPAGE="http://pypi.python.org/pypi/greenlet" @@ -23,3 +24,8 @@ RDEPEND="" PYTHON_CFLAGS=("2.* + -fno-strict-aliasing") DOCS="AUTHORS NEWS README" + +src_prepare() { + distutils_src_prepare + epatch "${FILESDIR}/${P}-python-3.2.patch" +} |