python3-3.3-003-staging-header-libs.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. Tell setup.py the location of headers/libraries
  2. Allow the libraries detection routine to look for headers and libs in
  3. other directories than /usr/include or /usr/lib through the
  4. environment variables PYTHON_MODULES_INCLUDE and PYTHON_MODULES_LIB.
  5. We can then use it to look for libraries in the buildroot staging
  6. directory.
  7. Ported to python3.3 by Maxime Ripard <maxime.ripard@free-electrons.com> based
  8. on the work by Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  9. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
  10. ---
  11. setup.py | 13 +++++++++++++
  12. 1 file changed, 13 insertions(+)
  13. Index: Python-3.3.0/setup.py
  14. ===================================================================
  15. --- Python-3.3.0.orig/setup.py
  16. +++ Python-3.3.0/setup.py
  17. @@ -441,6 +441,19 @@
  18. os.unlink(tmpfile)
  19. def detect_modules(self):
  20. + try:
  21. + modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
  22. + except KeyError:
  23. + modules_include_dirs = ['/usr/include']
  24. + try:
  25. + modules_lib_dirs = os.environ["PYTHON_MODULES_LIB"].split()
  26. + except KeyError:
  27. + modules_lib_dirs = ['/usr/lib']
  28. + for dir in modules_include_dirs:
  29. + add_dir_to_list(self.compiler.include_dirs, dir)
  30. + for dir in modules_lib_dirs:
  31. + add_dir_to_list(self.compiler.library_dirs, dir)
  32. +
  33. # Ensure that /usr/local is always used, but the local build
  34. # directories (i.e. '.' and 'Include') must be first. See issue
  35. # 10520.