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/pycparser/
Date: Sun, 27 Aug 2017 18:07:57
Message-Id: 1503857269.d2a9def05500f4e6f403ff56ad9cc54aede11ee7.mgorny@gentoo
1 commit: d2a9def05500f4e6f403ff56ad9cc54aede11ee7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 27 17:59:40 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 27 18:07:49 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2a9def0
7
8 dev-python/pycparser: Enforce regenerating tables
9
10 Remove the pregenerated tables provided in the distfile to force
11 regenerating them. Generate the tables for every Python implementation
12 separately to avoid incompatibility/underoptimization problems (tables
13 built by Python 3.5+ are incompatible with older Python versions that
14 have 100 group-in-regex limit).
15
16 ...pycparser-2.18.ebuild => pycparser-2.18-r1.ebuild} | 19 +++++++++++++++++--
17 1 file changed, 17 insertions(+), 2 deletions(-)
18
19 diff --git a/dev-python/pycparser/pycparser-2.18.ebuild b/dev-python/pycparser/pycparser-2.18-r1.ebuild
20 similarity index 59%
21 rename from dev-python/pycparser/pycparser-2.18.ebuild
22 rename to dev-python/pycparser/pycparser-2.18-r1.ebuild
23 index 292106b4124..3fb094f6ff3 100644
24 --- a/dev-python/pycparser/pycparser-2.18.ebuild
25 +++ b/dev-python/pycparser/pycparser-2.18-r1.ebuild
26 @@ -21,13 +21,28 @@ DEPEND="${RDEPEND}
27 dev-python/setuptools[${PYTHON_USEDEP}]
28 test? ( dev-python/nose[${PYTHON_USEDEP}] )"
29
30 +python_prepare_all() {
31 + # remove the original files to guarantee their regen
32 + rm pycparser/{c_ast,lextab,yacctab}.py || die
33 +
34 + # kill sys.path manipulations to force the tests to use built files
35 + sed -i -e '/sys\.path/d' tests/*.py || die
36 +
37 + distutils-r1_python_prepare_all
38 +}
39 +
40 python_compile() {
41 distutils-r1_python_compile
42 - pushd "${BUILD_DIR}/lib/pycparser" > /dev/null || die
43 +
44 + # note: tables built by py3.5+ are incompatible with older versions
45 + # because of 100 group limit of 're' module -- just generate them
46 + # separately optimized for each target instead
47 + pushd "${BUILD_DIR}"/lib/pycparser > /dev/null || die
48 "${PYTHON}" _build_tables.py || die
49 popd > /dev/null || die
50 }
51
52 python_test() {
53 - nosetests || die
54 + # change workdir to avoid '.' import
55 + nosetests -v -w tests || die
56 }