summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/recipes-devtools/python')
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch31
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch28
-rwxr-xr-xmeta-python/recipes-devtools/python/python3-cryptography/check-memfree.py10
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography/h-test.patch10
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch62
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography/run-ptest4
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb68
-rw-r--r--meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb121
8 files changed, 193 insertions, 141 deletions
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch b/meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch
new file mode 100644
index 0000000000..d7ab757bb5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/0001-Cargo.toml-specify-pem-version.patch
@@ -0,0 +1,31 @@
1From ec8d3f3c61280c8140b34ed1479baef5e706f064 Mon Sep 17 00:00:00 2001
2From: Tim Orling <tim.orling@konsulko.com>
3Date: Fri, 14 Jan 2022 22:02:25 -0800
4Subject: [PATCH] Cargo.toml: specify pem version
5
6pem = "1.0" is not resolving, specify the current
7pem = { version: "1.0.2"}
8
9Upstream-Status: Pending
10
11Signed-off-by: Tim Orling <tim.orling@konsulko.com>
12---
13 src/rust/Cargo.toml | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
17index 617167d0..174eaa80 100644
18--- a/src/rust/Cargo.toml
19+++ b/src/rust/Cargo.toml
20@@ -9,7 +9,7 @@ publish = false
21 lazy_static = "1"
22 pyo3 = { version = "0.15.1" }
23 asn1 = { version = "0.8.7", default-features = false, features = ["derive"] }
24-pem = "1.0"
25+pem = { version = "1.0.2" }
26 chrono = { version = "0.4", default-features = false, features = ["alloc", "clock"] }
27 ouroboros = "0.13"
28
29--
302.30.2
31
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch b/meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch
new file mode 100644
index 0000000000..366e3a4d39
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/0002-Cargo.toml-edition-2018-2021.patch
@@ -0,0 +1,28 @@
1From 4b73298b214a5b69ea6edf3c2e21dd82b2b29708 Mon Sep 17 00:00:00 2001
2From: Tim Orling <tim.orling@konsulko.com>
3Date: Fri, 14 Jan 2022 22:34:59 -0800
4Subject: [PATCH 2/2] Cargo.toml: edition 2018 -> 2021
5
6Upstream-Status: Pending
7
8Signed-off-by: Tim Orling <tim.orling@konsulko.com>
9---
10 src/rust/Cargo.toml | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/src/rust/Cargo.toml b/src/rust/Cargo.toml
14index 174eaa80..7ad053d9 100644
15--- a/src/rust/Cargo.toml
16+++ b/src/rust/Cargo.toml
17@@ -2,7 +2,7 @@
18 name = "cryptography-rust"
19 version = "0.1.0"
20 authors = ["The cryptography developers <cryptography-dev@python.org>"]
21-edition = "2018"
22+edition = "2021"
23 publish = false
24
25 [dependencies]
26--
272.30.2
28
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py b/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
new file mode 100755
index 0000000000..c111a9074c
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography/check-memfree.py
@@ -0,0 +1,10 @@
1#!/usr/bin/env python3
2# https://stackoverflow.com/questions/22102999/get-total-physical-memory-in-python/28161352
3import sys
4meminfo = dict((i.split()[0].rstrip(':'),int(i.split()[1])) for i in open('/proc/meminfo').readlines())
5mem_free = meminfo['MemTotal']/1024./1024.
6if mem_free < 2.:
7 raise RuntimeError("Insufficient free memory({:.3f}): requires > 2 GB".format(mem_free))
8 sys.exit(1)
9else:
10 print("Free memory: {:.3f} GB".format(mem_free))
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/h-test.patch b/meta-python/recipes-devtools/python/python3-cryptography/h-test.patch
deleted file mode 100644
index 9f07c73803..0000000000
--- a/meta-python/recipes-devtools/python/python3-cryptography/h-test.patch
+++ /dev/null
@@ -1,10 +0,0 @@
1--- a/tests/hypothesis/__init__.py
2+++ b/tests/hypothesis/__init__.py
3@@ -3,3 +3,7 @@
4 # for complete details.
5
6 from __future__ import absolute_import, division, print_function
7+
8+import pytest
9+hypothesis = pytest.importorskip("hypothesis")
10+
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch b/meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch
deleted file mode 100644
index 25baa42cc9..0000000000
--- a/meta-python/recipes-devtools/python/python3-cryptography/openssl3.patch
+++ /dev/null
@@ -1,62 +0,0 @@
1Encourage our old python3-cryptography to at least start to work with OpenSSL 3.
2
3- Backport one patch to err.py to remove a symbol which has been removed in
4 OpenSSL 3, and isn't used in python3-cryptography.
5 (50ec692749b7e2e62685b443f5e629627b03987e)
6
7- Backport the detection of OpenSSL 3 and don't link to FIPS_mode/FIPS_mode_set
8 (parts of f08a7de651f9e6475c8c0a67d2a61ed8b669ddf6)
9
10This is *not* a complete backport of the 3.0 support, but is enough that packages
11such as imgtool can import python3-cryptography and operate until the upgrade is
12ready.
13
14Upstream-Status: Inappropriate
15Signed-off-by: Ross Burton <ross.burton@arm.com>
16
17diff --git a/src/_cffi_src/openssl/cryptography.py b/src/_cffi_src/openssl/cryptography.py
18index f24bee5a..920a86de 100644
19--- a/src/_cffi_src/openssl/cryptography.py
20+++ b/src/_cffi_src/openssl/cryptography.py
21@@ -35,6 +35,8 @@ INCLUDES = """
22
23 #define CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER \
24 (OPENSSL_VERSION_NUMBER >= 0x1010006f && !CRYPTOGRAPHY_IS_LIBRESSL)
25+#define CRYPTOGRAPHY_OPENSSL_300_OR_GREATER \
26+ (OPENSSL_VERSION_NUMBER >= 0x30000000 && !CRYPTOGRAPHY_IS_LIBRESSL)
27
28 #define CRYPTOGRAPHY_OPENSSL_LESS_THAN_110J \
29 (OPENSSL_VERSION_NUMBER < 0x101000af || CRYPTOGRAPHY_IS_LIBRESSL)
30@@ -54,6 +56,7 @@ INCLUDES = """
31
32 TYPES = """
33 static const int CRYPTOGRAPHY_OPENSSL_110F_OR_GREATER;
34+static const int CRYPTOGRAPHY_OPENSSL_300_OR_GREATER;
35
36 static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111;
37 static const int CRYPTOGRAPHY_OPENSSL_LESS_THAN_111B;
38diff --git a/src/_cffi_src/openssl/err.py b/src/_cffi_src/openssl/err.py
39index 0dd74146..42bab4d9 100644
40--- a/src/_cffi_src/openssl/err.py
41+++ b/src/_cffi_src/openssl/err.py
42@@ -40,7 +40,6 @@ void ERR_clear_error(void);
43 void ERR_put_error(int, int, int, const char *, int);
44
45 int ERR_GET_LIB(unsigned long);
46-int ERR_GET_FUNC(unsigned long);
47 int ERR_GET_REASON(unsigned long);
48
49 """
50diff --git a/src/_cffi_src/openssl/fips.py b/src/_cffi_src/openssl/fips.py
51index c92bca49..38bfa231 100644
52--- a/src/_cffi_src/openssl/fips.py
53+++ b/src/_cffi_src/openssl/fips.py
54@@ -18,7 +18,7 @@ int FIPS_mode(void);
55 """
56
57 CUSTOMIZATIONS = """
58-#if CRYPTOGRAPHY_IS_LIBRESSL
59+#if CRYPTOGRAPHY_IS_LIBRESSL || CRYPTOGRAPHY_OPENSSL_300_OR_GREATER
60 static const long Cryptography_HAS_FIPS = 0;
61 int (*FIPS_mode_set)(int) = NULL;
62 int (*FIPS_mode)(void) = NULL;
diff --git a/meta-python/recipes-devtools/python/python3-cryptography/run-ptest b/meta-python/recipes-devtools/python/python3-cryptography/run-ptest
index 0ba239c2a4..1e97dda63e 100644
--- a/meta-python/recipes-devtools/python/python3-cryptography/run-ptest
+++ b/meta-python/recipes-devtools/python/python3-cryptography/run-ptest
@@ -1,2 +1,4 @@
1#!/bin/sh 1#!/bin/sh
2py.test 2if ./check-memfree.py; then
3 pytest -vvvv tests/
4fi
diff --git a/meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb b/meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb
deleted file mode 100644
index a4c3344278..0000000000
--- a/meta-python/recipes-devtools/python/python3-cryptography_3.3.2.bb
+++ /dev/null
@@ -1,68 +0,0 @@
1SUMMARY = "Provides cryptographic recipes and primitives to python developers"
2HOMEPAGE = "https://cryptography.io/"
3SECTION = "devel/python"
4LICENSE = "Apache-2.0 | BSD-3-Clause"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=bf405a8056a6647e7d077b0e7bc36aba \
6 file://LICENSE.APACHE;md5=4e168cce331e5c827d4c2b68a6200e1b \
7 file://LICENSE.BSD;md5=5ae30ba4123bc4f2fa49aa0b0dce887b"
8
9LDSHARED += "-pthread"
10
11SRC_URI[sha256sum] = "5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed"
12
13SRC_URI += " \
14 file://run-ptest \
15 file://h-test.patch \
16 file://openssl3.patch \
17"
18
19inherit pypi setuptools3
20
21DEPENDS += " \
22 ${PYTHON_PN}-cffi \
23 ${PYTHON_PN}-cffi-native \
24 ${PYTHON_PN}-asn1crypto \
25 ${PYTHON_PN}-six \
26"
27
28RDEPENDS:${PN} += " \
29 ${PYTHON_PN}-cffi \
30 ${PYTHON_PN}-idna \
31 ${PYTHON_PN}-asn1crypto \
32 ${PYTHON_PN}-setuptools \
33 ${PYTHON_PN}-six \
34"
35
36RDEPENDS:${PN}:class-target += " \
37 ${PYTHON_PN}-cffi \
38 ${PYTHON_PN}-idna \
39 ${PYTHON_PN}-numbers \
40 ${PYTHON_PN}-asn1crypto \
41 ${PYTHON_PN}-setuptools \
42 ${PYTHON_PN}-six \
43 ${PYTHON_PN}-threading \
44"
45
46RDEPENDS:${PN}-ptest += " \
47 ${PN} \
48 ${PYTHON_PN}-cryptography-vectors \
49 ${PYTHON_PN}-iso8601 \
50 ${PYTHON_PN}-pretend \
51 ${PYTHON_PN}-pytest \
52 ${PYTHON_PN}-pytz \
53"
54
55inherit ptest
56
57do_install_ptest() {
58 install -d ${D}${PTEST_PATH}/tests
59 cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
60 install -d ${D}${PTEST_PATH}/tests/hazmat
61 cp -rf ${S}/tests/hazmat/* ${D}${PTEST_PATH}/tests/hazmat/
62}
63
64FILES:${PN}-dbg += " \
65 ${libdir}/${PYTHON_PN}2.7/site-packages/${SRCNAME}/hazmat/bindings/.debug \
66"
67
68BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb b/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
new file mode 100644
index 0000000000..abb15381f5
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-cryptography_36.0.1.bb
@@ -0,0 +1,121 @@
1SUMMARY = "Provides cryptographic recipes and primitives to python developers"
2HOMEPAGE = "https://cryptography.io/"
3SECTION = "devel/python"
4LICENSE = "( Apache-2.0 | BSD-3-Clause ) & PSF-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=bf405a8056a6647e7d077b0e7bc36aba \
6 file://LICENSE.APACHE;md5=4e168cce331e5c827d4c2b68a6200e1b \
7 file://LICENSE.BSD;md5=5ae30ba4123bc4f2fa49aa0b0dce887b \
8 file://LICENSE.PSF;md5=43c37d21e1dbad10cddcd150ba2c0595 \
9 "
10LDSHARED += "-pthread"
11
12SRC_URI[sha256sum] = "53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"
13
14SRC_URI += " \
15 file://run-ptest \
16 file://check-memfree.py \
17 file://0001-Cargo.toml-specify-pem-version.patch \
18 file://0002-Cargo.toml-edition-2018-2021.patch \
19"
20
21inherit pypi setuptools3_rust
22
23DEPENDS += " \
24 ${PYTHON_PN}-asn1crypto-native \
25 ${PYTHON_PN}-cffi-native \
26 ${PYTHON_PN}-setuptools-rust-native \
27 ${PYTHON_PN}-six-native \
28"
29
30SRC_URI += " \
31 crate://crates.io/Inflector/0.11.4 \
32 crate://crates.io/aliasable/0.1.3 \
33 crate://crates.io/asn1/0.8.7 \
34 crate://crates.io/asn1_derive/0.8.7 \
35 crate://crates.io/autocfg/1.0.1 \
36 crate://crates.io/base64/0.13.0 \
37 crate://crates.io/bitflags/1.3.2 \
38 crate://crates.io/cfg-if/1.0.0 \
39 crate://crates.io/chrono/0.4.19 \
40 crate://crates.io/indoc-impl/0.3.6 \
41 crate://crates.io/indoc/0.3.6 \
42 crate://crates.io/instant/0.1.12 \
43 crate://crates.io/lazy_static/1.4.0 \
44 crate://crates.io/libc/0.2.112 \
45 crate://crates.io/lock_api/0.4.5 \
46 crate://crates.io/num-integer/0.1.44 \
47 crate://crates.io/num-traits/0.2.14 \
48 crate://crates.io/once_cell/1.9.0 \
49 crate://crates.io/ouroboros/0.13.0 \
50 crate://crates.io/ouroboros_macro/0.13.0 \
51 crate://crates.io/parking_lot/0.11.2 \
52 crate://crates.io/parking_lot_core/0.8.5 \
53 crate://crates.io/paste-impl/0.1.18 \
54 crate://crates.io/paste/0.1.18 \
55 crate://crates.io/pem/1.0.2 \
56 crate://crates.io/proc-macro-error-attr/1.0.4 \
57 crate://crates.io/proc-macro-error/1.0.4 \
58 crate://crates.io/proc-macro-hack/0.5.19 \
59 crate://crates.io/proc-macro2/1.0.36 \
60 crate://crates.io/pyo3-build-config/0.15.1 \
61 crate://crates.io/pyo3-macros-backend/0.15.1 \
62 crate://crates.io/pyo3-macros/0.15.1 \
63 crate://crates.io/pyo3/0.15.1 \
64 crate://crates.io/quote/1.0.14 \
65 crate://crates.io/redox_syscall/0.2.10 \
66 crate://crates.io/scopeguard/1.1.0 \
67 crate://crates.io/smallvec/1.7.0 \
68 crate://crates.io/stable_deref_trait/1.2.0 \
69 crate://crates.io/syn/1.0.85 \
70 crate://crates.io/unicode-xid/0.2.2 \
71 crate://crates.io/unindent/0.1.7 \
72 crate://crates.io/version_check/0.9.4 \
73 crate://crates.io/winapi-i686-pc-windows-gnu/0.4.0 \
74 crate://crates.io/winapi-x86_64-pc-windows-gnu/0.4.0 \
75 crate://crates.io/winapi/0.3.9 \
76"
77
78RDEPENDS:${PN} += " \
79 ${PYTHON_PN}-asn1crypto \
80 ${PYTHON_PN}-cffi \
81 ${PYTHON_PN}-idna \
82 ${PYTHON_PN}-setuptools \
83 ${PYTHON_PN}-six \
84"
85
86RDEPENDS:${PN}:append:class-target = " \
87 ${PYTHON_PN}-numbers \
88 ${PYTHON_PN}-threading \
89"
90
91RDEPENDS:${PN}-ptest += " \
92 ${PYTHON_PN}-bcrypt \
93 ${PYTHON_PN}-cryptography-vectors \
94 ${PYTHON_PN}-hypothesis \
95 ${PYTHON_PN}-iso8601 \
96 ${PYTHON_PN}-pretend \
97 ${PYTHON_PN}-psutil \
98 ${PYTHON_PN}-pytest \
99 ${PYTHON_PN}-pytest-subtests \
100 ${PYTHON_PN}-pytz \
101"
102
103inherit ptest
104
105do_install_ptest() {
106 install -D ${WORKDIR}/check-memfree.py ${D}${PTEST_PATH}/
107 install -d ${D}${PTEST_PATH}/tests
108 cp -rf ${S}/tests/* ${D}${PTEST_PATH}/tests/
109 install -d ${D}${PTEST_PATH}/tests/hazmat
110 cp -rf ${S}/tests/hazmat/* ${D}${PTEST_PATH}/tests/hazmat/
111 cp -r ${S}/pyproject.toml ${D}${PTEST_PATH}/
112}
113
114FILES:${PN}-ptest += " \
115 ${PTEST_PATH}/check-memfree.py \
116"
117FILES:${PN}-dbg += " \
118 ${PYTHON_SITEPACKAGES_DIR}/${SRCNAME}/hazmat/bindings/.debug \
119"
120
121BBCLASSEXTEND = "native nativesdk"