Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cffi/
Date: Wed, 11 May 2022 06:19:22
Message-Id: 1652249950.cad3f66762a5f3bb7400975d702e05b2db9baeca.mgorny@gentoo
1 commit: cad3f66762a5f3bb7400975d702e05b2db9baeca
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 10 21:16:17 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed May 11 06:19:10 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cad3f667
7
8 dev-python/cffi: Use PEP517 build
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/cffi/cffi-1.15.0-r1.ebuild | 65 +++++++++++++++++++++++++++++++++++
13 1 file changed, 65 insertions(+)
14
15 diff --git a/dev-python/cffi/cffi-1.15.0-r1.ebuild b/dev-python/cffi/cffi-1.15.0-r1.ebuild
16 new file mode 100644
17 index 000000000000..97883557d572
18 --- /dev/null
19 +++ b/dev-python/cffi/cffi-1.15.0-r1.ebuild
20 @@ -0,0 +1,65 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
25 +EAPI=7
26 +
27 +DISTUTILS_USE_PEP517=setuptools
28 +# DO NOT ADD pypy to PYTHON_COMPAT
29 +# pypy bundles a modified version of cffi. Use python_gen_cond_dep instead.
30 +PYTHON_COMPAT=( python3_{8..10} )
31 +
32 +inherit distutils-r1 toolchain-funcs
33 +
34 +DESCRIPTION="Foreign Function Interface for Python calling C code"
35 +HOMEPAGE="
36 + https://cffi.readthedocs.io/
37 + https://pypi.org/project/cffi/
38 +"
39 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
40 +
41 +LICENSE="MIT"
42 +SLOT="0/${PV}"
43 +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"
44 +
45 +DEPEND="
46 + dev-libs/libffi:=
47 +"
48 +RDEPEND="
49 + ${DEPEND}
50 + dev-python/pycparser[${PYTHON_USEDEP}]
51 +"
52 +BDEPEND="
53 + ${RDEPEND}
54 + virtual/pkgconfig
55 +"
56 +
57 +distutils_enable_sphinx doc/source
58 +distutils_enable_tests pytest
59 +
60 +PATCHES=(
61 + "${FILESDIR}"/cffi-1.14.0-darwin-no-brew.patch
62 +)
63 +
64 +src_prepare() {
65 + if [[ ${CHOST} == *darwin* ]] ; then
66 + # Don't obsessively try to find libffi
67 + sed -i -e "s/.*\-iwithsysroot\/usr\/include\/ffi.*/\tpass/" setup.py || die
68 + fi
69 + distutils-r1_src_prepare
70 +}
71 +
72 +src_configure() {
73 + tc-export PKG_CONFIG
74 +}
75 +
76 +python_test() {
77 + local EPYTEST_IGNORE=(
78 + # these tests call pip
79 + testing/cffi0/test_zintegration.py
80 + )
81 +
82 + "${EPYTHON}" -c "import _cffi_backend as backend" || die
83 + local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
84 + epytest c testing
85 +}