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