1 |
commit: f3af4c3be7962780f471641f0d8d2f6b9c335cdc |
2 |
Author: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat May 2 21:27:50 2020 +0000 |
4 |
Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat May 2 21:27:50 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f3af4c3b |
7 |
|
8 |
dev-python/pycparser: trick tests into using CPP variable |
9 |
|
10 |
Closes: https://bugs.gentoo.org/719934 |
11 |
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org> |
12 |
|
13 |
dev-python/pycparser/pycparser-2.20.ebuild | 15 +++++++++++++-- |
14 |
1 file changed, 13 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/pycparser/pycparser-2.20.ebuild b/dev-python/pycparser/pycparser-2.20.ebuild |
17 |
index 7f1f79c16a8..1dcff2020fc 100644 |
18 |
--- a/dev-python/pycparser/pycparser-2.20.ebuild |
19 |
+++ b/dev-python/pycparser/pycparser-2.20.ebuild |
20 |
@@ -5,7 +5,7 @@ EAPI=7 |
21 |
|
22 |
PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 ) |
23 |
|
24 |
-inherit distutils-r1 |
25 |
+inherit distutils-r1 toolchain-funcs |
26 |
|
27 |
DESCRIPTION="C parser and AST generator written in Python" |
28 |
HOMEPAGE="https://github.com/eliben/pycparser" |
29 |
@@ -41,9 +41,20 @@ python_compile() { |
30 |
} |
31 |
|
32 |
python_test() { |
33 |
+ # Trick the tests into using CPP variable |
34 |
+ # https://bugs.gentoo.org/719934 |
35 |
+ local CPP="$(tc-getCPP)" |
36 |
+ mkdir -p "${T}"/bin || die |
37 |
+ cat > "${T}"/bin/cpp <<-EOF || die |
38 |
+ #!/bin/sh |
39 |
+ exec ${CPP} "\$@" |
40 |
+ EOF |
41 |
+ chmod +x "${T}"/bin/cpp || die |
42 |
+ local -x PATH="${T}/bin:${PATH}" |
43 |
+ |
44 |
# change workdir to avoid '.' import |
45 |
cd tests || die |
46 |
- "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}" |
47 |
+ ${EPYTHON} -m unittest discover -v || die "Tests fail with ${EPYTHON}" |
48 |
} |
49 |
|
50 |
python_install() { |