diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch')
-rw-r--r-- | meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch new file mode 100644 index 0000000000..0d807db39f --- /dev/null +++ b/meta/recipes-devtools/python/python3/0001-Avoid-shebang-overflow-on-python-config.py.patch | |||
@@ -0,0 +1,30 @@ | |||
1 | From 365399f17d35719d828ddd49182dcb401fb7791c Mon Sep 17 00:00:00 2001 | ||
2 | From: Paulo Neves <ptsneves@gmail.com> | ||
3 | Date: Tue, 7 Jun 2022 16:16:41 +0200 | ||
4 | Subject: [PATCH] Avoid shebang overflow on python-config.py | ||
5 | |||
6 | The whole native path may be too big, leading to shebang | ||
7 | overflow. Let's just use the env shebang. | ||
8 | |||
9 | Denial reason: [1] | ||
10 | |||
11 | Upstream-Status: Denied [distribution] | ||
12 | |||
13 | [1] https://github.com/python/cpython/pull/93760#pullrequestreview-1005365737 | ||
14 | --- | ||
15 | Makefile.pre.in | 2 ++ | ||
16 | 1 file changed, 2 insertions(+) | ||
17 | |||
18 | diff --git a/Makefile.pre.in b/Makefile.pre.in | ||
19 | index 77bf09a..6353c57 100644 | ||
20 | --- a/Makefile.pre.in | ||
21 | +++ b/Makefile.pre.in | ||
22 | @@ -2339,6 +2339,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh | ||
23 | @ # Substitution happens here, as the completely-expanded BINDIR | ||
24 | @ # is not available in configure | ||
25 | sed -e "s,@EXENAME@,$(EXENAME)," < $(srcdir)/Misc/python-config.in >python-config.py | ||
26 | + @ # Otherwise we might get huge shebangs with native paths | ||
27 | + sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py | ||
28 | @ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR} | ||
29 | LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config | ||
30 | @ # On Darwin, always use the python version of the script, the shell | ||