pkg-autotools: move the libtool patching call out of the autoreconf hook
[buildroot-gz.git] / package / python3 / python3-015-distutils-scripts-dont-adjust-shebang.patch
blobed2f193f9e37fbf16c2dc65dd15df9e644c6d203
1 Do not adjust the shebang of Python scripts for cross-compilation
3 The copy_scripts() method in distutils copies the scripts listed in
4 the setup file and adjusts the first line to refer to the current
5 Python interpreter. When cross-compiling, this means that the adjusted
6 shebang refers to the host Python interpreter.
8 This patch modifies copy_scripts() to preserve the shebang when
9 cross-compilation is detected.
11 Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
13 Index: b/Lib/distutils/command/build_scripts.py
14 ===================================================================
15 --- a/Lib/distutils/command/build_scripts.py
16 +++ b/Lib/distutils/command/build_scripts.py
17 @@ -91,7 +91,7 @@
18 adjust = True
19 post_interp = match.group(1) or b''
21 - if adjust:
22 + if adjust and not '_python_sysroot' in os.environ:
23 log.info("copying and adjusting %s -> %s", script,
24 self.build_dir)
25 updated_files.append(outfile)