Skip to content

Commit 06f99a2

Browse files
committed
python3-cryptoauthlib: Update to 20221114
Fix build with latest setuptools and compiler errors seens with clang 16 Signed-off-by: Khem Raj <[email protected]>
1 parent 186cc91 commit 06f99a2

File tree

3 files changed

+107
-6
lines changed

3 files changed

+107
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
From 0b76ffe124719f96fe8bc3daf6410cf3198309f4 Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Mon, 13 Feb 2023 22:07:10 -0800
4+
Subject: [PATCH] atca_iface.h: Fix function mismatches in function pointers
5+
6+
Newer compilers e.g. clang16 can detect signature mismatches in the
7+
functions used as function pointers, therefore correct the function
8+
prototypes and ensure the typedefs they use are available at the time of
9+
use
10+
11+
Fixes
12+
lib/hal/atca_hal.c:310:33: error: incompatible function pointer types assigning to 'ATCA_STATUS (*)(ATCAIface, ATCAIfaceCfg *)' (aka 'ATCA_STATUS (*)(struct atca_iface *, ATCAIfaceCfg *)') from 'ATCA_STATUS (*)(void *, void *)' [-Wincompatible-function- pointer-types]
13+
(*hal)->halinit = cfg->atcacustom.halinit;
14+
^ ~~~~~~~~~~~~~~~~~~~~~~~
15+
16+
Upstream-Status: Submitted [https://github.com/MicrochipTech/cryptoauthlib/pull/330]
17+
Signed-off-by: Khem Raj <[email protected]>
18+
---
19+
lib/atca_iface.h | 21 +++++++++------------
20+
1 file changed, 9 insertions(+), 12 deletions(-)
21+
22+
diff --git a/lib/atca_iface.h b/lib/atca_iface.h
23+
index 9dfc422..e669b33 100644
24+
--- a/lib/atca_iface.h
25+
+++ b/lib/atca_iface.h
26+
@@ -81,11 +81,12 @@ typedef enum
27+
ATCA_KIT_SPI_IFACE,
28+
ATCA_KIT_UNKNOWN_IFACE } ATCAKitType;
29+
30+
+typedef struct atca_iface * ATCAIface;
31+
32+
/* ATCAIfaceCfg is the configuration object for a device
33+
*/
34+
35+
-typedef struct
36+
+typedef struct ATCAIfaceCfgType
37+
{
38+
39+
ATCAIfaceType iface_type; // active iface - how to interpret the union below
40+
@@ -147,13 +148,13 @@ typedef struct
41+
42+
struct
43+
{
44+
- ATCA_STATUS (*halinit)(void *hal, void *cfg);
45+
- ATCA_STATUS (*halpostinit)(void *iface);
46+
- ATCA_STATUS (*halsend)(void *iface, uint8_t word_address, uint8_t *txdata, int txlength);
47+
- ATCA_STATUS (*halreceive)(void *iface, uint8_t word_address, uint8_t* rxdata, uint16_t* rxlength);
48+
- ATCA_STATUS (*halwake)(void *iface);
49+
- ATCA_STATUS (*halidle)(void *iface);
50+
- ATCA_STATUS (*halsleep)(void *iface);
51+
+ ATCA_STATUS (*halinit)(ATCAIface hal, struct ATCAIfaceCfgType* cfg);
52+
+ ATCA_STATUS (*halpostinit)(ATCAIface iface);
53+
+ ATCA_STATUS (*halsend)(ATCAIface iface, uint8_t word_address, uint8_t *txdata, int txlength);
54+
+ ATCA_STATUS (*halreceive)(ATCAIface iface, uint8_t word_address, uint8_t* rxdata, uint16_t* rxlength);
55+
+ ATCA_STATUS (*halwake)(ATCAIface iface);
56+
+ ATCA_STATUS (*halidle)(ATCAIface iface);
57+
+ ATCA_STATUS (*halsleep)(ATCAIface iface);
58+
ATCA_STATUS (*halrelease)(void* hal_data);
59+
} atcacustom;
60+
} ATCA_IFACECFG_NAME(cfg);
61+
@@ -163,10 +164,6 @@ typedef struct
62+
void * cfg_data; // opaque data used by HAL in device discovery
63+
} ATCAIfaceCfg;
64+
65+
-
66+
-
67+
-typedef struct atca_iface * ATCAIface;
68+
-
69+
/** \brief HAL Driver Structure
70+
*/
71+
typedef struct
72+
--
73+
2.39.1
74+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
From 3138909f544e24cee6b14134148c22215816b15e Mon Sep 17 00:00:00 2001
2+
From: Khem Raj <[email protected]>
3+
Date: Mon, 13 Feb 2023 16:55:42 -0800
4+
Subject: [PATCH] correct the python_requires version syntax
5+
6+
Fixes errors like
7+
'python_requires' must be a string containing valid version specifiers; Invalid specifier: '>=3.4.*'
8+
9+
Upstream-Status: Submitted [https://github.com/MicrochipTech/cryptoauthlib/pull/330]
10+
Signed-off-by: Khem Raj <[email protected]>
11+
---
12+
setup.py | 2 +-
13+
1 file changed, 1 insertion(+), 1 deletion(-)
14+
15+
diff --git a/setup.py b/setup.py
16+
index 706574c..c06593b 100644
17+
--- a/setup.py
18+
+++ b/setup.py
19+
@@ -231,6 +231,6 @@ if __name__ == '__main__':
20+
setup_requires=['setuptools>=38.6.0', 'wheel'],
21+
install_requires=['enum34;python_version<"3.4"'],
22+
ext_modules=_EXTENSIONS,
23+
- python_requires='>=3.4.*',
24+
+ python_requires='>=3.4.0',
25+
zip_safe=False
26+
)
27+
--
28+
2.39.1
29+

Diff for: recipes-support/python-cryptoauthlib/python3-cryptoauthlib_20200208.bb renamed to recipes-support/python-cryptoauthlib/python3-cryptoauthlib_20221114.bb

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ HOMEPAGE = "https://github.com/MicrochipTech/cryptoauthlib"
44
LICENSE = "CLOSED"
55
LIC_FILES_CHKSUM = ""
66

7-
SRC_URI = "https://files.pythonhosted.org/packages/1b/ed/da1709095abd203e37892f7183b68433382ce6a0f6129dfa0ac47e2ba85c/cryptoauthlib-${PV}.tar.gz \
8-
${PYPI_SRC_URI} \
9-
"
10-
SRC_URI[md5sum] = "3a464cb6ea78286353870e544f85e208"
11-
SRC_URI[sha256sum] = "7b04a4097c6f8d4b539c7425261eac3353016405b863fec2d827152ce3a652bf"
12-
137
inherit pypi setuptools3
148

9+
SRC_URI += "file://0001-correct-the-python_requires-version-syntax.patch \
10+
file://0001-atca_iface.h-Fix-function-mismatches-in-function-poi.patch"
11+
SRC_URI[sha256sum] = "cc63dba63f1983c12ad18ecb3f1595083feffc0cb827d2a8d3a54c850d26ed5d"
12+
1513
RDEPENDS:${PN} += "python3-core python3-cryptography python3-ctypes python3-datetime python3-netclient"
1614

1715
DEPENDS += "cmake-native udev"

0 commit comments

Comments
 (0)