0001-python-ensure-proper-shabang-on-python-scripts.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 44fe2328b715db25134ee095526d2fa47e6cd834 Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Wed, 1 Jan 2020 15:25:57 +0100
  4. Subject: [PATCH] python: ensure proper shabang on python scripts
  5. When instlling python scripts, distutils would use the python used to
  6. run setup.py as shabang for the scripts it installs.
  7. However, when cross-compiling, this is most often not correct.
  8. Instead, using '/usr/bin/env python' is guaranteed to find the proper
  9. python in the PATH, so we need to instruct setyup.py to use that as the
  10. executable.
  11. [yann.morin.1998@free.fr:
  12. - author did not provide their SoB, but it's simple enough to
  13. not require it for once
  14. - provide proper commit log
  15. ]
  16. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
  17. [Fabrice: update for 6.0.0]
  18. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  19. ---
  20. python/Makefile.am | 4 ++--
  21. 1 file changed, 2 insertions(+), 2 deletions(-)
  22. diff --git a/python/Makefile.am b/python/Makefile.am
  23. index 59d195f29..a41604f72 100644
  24. --- a/python/Makefile.am
  25. +++ b/python/Makefile.am
  26. @@ -6,11 +6,11 @@ EXTRA_DIST = setup.py \
  27. if HAVE_PYTHON_DISTUTILS
  28. all-local:
  29. cd $(srcdir) && \
  30. - $(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)"
  31. + $(HAVE_PYTHON) setup.py build -e "/usr/bin/env python" --build-base "$(abs_builddir)"
  32. install-exec-local:
  33. cd $(srcdir) && \
  34. - $(HAVE_PYTHON) setup.py build --build-base "$(abs_builddir)" \
  35. + $(HAVE_PYTHON) setup.py build -e "/usr/bin/env python" --build-base "$(abs_builddir)" \
  36. install --prefix $(DESTDIR)$(prefix)
  37. uninstall-local:
  38. --
  39. 2.20.1