summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-cryptography
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3-cryptography')
-rw-r--r--meta/recipes-devtools/python/python3-cryptography/0001-Fix-include-directory-when-cross-compiling-9129.patch52
-rw-r--r--meta/recipes-devtools/python/python3-cryptography/0001-cryptography-cffi-substitute-include-path-from-targe.patch29
2 files changed, 52 insertions, 29 deletions
diff --git a/meta/recipes-devtools/python/python3-cryptography/0001-Fix-include-directory-when-cross-compiling-9129.patch b/meta/recipes-devtools/python/python3-cryptography/0001-Fix-include-directory-when-cross-compiling-9129.patch
new file mode 100644
index 0000000000..d720359ded
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-cryptography/0001-Fix-include-directory-when-cross-compiling-9129.patch
@@ -0,0 +1,52 @@
1From 2f9cd402d3293f6efe0f3ac06f17c6c14edbed86 Mon Sep 17 00:00:00 2001
2From: James Hilliard <james.hilliard1@gmail.com>
3Date: Sun, 25 Jun 2023 17:39:19 -0600
4Subject: [PATCH] Fix include directory when cross compiling (#9129)
5
6Upstream-Status: Backport [https://github.com/pyca/cryptography/pull/9129]
7Signed-off-by: Alexander Kanavin <alex@linutronix.de>
8---
9 src/rust/cryptography-cffi/build.rs | 14 +++++++++++---
10 1 file changed, 11 insertions(+), 3 deletions(-)
11
12diff --git a/src/rust/cryptography-cffi/build.rs b/src/rust/cryptography-cffi/build.rs
13index 07590ad2e..384af1ddb 100644
14--- a/src/rust/cryptography-cffi/build.rs
15+++ b/src/rust/cryptography-cffi/build.rs
16@@ -47,9 +47,14 @@ fn main() {
17 )
18 .unwrap();
19 println!("cargo:rustc-cfg=python_implementation=\"{}\"", python_impl);
20- let python_include = run_python_script(
21+ let python_includes = run_python_script(
22 &python,
23- "import sysconfig; print(sysconfig.get_path('include'), end='')",
24+ "import os; \
25+ import setuptools.dist; \
26+ import setuptools.command.build_ext; \
27+ b = setuptools.command.build_ext.build_ext(setuptools.dist.Distribution()); \
28+ b.finalize_options(); \
29+ print(os.pathsep.join(b.include_dirs), end='')",
30 )
31 .unwrap();
32 let openssl_include =
33@@ -59,12 +64,15 @@ fn main() {
34 let mut build = cc::Build::new();
35 build
36 .file(openssl_c)
37- .include(python_include)
38 .include(openssl_include)
39 .flag_if_supported("-Wconversion")
40 .flag_if_supported("-Wno-error=sign-conversion")
41 .flag_if_supported("-Wno-unused-parameter");
42
43+ for python_include in env::split_paths(&python_includes) {
44+ build.include(python_include);
45+ }
46+
47 // Enable abi3 mode if we're not using PyPy.
48 if python_impl != "PyPy" {
49 // cp37 (Python 3.7 to help our grep when we some day drop 3.7 support)
50--
512.30.2
52
diff --git a/meta/recipes-devtools/python/python3-cryptography/0001-cryptography-cffi-substitute-include-path-from-targe.patch b/meta/recipes-devtools/python/python3-cryptography/0001-cryptography-cffi-substitute-include-path-from-targe.patch
deleted file mode 100644
index 1a60abada7..0000000000
--- a/meta/recipes-devtools/python/python3-cryptography/0001-cryptography-cffi-substitute-include-path-from-targe.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From 04aac6c88152088778c6551dfa86b2fc446dc61c Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Mon, 19 Jun 2023 13:27:28 +0200
4Subject: [PATCH] cryptography-cffi: substitute include path from target
5 sysroot
6
7Upstream-Status: Accepted [https://github.com/pyca/cryptography/pull/9105]
8
9Signed-off-by: Alexander Kanavin <alex@linutronix.de>
10---
11 src/rust/cryptography-cffi/build.rs | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/src/rust/cryptography-cffi/build.rs b/src/rust/cryptography-cffi/build.rs
15index 4a40990..08abb95 100644
16--- a/src/rust/cryptography-cffi/build.rs
17+++ b/src/rust/cryptography-cffi/build.rs
18@@ -48,7 +48,7 @@ fn main() {
19 println!("cargo:rustc-cfg=python_implementation=\"{}\"", python_impl);
20 let python_include = run_python_script(
21 &python,
22- "import sysconfig; print(sysconfig.get_path('include'), end='')",
23+ "import sysconfig; print(sysconfig.get_config_var('INCLUDEPY'), end='')",
24 )
25 .unwrap();
26 let openssl_include =
27--
282.30.2
29