0027-Fix-cross-compiling-the-uuid-module.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. @@ -1866,10 +1866,10 @@ class PyBuildExt(build_ext):
  23. def detect_uuid(self):
  24. # Build the _uuid module if possible
  25. - uuid_h = sysconfig.get_config_var("HAVE_UUID_H")
  26. - uuid_uuid_h = sysconfig.get_config_var("HAVE_UUID_UUID_H")
  27. - if uuid_h or uuid_uuid_h:
  28. - if sysconfig.get_config_var("HAVE_LIBUUID"):
  29. + uuid_h = find_file("uuid.h", self.inc_dirs,
  30. + [os.path.join(inc_dir, 'uuid') for inc_dir in self.inc_dirs])
  31. + if uuid_h is not None:
  32. + if self.compiler.find_library_file(self.lib_dirs, 'uuid'):
  33. uuid_libs = ["uuid"]
  34. else:
  35. uuid_libs = []
  36. --
  37. 2.25.1