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/files/, dev-python/cffi/
Date: Sun, 31 Jan 2021 21:36:54
Message-Id: 1612129008.b7ad8360eb6423abd14f9677a884c58a5c4c5706.mgorny@gentoo
1 commit: b7ad8360eb6423abd14f9677a884c58a5c4c5706
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 31 21:34:01 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 31 21:36:48 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b7ad8360
7
8 dev-python/cffi: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/cffi/Manifest | 1 -
13 dev-python/cffi/cffi-1.14.0-r3.ebuild | 48 -----
14 dev-python/cffi/files/cffi-0.14.0-g-line.patch | 250 -------------------------
15 3 files changed, 299 deletions(-)
16
17 diff --git a/dev-python/cffi/Manifest b/dev-python/cffi/Manifest
18 index 64ab58ed51a..068a1f07b8b 100644
19 --- a/dev-python/cffi/Manifest
20 +++ b/dev-python/cffi/Manifest
21 @@ -1,2 +1 @@
22 -DIST cffi-1.14.0.tar.gz 463065 BLAKE2B 4d1e8a92241db801848ef8bd05ea15a31c7f61ea426ce4da184aff00df786348d2c76de9dc48898c814478aed9750b665868df24ad39435062cd7e1c84163e52 SHA512 4c5451eeede1d48a8f4b40e25b845ad1863b8bf3bd39624e6c693c2800d89a13efedc4c43b37e317a035613bffc2e3fd5f7e583c46cb283cb5cb930356f86253
23 DIST cffi-1.14.4.tar.gz 471302 BLAKE2B 9722e517c99b6df239f59235baea76957900dc8566ff04c8d1fd367d20ad5f5437212bdb5e4e98aca303121e79411634fcb5e4e72179ecb3007d4f0eee68c9f2 SHA512 b2c54a805ead93c5dd8531d7f0f7e4b44be8f07bfcb1af2f19eb6d325b4e846cae23f16a5bcc777ba019d1213f013611614ade798e195f5b4f6b7904c9cb6e3a
24
25 diff --git a/dev-python/cffi/cffi-1.14.0-r3.ebuild b/dev-python/cffi/cffi-1.14.0-r3.ebuild
26 deleted file mode 100644
27 index fe9cf1decfa..00000000000
28 --- a/dev-python/cffi/cffi-1.14.0-r3.ebuild
29 +++ /dev/null
30 @@ -1,48 +0,0 @@
31 -# Copyright 1999-2021 Gentoo Authors
32 -# Distributed under the terms of the GNU General Public License v2
33 -
34 -EAPI=7
35 -
36 -# DO NOT ADD pypy to PYTHON_COMPAT
37 -# pypy bundles a modified version of cffi. Use python_gen_cond_dep instead.
38 -DISTUTILS_USE_SETUPTOOLS=rdepend
39 -PYTHON_COMPAT=( python3_{7,8,9} )
40 -
41 -inherit distutils-r1 toolchain-funcs
42 -
43 -DESCRIPTION="Foreign Function Interface for Python calling C code"
44 -HOMEPAGE="https://cffi.readthedocs.io/ https://pypi.org/project/cffi/"
45 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
46 -
47 -LICENSE="MIT"
48 -SLOT="0/${PV}"
49 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~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"
50 -IUSE="test"
51 -RESTRICT="!test? ( test )"
52 -
53 -DEPEND="dev-libs/libffi:="
54 -RDEPEND="${DEPEND}
55 - dev-python/pycparser[${PYTHON_USEDEP}]"
56 -BDEPEND="${RDEPEND}
57 - virtual/pkgconfig
58 - test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
59 -
60 -distutils_enable_sphinx doc/source
61 -
62 -PATCHES=(
63 - "${FILESDIR}"/cffi-0.14.0-g-line.patch
64 - "${FILESDIR}"/cffi-1.14.0-darwin-no-brew.patch
65 -)
66 -
67 -src_configure() {
68 - tc-export PKG_CONFIG
69 -}
70 -
71 -python_test() {
72 - "${EPYTHON}" -c "import _cffi_backend as backend" || die
73 - pytest -x -vv \
74 - --ignore testing/test_zintegration.py \
75 - --ignore testing/embedding \
76 - c/ testing/ \
77 - || die "Testing failed with ${EPYTHON}"
78 -}
79
80 diff --git a/dev-python/cffi/files/cffi-0.14.0-g-line.patch b/dev-python/cffi/files/cffi-0.14.0-g-line.patch
81 deleted file mode 100644
82 index 45a1099dce2..00000000000
83 --- a/dev-python/cffi/files/cffi-0.14.0-g-line.patch
84 +++ /dev/null
85 @@ -1,250 +0,0 @@
86 -From 19ff1036043ae40ff3d8a2e1a6a793219e1ec378 Mon Sep 17 00:00:00 2001
87 -From: Armin Rigo <arigo@×××××.org>
88 -Date: Tue, 26 May 2020 15:51:56 +0200
89 -Subject: [PATCH] Issue #454
90 -
91 -Try harder to avoid #line directives confuse the rest of pre-parsing
92 ----
93 - cffi/cparser.py | 37 ++++++++++++++++++++++++---
94 - testing/cffi0/test_parsing.py | 48 ++++++++++++++++++++++++++++++++++-
95 - 2 files changed, 81 insertions(+), 4 deletions(-)
96 -
97 -diff --git a/cffi/cparser.py b/cffi/cparser.py
98 -index d7069a73..d9784655 100644
99 ---- a/cffi/cparser.py
100 -+++ b/cffi/cparser.py
101 -@@ -29,6 +29,7 @@ _r_comment = re.compile(r"/\*.*?\*/|//([^\n\\]|\\.)*?$",
102 - _r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)"
103 - r"\b((?:[^\n\\]|\\.)*?)$",
104 - re.DOTALL | re.MULTILINE)
105 -+_r_line_directive = re.compile(r"^[ \t]*#[ \t]*line\b.*$", re.MULTILINE)
106 - _r_partial_enum = re.compile(r"=\s*\.\.\.\s*[,}]|\.\.\.\s*\}")
107 - _r_enum_dotdotdot = re.compile(r"__dotdotdot\d+__$")
108 - _r_partial_array = re.compile(r"\[\s*\.\.\.\s*\]")
109 -@@ -163,10 +164,37 @@ def _warn_for_non_extern_non_static_global_variable(decl):
110 - "with C it should have a storage class specifier "
111 - "(usually 'extern')" % (decl.name,))
112 -
113 -+def _remove_line_directives(csource):
114 -+ # _r_line_directive matches whole lines, without the final \n, if they
115 -+ # start with '#line' with some spacing allowed. This function stores
116 -+ # them away and replaces them with exactly the string '#line@N', where
117 -+ # N is the index in the list 'line_directives'.
118 -+ line_directives = []
119 -+ def replace(m):
120 -+ i = len(line_directives)
121 -+ line_directives.append(m.group())
122 -+ return '#line@%d' % i
123 -+ csource = _r_line_directive.sub(replace, csource)
124 -+ return csource, line_directives
125 -+
126 -+def _put_back_line_directives(csource, line_directives):
127 -+ def replace(m):
128 -+ s = m.group()
129 -+ if not s.startswith('#line@'):
130 -+ raise AssertionError("unexpected #line directive "
131 -+ "(should have been processed and removed")
132 -+ return line_directives[int(s[6:])]
133 -+ return _r_line_directive.sub(replace, csource)
134 -+
135 - def _preprocess(csource):
136 -+ # First, remove the lines of the form '#line N "filename"' because
137 -+ # the "filename" part could confuse the rest
138 -+ csource, line_directives = _remove_line_directives(csource)
139 - # Remove comments. NOTE: this only work because the cdef() section
140 -- # should not contain any string literal!
141 -- csource = _r_comment.sub(' ', csource)
142 -+ # should not contain any string literals (except in line directives)!
143 -+ def replace_keeping_newlines(m):
144 -+ return ' ' + m.group().count('\n') * '\n'
145 -+ csource = _r_comment.sub(replace_keeping_newlines, csource)
146 - # Remove the "#define FOO x" lines
147 - macros = {}
148 - for match in _r_define.finditer(csource):
149 -@@ -219,7 +247,10 @@ def _preprocess(csource):
150 - csource = _r_float_dotdotdot.sub(' __dotdotdotfloat__ ', csource)
151 - # Replace all remaining "..." with the same name, "__dotdotdot__",
152 - # which is declared with a typedef for the purpose of C parsing.
153 -- return csource.replace('...', ' __dotdotdot__ '), macros
154 -+ csource = csource.replace('...', ' __dotdotdot__ ')
155 -+ # Finally, put back the line directives
156 -+ csource = _put_back_line_directives(csource, line_directives)
157 -+ return csource, macros
158 -
159 - def _common_type_names(csource):
160 - # Look in the source for what looks like usages of types from the
161 -diff --git a/testing/cffi0/test_parsing.py b/testing/cffi0/test_parsing.py
162 -index 3fc3783a..5f2d7ec4 100644
163 ---- a/testing/cffi0/test_parsing.py
164 -+++ b/testing/cffi0/test_parsing.py
165 -@@ -174,7 +174,7 @@ def test_remove_line_continuation_comments():
166 - double // blah \\
167 - more comments
168 - x(void);
169 -- double // blah\\\\
170 -+ double // blah // blah\\\\
171 - y(void);
172 - double // blah\\ \
173 - etc
174 -@@ -185,6 +185,52 @@ def test_remove_line_continuation_comments():
175 - m.y
176 - m.z
177 -
178 -+def test_dont_remove_comment_in_line_directives():
179 -+ ffi = FFI(backend=FakeBackend())
180 -+ e = py.test.raises(CDefError, ffi.cdef, """
181 -+ \t # \t line \t 8 \t "baz.c" \t
182 -+
183 -+ some syntax error here
184 -+ """)
185 -+ assert str(e.value) == "parse error\nbaz.c:9:14: before: syntax"
186 -+ #
187 -+ e = py.test.raises(CDefError, ffi.cdef, """
188 -+ #line 7 "foo//bar.c"
189 -+
190 -+ some syntax error here
191 -+ """)
192 -+ assert str(e.value) == "parse error\nfoo//bar.c:8:14: before: syntax"
193 -+
194 -+def test_multiple_line_directives():
195 -+ ffi = FFI(backend=FakeBackend())
196 -+ e = py.test.raises(CDefError, ffi.cdef,
197 -+ """ #line 5 "foo.c"
198 -+ extern int xx;
199 -+ #line 6 "bar.c"
200 -+ extern int yy;
201 -+ #line 7 "baz.c"
202 -+ some syntax error here
203 -+ #line 8 "yadda.c"
204 -+ extern int zz;
205 -+ """)
206 -+ assert str(e.value) == "parse error\nbaz.c:7:14: before: syntax"
207 -+
208 -+def test_commented_line_directive():
209 -+ ffi = FFI(backend=FakeBackend())
210 -+ e = py.test.raises(CDefError, ffi.cdef, """
211 -+ /*
212 -+ #line 5 "foo.c"
213 -+ */
214 -+ void xx(void);
215 -+
216 -+ #line 6 "bar.c"
217 -+ /*
218 -+ #line 35 "foo.c"
219 -+ */
220 -+ some syntax error
221 -+ """)
222 -+ assert str(e.value) == "parse error\nbar.c:9:14: before: syntax"
223 -+
224 - def test_line_continuation_in_defines():
225 - ffi = FFI(backend=FakeBackend())
226 - ffi.cdef("""
227 ---
228 -2.26.2
229 -
230 -From 31249d786c833d4960bbbf4e0d7f7bcaecf92d1f Mon Sep 17 00:00:00 2001
231 -From: Armin Rigo <arigo@×××××.org>
232 -Date: Fri, 29 May 2020 10:27:40 +0200
233 -Subject: [PATCH] #454
234 -
235 -Second try with '# NUMBER' instead of '#line NUMBER', as gcc seems to output
236 ----
237 - cffi/cparser.py | 8 +++----
238 - testing/cffi0/test_parsing.py | 41 +++++++++++++++++++++++++++++++++++
239 - 2 files changed, 45 insertions(+), 4 deletions(-)
240 -
241 -diff --git a/cffi/cparser.py b/cffi/cparser.py
242 -index d9784655..74830e91 100644
243 ---- a/cffi/cparser.py
244 -+++ b/cffi/cparser.py
245 -@@ -29,7 +29,7 @@ _r_comment = re.compile(r"/\*.*?\*/|//([^\n\\]|\\.)*?$",
246 - _r_define = re.compile(r"^\s*#\s*define\s+([A-Za-z_][A-Za-z_0-9]*)"
247 - r"\b((?:[^\n\\]|\\.)*?)$",
248 - re.DOTALL | re.MULTILINE)
249 --_r_line_directive = re.compile(r"^[ \t]*#[ \t]*line\b.*$", re.MULTILINE)
250 -+_r_line_directive = re.compile(r"^[ \t]*#[ \t]*(?:line|\d+)\b.*$", re.MULTILINE)
251 - _r_partial_enum = re.compile(r"=\s*\.\.\.\s*[,}]|\.\.\.\s*\}")
252 - _r_enum_dotdotdot = re.compile(r"__dotdotdot\d+__$")
253 - _r_partial_array = re.compile(r"\[\s*\.\.\.\s*\]")
254 -@@ -166,9 +166,9 @@ def _warn_for_non_extern_non_static_global_variable(decl):
255 -
256 - def _remove_line_directives(csource):
257 - # _r_line_directive matches whole lines, without the final \n, if they
258 -- # start with '#line' with some spacing allowed. This function stores
259 -- # them away and replaces them with exactly the string '#line@N', where
260 -- # N is the index in the list 'line_directives'.
261 -+ # start with '#line' with some spacing allowed, or '#NUMBER'. This
262 -+ # function stores them away and replaces them with exactly the string
263 -+ # '#line@N', where N is the index in the list 'line_directives'.
264 - line_directives = []
265 - def replace(m):
266 - i = len(line_directives)
267 -diff --git a/testing/cffi0/test_parsing.py b/testing/cffi0/test_parsing.py
268 -index 5f2d7ec4..a5e45874 100644
269 ---- a/testing/cffi0/test_parsing.py
270 -+++ b/testing/cffi0/test_parsing.py
271 -@@ -199,6 +199,21 @@ def test_dont_remove_comment_in_line_directives():
272 -
273 - some syntax error here
274 - """)
275 -+ #
276 -+ assert str(e.value) == "parse error\nfoo//bar.c:8:14: before: syntax"
277 -+ ffi = FFI(backend=FakeBackend())
278 -+ e = py.test.raises(CDefError, ffi.cdef, """
279 -+ \t # \t 8 \t "baz.c" \t
280 -+
281 -+ some syntax error here
282 -+ """)
283 -+ assert str(e.value) == "parse error\nbaz.c:9:14: before: syntax"
284 -+ #
285 -+ e = py.test.raises(CDefError, ffi.cdef, """
286 -+ # 7 "foo//bar.c"
287 -+
288 -+ some syntax error here
289 -+ """)
290 - assert str(e.value) == "parse error\nfoo//bar.c:8:14: before: syntax"
291 -
292 - def test_multiple_line_directives():
293 -@@ -214,6 +229,18 @@ def test_multiple_line_directives():
294 - extern int zz;
295 - """)
296 - assert str(e.value) == "parse error\nbaz.c:7:14: before: syntax"
297 -+ #
298 -+ e = py.test.raises(CDefError, ffi.cdef,
299 -+ """ # 5 "foo.c"
300 -+ extern int xx;
301 -+ # 6 "bar.c"
302 -+ extern int yy;
303 -+ # 7 "baz.c"
304 -+ some syntax error here
305 -+ # 8 "yadda.c"
306 -+ extern int zz;
307 -+ """)
308 -+ assert str(e.value) == "parse error\nbaz.c:7:14: before: syntax"
309 -
310 - def test_commented_line_directive():
311 - ffi = FFI(backend=FakeBackend())
312 -@@ -229,6 +256,20 @@ def test_commented_line_directive():
313 - */
314 - some syntax error
315 - """)
316 -+ #
317 -+ assert str(e.value) == "parse error\nbar.c:9:14: before: syntax"
318 -+ e = py.test.raises(CDefError, ffi.cdef, """
319 -+ /*
320 -+ # 5 "foo.c"
321 -+ */
322 -+ void xx(void);
323 -+
324 -+ # 6 "bar.c"
325 -+ /*
326 -+ # 35 "foo.c"
327 -+ */
328 -+ some syntax error
329 -+ """)
330 - assert str(e.value) == "parse error\nbar.c:9:14: before: syntax"
331 -
332 - def test_line_continuation_in_defines():
333 ---
334 -2.26.2
335 -