0030-Fix-cross-compiling-the-uuid-module.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. From d7b90b157eddefbd0ed59e35c90b083c0c03b644 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <aduskett@gmail.com>
  3. Date: Fri, 20 Jul 2018 10:17:39 -0400
  4. Subject: [PATCH] Fix cross compiling the uuid module
  5. Python 3.7 has a new _uuid module, however, the include directory
  6. search path for uuid.h is hardcoded to /usr/include/uuid, which should
  7. not be used when cross-compiling.
  8. To fix this, use the same solution as the one used by the NIS
  9. detection: append "uuid" to each of the include directories in
  10. "inc_dirs", instead of hardcoding /usr/include/uuid.
  11. Signed-off-by: Adam Duskett <aduskett@gmail.com>
  12. [Thomas: drop STAGING_DIR based solution, use a solution similar to
  13. the one used for the NIS detection.]
  14. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
  15. ---
  16. setup.py | 3 ++-
  17. 1 file changed, 2 insertions(+), 1 deletion(-)
  18. diff --git a/setup.py b/setup.py
  19. index 3d0c74bb7f..c7be85f352 100644
  20. --- a/setup.py
  21. +++ b/setup.py
  22. @@ -1779,7 +1779,8 @@ class PyBuildExt(build_ext):
  23. def detect_uuid(self):
  24. # Build the _uuid module if possible
  25. - uuid_incs = find_file("uuid.h", self.inc_dirs, ["/usr/include/uuid"])
  26. + uuid_incs = find_file("uuid.h", self.inc_dirs,
  27. + [os.path.join(inc_dir, 'uuid') for inc_dir in self.inc_dirs])
  28. if uuid_incs is not None:
  29. if self.compiler.find_library_file(self.lib_dirs, 'uuid'):
  30. uuid_libs = ['uuid']
  31. --
  32. 2.25.1