0009-Do-not-adjust-the-shebang-of-Python-scripts-for-cros.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  1. From cb595a591c71e0bf7c63a3706b0be45ac6a642e3 Mon Sep 17 00:00:00 2001
  2. From: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
  3. Date: Wed, 23 Dec 2015 11:44:30 +0100
  4. Subject: [PATCH] Do not adjust the shebang of Python scripts for
  5. cross-compilation
  6. The copy_scripts() method in distutils copies the scripts listed in
  7. the setup file and adjusts the first line to refer to the current
  8. Python interpreter. When cross-compiling, this means that the adjusted
  9. shebang refers to the host Python interpreter.
  10. This patch modifies copy_scripts() to preserve the shebang when
  11. cross-compilation is detected.
  12. Signed-off-by: Christophe Vu-Brugier <cvubrugier@fastmail.fm>
  13. ---
  14. Lib/distutils/command/build_scripts.py | 2 +-
  15. 1 file changed, 1 insertion(+), 1 deletion(-)
  16. diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py
  17. index ccc70e6465..d6d54195c1 100644
  18. --- a/Lib/distutils/command/build_scripts.py
  19. +++ b/Lib/distutils/command/build_scripts.py
  20. @@ -91,7 +91,7 @@ class build_scripts(Command):
  21. adjust = True
  22. post_interp = match.group(1) or b''
  23. - if adjust:
  24. + if adjust and not '_python_sysroot' in os.environ:
  25. log.info("copying and adjusting %s -> %s", script,
  26. self.build_dir)
  27. updated_files.append(outfile)
  28. --
  29. 2.25.1