From 7837a76c344b64e925519dd5e26233bb3b648beb Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 3 Apr 2023 11:20:10 +0100 Subject: gentoo auto-resync : 03:04:2023 - 11:20:10 --- dev-python/cffi/Manifest | 2 + dev-python/cffi/cffi-1.15.1-r1.ebuild | 65 ++++++++++++++++++++++++++++ dev-python/cffi/files/cffi-1.15.1-hppa.patch | 59 +++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 dev-python/cffi/cffi-1.15.1-r1.ebuild create mode 100644 dev-python/cffi/files/cffi-1.15.1-hppa.patch (limited to 'dev-python/cffi') diff --git a/dev-python/cffi/Manifest b/dev-python/cffi/Manifest index 45d7480918e1..f58bc7b367e8 100644 --- a/dev-python/cffi/Manifest +++ b/dev-python/cffi/Manifest @@ -1,4 +1,6 @@ AUX cffi-1.14.0-darwin-no-brew.patch 568 BLAKE2B 43afdb086a0385e913f287bc5c1534df1b881058cf7efdfdecd9df063c27ebd26683edad43e3010e1c01d9d93c5d98785ffbe65a5e3317d96ebb6a3132aecdab SHA512 75335871b8f98223e0247defc3d08f1c10ebed58c79790826c4e39057e6757b8bdc07e2773ad25482ed17c13480b3e72b3667e48697a456ed0cc4a39e7d91b79 +AUX cffi-1.15.1-hppa.patch 2097 BLAKE2B 2cd3a1b155b71bcb3d70e3659950c45c36959f0c2090fe560d47bf60e53aa8a2df50dc3b713602c589e6bccecdef27230ee6cb800259bf275dbd052beff03da3 SHA512 ba320e8cb56b58066a44162c8a176d167b4a05a760451a0e0821969cd2ad8fff50e54d54ec8f8c4f93ee1a2e3e71467c7c2d6d94c593ec21892e7d03fdf7c50d DIST cffi-1.15.1.tar.gz 508501 BLAKE2B accc317385d9af7dbed3397afde63fbab63bfc935376d951802055c63796863ed102a940f192789924480b9b16751c8cf3d21caf9b262c479c61ffc977aac83c SHA512 e99cafcb029076abc29e435b490fa0573ee2856f4051b7ca8a5b38cd125d56dd9dae8b189f59ceb3d728a675da8ee83239e09e19f8b0feeddea4b186ab5173a5 +EBUILD cffi-1.15.1-r1.ebuild 1560 BLAKE2B 2b7d2e7a0861bbbcd45c0b0b3e5d879e7c1e4e7bd16aae0f98a0c6e61b76ccfb98b932e4ec8da51d5500e9cab6bc1f480c6a1e4df251bb1829e810b5c72172b8 SHA512 1e3ebcd9233c2ce0a4b8ea4ff25c7c48e52b7d8f0491b704791d184048437857e09a28214735f0946c35cc7f49a3af4a5b1d4177dc7f8509be3bc8cb9d1e1beb EBUILD cffi-1.15.1.ebuild 1521 BLAKE2B 53a54cc90257d8c11f9f72fd1b68c839ea7faa16a395a7a479ca19dfbb6f252e74bafdb97ac710de5c1807545bf89d381f8265e9103b132f51a85ab3bf75f36f SHA512 d5a0c25b2a443dfca09fa34cfe8f1a0228e47d025a7ae5a7421ed26be2ba6243b6068f9a13412277d94d273b60cc3c1c852adaa4f469472179b328180ef85f8d MISC metadata.xml 318 BLAKE2B f914459fac4ae3d8ac9273fb721c52494513b932676f570f02cc4cfb2283705d8cfc761806ffed23c6f31c95a967398edee01c1536547c1830def5ca4144c003 SHA512 ec451f8c535f0d01dc7bcd248c002745947982cd469a02ac247d0d34f4d7a33374fa10c28d8f074932f0548dc500c3270b499dd08b18acbb9d308777bcc7e4f0 diff --git a/dev-python/cffi/cffi-1.15.1-r1.ebuild b/dev-python/cffi/cffi-1.15.1-r1.ebuild new file mode 100644 index 000000000000..fc58f4f7e3fb --- /dev/null +++ b/dev-python/cffi/cffi-1.15.1-r1.ebuild @@ -0,0 +1,65 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# please keep this ebuild at EAPI 7 -- sys-apps/portage dep +EAPI=7 + +DISTUTILS_USE_PEP517=setuptools +# DO NOT ADD pypy to PYTHON_COMPAT +# pypy bundles a modified version of cffi. Use python_gen_cond_dep instead. +PYTHON_COMPAT=( python3_{9..11} ) + +inherit distutils-r1 toolchain-funcs pypi + +DESCRIPTION="Foreign Function Interface for Python calling C code" +HOMEPAGE=" + https://cffi.readthedocs.io/ + https://pypi.org/project/cffi/ +" + +LICENSE="MIT" +SLOT="0/${PV}" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" + +DEPEND=" + dev-libs/libffi:= +" +RDEPEND=" + ${DEPEND} + dev-python/pycparser[${PYTHON_USEDEP}] +" +BDEPEND=" + ${RDEPEND} + virtual/pkgconfig +" + +distutils_enable_sphinx doc/source +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}"/cffi-1.14.0-darwin-no-brew.patch + "${FILESDIR}"/${P}-hppa.patch +) + +src_prepare() { + if [[ ${CHOST} == *darwin* ]] ; then + # Don't obsessively try to find libffi + sed -i -e "s/.*\-iwithsysroot\/usr\/include\/ffi.*/\tpass/" setup.py || die + fi + distutils-r1_src_prepare +} + +src_configure() { + tc-export PKG_CONFIG +} + +python_test() { + local EPYTEST_IGNORE=( + # these tests call pip + testing/cffi0/test_zintegration.py + ) + + "${EPYTHON}" -c "import _cffi_backend as backend" || die + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 + epytest c testing +} diff --git a/dev-python/cffi/files/cffi-1.15.1-hppa.patch b/dev-python/cffi/files/cffi-1.15.1-hppa.patch new file mode 100644 index 000000000000..e185e7b93929 --- /dev/null +++ b/dev-python/cffi/files/cffi-1.15.1-hppa.patch @@ -0,0 +1,59 @@ +https://foss.heptapod.net/pypy/cffi/-/commit/ab11bfa551697cd2b61fdaa571c7975c06e6912c + +From ab11bfa551697cd2b61fdaa571c7975c06e6912c Mon Sep 17 00:00:00 2001 +From: John David Anglin +Date: Sun, 18 Dec 2022 14:52:04 -0500 +Subject: [PATCH] Fix the test failures on hppa + +A couple of years ago the libffi port for hppa-linux was changed from using a +trampoline executed on the stack to the function descriptor technique used by +ia64. This doesn't require an executable stack and is simpler. However, +function pointers need to have the PLABEL bit set in the pointer. As a result, +a simple cast can't be used to convert closure pointers to function pointers. + +python-cffi uses its own closure allocation so the problem can't be fixed in +libffi. + +I added a macro CFFI_FN to do the conversion. It shouldn't affect other +architectures. There is a similar define in libffi. + +Fixes: https://bugs.debian.org/1024271 + +--HG-- +branch : hppa +--- a/c/_cffi_backend.c ++++ b/c/_cffi_backend.c +@@ -60,6 +60,13 @@ + # endif + #endif + ++/* Convert from closure pointer to function pointer. */ ++#if defined(__hppa__) && !defined(__LP64__) ++#define CFFI_FN(f) ((void (*)(void))((unsigned int)(f) | 2)) ++#else ++#define CFFI_FN(f) ((void (*)(void))f) ++#endif ++ + + /* Define the following macro ONLY if you trust libffi's version of + * ffi_closure_alloc() more than the code in malloc_closure.h. +@@ -3191,7 +3198,7 @@ cdata_call(CDataObject *cd, PyObject *args, PyObject *kwds) + + Py_BEGIN_ALLOW_THREADS + restore_errno(); +- ffi_call(&cif_descr->cif, (void (*)(void))(cd->c_data), ++ ffi_call(&cif_descr->cif, (void (*)(void)) CFFI_FN(cd->c_data), + resultdata, buffer_array); + save_errno(); + Py_END_ALLOW_THREADS +@@ -6394,7 +6401,7 @@ static PyObject *b_callback(PyObject *self, PyObject *args) + goto error; + Py_INCREF(ct); + cd->head.c_type = ct; +- cd->head.c_data = (char *)closure_exec; ++ cd->head.c_data = (char *)CFFI_FN(closure_exec); + cd->head.c_weakreflist = NULL; + closure->user_data = NULL; + cd->closure = closure; +-- +GitLab -- cgit v1.2.3