From b9b01459d882499186f5325e27355c84dd4de83c Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 25 Jul 2024 02:44:12 -0400 Subject: [PATCH] micropython-lib: update to 1.23.0 and fix compile on external mbedtls3 * update micropython-lib to hash for 1.23.0 * remove micropython-lib unix-uffi patches Co-authored-by: Jeffery To Signed-off-by: Glenn Strauss --- lang/python/micropython-lib/Makefile | 6 +-- .../patches/001-build-unix-ffi.patch | 9 ++-- .../patches/002-add-unix-ffi-os-path.patch | 53 ------------------- .../patches/003-add-unix-ffi-uu.patch | 37 ------------- 4 files changed, 9 insertions(+), 96 deletions(-) delete mode 100644 lang/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch delete mode 100644 lang/python/micropython-lib/patches/003-add-unix-ffi-uu.patch diff --git a/lang/python/micropython-lib/Makefile b/lang/python/micropython-lib/Makefile index d5fdd77fda04e..fd9b31594b157 100644 --- a/lang/python/micropython-lib/Makefile +++ b/lang/python/micropython-lib/Makefile @@ -12,9 +12,9 @@ PKG_RELEASE:=1 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git -PKG_SOURCE_VERSION:=d8e163bb5f3ef45e71e145c27bc4f207beaad70f -PKG_SOURCE_DATE:=20231031 -PKG_MIRROR_HASH:=311651a719ae645d3e40c3c8ebf706fa2e964ac1455d84bee73606ec6d7c13a2 +PKG_SOURCE_VERSION:=50ed36fbeb919753bcc26ce13a8cffd7691d06ef +PKG_SOURCE_DATE:=20240525 +PKG_MIRROR_HASH:=c03c4226c461079d529b72456569797d3f87f0970e78d1c7c4d6c34d32586af4 PKG_MAINTAINER:=Jeffery To PKG_LICENSE:=MIT Python-2.0.1 diff --git a/lang/python/micropython-lib/patches/001-build-unix-ffi.patch b/lang/python/micropython-lib/patches/001-build-unix-ffi.patch index 4dfaca6f9103f..c45190c8969b8 100644 --- a/lang/python/micropython-lib/patches/001-build-unix-ffi.patch +++ b/lang/python/micropython-lib/patches/001-build-unix-ffi.patch @@ -9,16 +9,19 @@ import manifestfile import mpy_cross -@@ -310,7 +310,7 @@ def build(output_path, hash_prefix_len, +@@ -310,7 +310,10 @@ def build(output_path, hash_prefix_len, # For now, don't process unix-ffi. In the future this can be extended to # allow a way to request unix-ffi packages via mip. - lib_dirs = ["micropython", "python-stdlib", "python-ecosys"] + lib_dirs = ["unix-ffi"] if unix_ffi else ["micropython", "python-stdlib", "python-ecosys"] ++ ++ if unix_ffi: ++ manifestfile.BASE_LIBRARY_NAMES = ("unix-ffi",) + manifestfile.BASE_LIBRARY_NAMES mpy_version, _mpy_sub_version = mpy_cross.mpy_version(mpy_cross=mpy_cross_path) mpy_version = str(mpy_version) -@@ -438,6 +438,7 @@ def main(): +@@ -438,6 +441,7 @@ def main(): cmd_parser = argparse.ArgumentParser(description="Compile micropython-lib for serving to mip.") cmd_parser.add_argument("--output", required=True, help="output directory") @@ -26,7 +29,7 @@ cmd_parser.add_argument("--hash-prefix", default=8, type=int, help="hash prefix length") cmd_parser.add_argument("--mpy-cross", default=None, help="optional path to mpy-cross binary") cmd_parser.add_argument("--micropython", default=None, help="path to micropython repo") -@@ -447,7 +448,7 @@ def main(): +@@ -447,7 +451,7 @@ def main(): sys.path.append(os.path.join(args.micropython, "tools")) # for manifestfile sys.path.append(os.path.join(args.micropython, "mpy-cross")) # for mpy_cross diff --git a/lang/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch b/lang/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch deleted file mode 100644 index 5ebc6820ec332..0000000000000 --- a/lang/python/micropython-lib/patches/002-add-unix-ffi-os-path.patch +++ /dev/null @@ -1,53 +0,0 @@ -From dcce62dd525cf0f8e572e56a8990aea7ec2f0ade Mon Sep 17 00:00:00 2001 -From: Jeffery To -Date: Tue, 30 May 2023 23:47:59 +0800 -Subject: [PATCH] unix-ffi/os-path: Add unix-ffi version of `os-path` package. - -This package reuses the code from the python-stdlib version of `os-path` -but requires the unix-ffi version of `os`. - -This also updates `glob` to require this version of `os-path`. - -Signed-off-by: Jeffery To ---- - unix-ffi/glob/manifest.py | 2 +- - unix-ffi/os-path/manifest.py | 6 ++++++ - unix-ffi/os/os/__init__.py | 6 ++++++ - 3 files changed, 13 insertions(+), 1 deletion(-) - create mode 100644 unix-ffi/os-path/manifest.py - ---- a/unix-ffi/glob/manifest.py -+++ b/unix-ffi/glob/manifest.py -@@ -1,7 +1,7 @@ - metadata(version="0.5.2") - - require("os", unix_ffi=True) --require("os-path") -+require("os-path", unix_ffi=True) - require("re", unix_ffi=True) - require("fnmatch") - ---- /dev/null -+++ b/unix-ffi/os-path/manifest.py -@@ -0,0 +1,6 @@ -+metadata(version="0.1.4") -+ -+# Originally written by Paul Sokolovsky. -+ -+require("os", unix_ffi=True) -+package("os", base_path="../../python-stdlib/os-path") ---- a/unix-ffi/os/os/__init__.py -+++ b/unix-ffi/os/os/__init__.py -@@ -5,6 +5,12 @@ import stat as stat_ - import ffilib - import uos - -+# Provide optional dependencies (which may be installed separately). -+try: -+ from . import path -+except ImportError: -+ pass -+ - R_OK = const(4) - W_OK = const(2) - X_OK = const(1) diff --git a/lang/python/micropython-lib/patches/003-add-unix-ffi-uu.patch b/lang/python/micropython-lib/patches/003-add-unix-ffi-uu.patch deleted file mode 100644 index 363fae394acfb..0000000000000 --- a/lang/python/micropython-lib/patches/003-add-unix-ffi-uu.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 2e7bfd08a306bd9e80b22097ef8fe66e1dd85054 Mon Sep 17 00:00:00 2001 -From: Jeffery To -Date: Wed, 31 May 2023 00:00:11 +0800 -Subject: [PATCH] unix-ffi/uu: Add unix-ffi version of `uu` package. - -This package reuses the code from the python-stdlib version of `uu` but -requires the unix-ffi version of `os-path`. - -This also updates `email.message` to require this version of `uu`. - -Signed-off-by: Jeffery To ---- - unix-ffi/email.message/manifest.py | 2 +- - unix-ffi/uu/manifest.py | 6 ++++++ - 2 files changed, 7 insertions(+), 1 deletion(-) - create mode 100644 unix-ffi/uu/manifest.py - ---- a/unix-ffi/email.message/manifest.py -+++ b/unix-ffi/email.message/manifest.py -@@ -1,7 +1,7 @@ - metadata(version="0.5.3") - - require("re", unix_ffi=True) --require("uu") -+require("uu", unix_ffi=True) - require("base64") - require("binascii") - require("email.utils", unix_ffi=True) ---- /dev/null -+++ b/unix-ffi/uu/manifest.py -@@ -0,0 +1,6 @@ -+metadata(version="0.5.1") -+ -+require("binascii") -+require("os-path", unix_ffi=True) -+ -+module("uu.py", base_path="../../python-stdlib/uu")