forked from pool/micropython
Compare commits
25 Commits
Author | SHA256 | Date | |
---|---|---|---|
27022e4d37 | |||
209a792453 | |||
2bf43b10dd | |||
fd9b66dca5 | |||
448bf44040 | |||
a6a24b635e | |||
7006890406 | |||
01b131cf61 | |||
43f67de9dc | |||
57c1014676 | |||
29940afbcc | |||
606db37ba4 | |||
13e2981da0 | |||
3d22849170 | |||
bbd5d1eade | |||
b4bce45ea3 | |||
8754eecf54 | |||
f10a34b8ef | |||
00a51ba600 | |||
8cc5256482 | |||
f9074af794 | |||
2cf77b6507 | |||
f0aa806580 | |||
373d4a4356 | |||
6138c1d4bd |
BIN
micropython-1.22.2.tar.xz
(Stored with Git LFS)
BIN
micropython-1.22.2.tar.xz
(Stored with Git LFS)
Binary file not shown.
BIN
micropython-1.25.0.tar.xz
(Stored with Git LFS)
Normal file
BIN
micropython-1.25.0.tar.xz
(Stored with Git LFS)
Normal file
Binary file not shown.
231
micropython-gcc15-string-initialization.patch
Normal file
231
micropython-gcc15-string-initialization.patch
Normal file
@@ -0,0 +1,231 @@
|
|||||||
|
From 531d4839d44a90447c232d51d1bee0cae45add9a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Angus Gratton <angus@redyak.com.au>
|
||||||
|
Date: Fri, 9 May 2025 13:34:37 +1000
|
||||||
|
Subject: [PATCH 1/3] extmod/moductypes: Refactor string literal as array
|
||||||
|
initializer.
|
||||||
|
|
||||||
|
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||||
|
|
||||||
|
Also split out the duplicate string to a top-level array (probably the
|
||||||
|
duplicate string literal was interned, so unlikely to have any impact.)
|
||||||
|
|
||||||
|
This work was funded through GitHub Sponsors.
|
||||||
|
|
||||||
|
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||||
|
---
|
||||||
|
extmod/moductypes.c | 7 +++++--
|
||||||
|
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/extmod/moductypes.c b/extmod/moductypes.c
|
||||||
|
index bf45797658fa0..54abce79e06fe 100644
|
||||||
|
--- a/extmod/moductypes.c
|
||||||
|
+++ b/extmod/moductypes.c
|
||||||
|
@@ -277,15 +277,18 @@ static mp_obj_t uctypes_struct_sizeof(size_t n_args, const mp_obj_t *args) {
|
||||||
|
}
|
||||||
|
static MP_DEFINE_CONST_FUN_OBJ_VAR_BETWEEN(uctypes_struct_sizeof_obj, 1, 2, uctypes_struct_sizeof);
|
||||||
|
|
||||||
|
+static const char type2char[16] = {
|
||||||
|
+ 'B', 'b', 'H', 'h', 'I', 'i', 'Q', 'q',
|
||||||
|
+ '-', '-', '-', '-', '-', '-', 'f', 'd'
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
static inline mp_obj_t get_unaligned(uint val_type, byte *p, int big_endian) {
|
||||||
|
char struct_type = big_endian ? '>' : '<';
|
||||||
|
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||||
|
return mp_binary_get_val(struct_type, type2char[val_type], p, &p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void set_unaligned(uint val_type, byte *p, int big_endian, mp_obj_t val) {
|
||||||
|
char struct_type = big_endian ? '>' : '<';
|
||||||
|
- static const char type2char[16] = "BbHhIiQq------fd";
|
||||||
|
mp_binary_set_val(struct_type, type2char[val_type], val, p, &p);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
From 0398873d8c8096d2054db130efd1fcecba2a426d Mon Sep 17 00:00:00 2001
|
||||||
|
From: Angus Gratton <angus@redyak.com.au>
|
||||||
|
Date: Fri, 9 May 2025 13:36:05 +1000
|
||||||
|
Subject: [PATCH 2/3] py/emitinlinethumb: Refactor string literal as array
|
||||||
|
initializer.
|
||||||
|
|
||||||
|
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||||
|
|
||||||
|
This work was funded through GitHub Sponsors.
|
||||||
|
|
||||||
|
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||||
|
---
|
||||||
|
py/emitinlinethumb.c | 108 +++++++++++++++++++++----------------------
|
||||||
|
1 file changed, 54 insertions(+), 54 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/py/emitinlinethumb.c b/py/emitinlinethumb.c
|
||||||
|
index 7818bb4f46da8..d6596337ae5a6 100644
|
||||||
|
--- a/py/emitinlinethumb.c
|
||||||
|
+++ b/py/emitinlinethumb.c
|
||||||
|
@@ -150,27 +150,27 @@ typedef struct _reg_name_t { byte reg;
|
||||||
|
byte name[3];
|
||||||
|
} reg_name_t;
|
||||||
|
static const reg_name_t reg_name_table[] = {
|
||||||
|
- {0, "r0\0"},
|
||||||
|
- {1, "r1\0"},
|
||||||
|
- {2, "r2\0"},
|
||||||
|
- {3, "r3\0"},
|
||||||
|
- {4, "r4\0"},
|
||||||
|
- {5, "r5\0"},
|
||||||
|
- {6, "r6\0"},
|
||||||
|
- {7, "r7\0"},
|
||||||
|
- {8, "r8\0"},
|
||||||
|
- {9, "r9\0"},
|
||||||
|
- {10, "r10"},
|
||||||
|
- {11, "r11"},
|
||||||
|
- {12, "r12"},
|
||||||
|
- {13, "r13"},
|
||||||
|
- {14, "r14"},
|
||||||
|
- {15, "r15"},
|
||||||
|
- {10, "sl\0"},
|
||||||
|
- {11, "fp\0"},
|
||||||
|
- {13, "sp\0"},
|
||||||
|
- {14, "lr\0"},
|
||||||
|
- {15, "pc\0"},
|
||||||
|
+ {0, {'r', '0' }},
|
||||||
|
+ {1, {'r', '1' }},
|
||||||
|
+ {2, {'r', '2' }},
|
||||||
|
+ {3, {'r', '3' }},
|
||||||
|
+ {4, {'r', '4' }},
|
||||||
|
+ {5, {'r', '5' }},
|
||||||
|
+ {6, {'r', '6' }},
|
||||||
|
+ {7, {'r', '7' }},
|
||||||
|
+ {8, {'r', '8' }},
|
||||||
|
+ {9, {'r', '9' }},
|
||||||
|
+ {10, {'r', '1', '0' }},
|
||||||
|
+ {11, {'r', '1', '1' }},
|
||||||
|
+ {12, {'r', '1', '2' }},
|
||||||
|
+ {13, {'r', '1', '3' }},
|
||||||
|
+ {14, {'r', '1', '4' }},
|
||||||
|
+ {15, {'r', '1', '5' }},
|
||||||
|
+ {10, {'s', 'l' }},
|
||||||
|
+ {11, {'f', 'p' }},
|
||||||
|
+ {13, {'s', 'p' }},
|
||||||
|
+ {14, {'l', 'r' }},
|
||||||
|
+ {15, {'p', 'c' }},
|
||||||
|
};
|
||||||
|
|
||||||
|
#define MAX_SPECIAL_REGISTER_NAME_LENGTH 7
|
||||||
|
@@ -368,20 +368,20 @@ typedef struct _cc_name_t { byte cc;
|
||||||
|
byte name[2];
|
||||||
|
} cc_name_t;
|
||||||
|
static const cc_name_t cc_name_table[] = {
|
||||||
|
- { ASM_THUMB_CC_EQ, "eq" },
|
||||||
|
- { ASM_THUMB_CC_NE, "ne" },
|
||||||
|
- { ASM_THUMB_CC_CS, "cs" },
|
||||||
|
- { ASM_THUMB_CC_CC, "cc" },
|
||||||
|
- { ASM_THUMB_CC_MI, "mi" },
|
||||||
|
- { ASM_THUMB_CC_PL, "pl" },
|
||||||
|
- { ASM_THUMB_CC_VS, "vs" },
|
||||||
|
- { ASM_THUMB_CC_VC, "vc" },
|
||||||
|
- { ASM_THUMB_CC_HI, "hi" },
|
||||||
|
- { ASM_THUMB_CC_LS, "ls" },
|
||||||
|
- { ASM_THUMB_CC_GE, "ge" },
|
||||||
|
- { ASM_THUMB_CC_LT, "lt" },
|
||||||
|
- { ASM_THUMB_CC_GT, "gt" },
|
||||||
|
- { ASM_THUMB_CC_LE, "le" },
|
||||||
|
+ { ASM_THUMB_CC_EQ, { 'e', 'q' }},
|
||||||
|
+ { ASM_THUMB_CC_NE, { 'n', 'e' }},
|
||||||
|
+ { ASM_THUMB_CC_CS, { 'c', 's' }},
|
||||||
|
+ { ASM_THUMB_CC_CC, { 'c', 'c' }},
|
||||||
|
+ { ASM_THUMB_CC_MI, { 'm', 'i' }},
|
||||||
|
+ { ASM_THUMB_CC_PL, { 'p', 'l' }},
|
||||||
|
+ { ASM_THUMB_CC_VS, { 'v', 's' }},
|
||||||
|
+ { ASM_THUMB_CC_VC, { 'v', 'c' }},
|
||||||
|
+ { ASM_THUMB_CC_HI, { 'h', 'i' }},
|
||||||
|
+ { ASM_THUMB_CC_LS, { 'l', 's' }},
|
||||||
|
+ { ASM_THUMB_CC_GE, { 'g', 'e' }},
|
||||||
|
+ { ASM_THUMB_CC_LT, { 'l', 't' }},
|
||||||
|
+ { ASM_THUMB_CC_GT, { 'g', 't' }},
|
||||||
|
+ { ASM_THUMB_CC_LE, { 'l', 'e' }},
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct _format_4_op_t { byte op;
|
||||||
|
@@ -389,21 +389,21 @@ typedef struct _format_4_op_t { byte op;
|
||||||
|
} format_4_op_t;
|
||||||
|
#define X(x) (((x) >> 4) & 0xff) // only need 1 byte to distinguish these ops
|
||||||
|
static const format_4_op_t format_4_op_table[] = {
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_EOR), "eor" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_LSL), "lsl" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_LSR), "lsr" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_ASR), "asr" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_ADC), "adc" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_SBC), "sbc" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_ROR), "ror" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_TST), "tst" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_NEG), "neg" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_CMP), "cmp" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_CMN), "cmn" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_ORR), "orr" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_MUL), "mul" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_BIC), "bic" },
|
||||||
|
- { X(ASM_THUMB_FORMAT_4_MVN), "mvn" },
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_EOR), {'e', 'o', 'r' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_LSL), {'l', 's', 'l' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_LSR), {'l', 's', 'r' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_ASR), {'a', 's', 'r' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_ADC), {'a', 'd', 'c' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_SBC), {'s', 'b', 'c' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_ROR), {'r', 'o', 'r' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_TST), {'t', 's', 't' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_NEG), {'n', 'e', 'g' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_CMP), {'c', 'm', 'p' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_CMN), {'c', 'm', 'n' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_ORR), {'o', 'r', 'r' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_MUL), {'m', 'u', 'l' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_BIC), {'b', 'i', 'c' }},
|
||||||
|
+ { X(ASM_THUMB_FORMAT_4_MVN), {'m', 'v', 'n' }},
|
||||||
|
};
|
||||||
|
#undef X
|
||||||
|
|
||||||
|
@@ -428,10 +428,10 @@ typedef struct _format_vfp_op_t {
|
||||||
|
char name[3];
|
||||||
|
} format_vfp_op_t;
|
||||||
|
static const format_vfp_op_t format_vfp_op_table[] = {
|
||||||
|
- { 0x30, "add" },
|
||||||
|
- { 0x34, "sub" },
|
||||||
|
- { 0x20, "mul" },
|
||||||
|
- { 0x80, "div" },
|
||||||
|
+ { 0x30, {'a', 'd', 'd' }},
|
||||||
|
+ { 0x34, {'s', 'u', 'b' }},
|
||||||
|
+ { 0x20, {'m', 'u', 'l' }},
|
||||||
|
+ { 0x80, {'d', 'i', 'v' }},
|
||||||
|
};
|
||||||
|
|
||||||
|
// shorthand alias for whether we allow ARMv7-M instructions
|
||||||
|
|
||||||
|
From bfd5a0350a0d53f52695d373dae6ee367971b145 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Angus Gratton <angus@redyak.com.au>
|
||||||
|
Date: Fri, 9 May 2025 14:34:09 +1000
|
||||||
|
Subject: [PATCH 3/3] lib/littlefs: Fix string initializer in lfs1.c.
|
||||||
|
|
||||||
|
Avoids the new Wunterminated-string-literal when compiled with gcc 15.1.
|
||||||
|
|
||||||
|
It would be preferable to just disable this warning, but Clang
|
||||||
|
-Wunknown-warning-option kicks in even when disabling warnings so this
|
||||||
|
becomes fiddly to apply.
|
||||||
|
|
||||||
|
This work was funded through GitHub Sponsors.
|
||||||
|
|
||||||
|
Signed-off-by: Angus Gratton <angus@redyak.com.au>
|
||||||
|
---
|
||||||
|
lib/littlefs/lfs1.c | 2 +-
|
||||||
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/lib/littlefs/lfs1.c b/lib/littlefs/lfs1.c
|
||||||
|
index 6a3fd670012cc..ec18dc470258c 100644
|
||||||
|
--- a/lib/littlefs/lfs1.c
|
||||||
|
+++ b/lib/littlefs/lfs1.c
|
||||||
|
@@ -2141,7 +2141,7 @@ int lfs1_format(lfs1_t *lfs1, const struct lfs1_config *cfg) {
|
||||||
|
.d.elen = sizeof(superblock.d) - sizeof(superblock.d.magic) - 4,
|
||||||
|
.d.nlen = sizeof(superblock.d.magic),
|
||||||
|
.d.version = LFS1_DISK_VERSION,
|
||||||
|
- .d.magic = {"littlefs"},
|
||||||
|
+ .d.magic = {'l', 'i', 't', 't', 'l', 'e', 'f', 's'},
|
||||||
|
.d.block_size = lfs1->cfg->block_size,
|
||||||
|
.d.block_count = lfs1->cfg->block_count,
|
||||||
|
.d.root = {lfs1->root[0], lfs1->root[1]},
|
@@ -1,3 +1,80 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 10 20:22:14 UTC 2025 - Atri Bhattacharya <badshah400@gmail.com>
|
||||||
|
|
||||||
|
- Add micropython-gcc15-string-initialization.patch: Refactor
|
||||||
|
string literal as array initializer
|
||||||
|
(gh#micropython/micropython#17269).
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon May 26 11:53:07 UTC 2025 - Dominik Heidler <dheidler@suse.de>
|
||||||
|
|
||||||
|
- Add script to delete some 3rd party libraries from the src tar
|
||||||
|
that are not needed to build the unix port in order to
|
||||||
|
make the legal review easier
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Apr 16 11:59:42 UTC 2025 - Dominik Heidler <dheidler@suse.de>
|
||||||
|
|
||||||
|
- Update to 1.25.0
|
||||||
|
* Add ROMFS support (see also "mpremote romfs" cmd with "query", "build", and "deploy" sub-commands)
|
||||||
|
ROMFS defines a read-only, memory-mappable, extensible filesystem that can contain arbitrary resources,
|
||||||
|
including precompiled mpy files, and allows executing bytecode directly from the filesystem.
|
||||||
|
This makes importing significantly faster and use a lot less memory.
|
||||||
|
* Inline assembler now supports 32-bit RISC-V assembly code via the newly implemented @micropython.asm_rv32 decorator.
|
||||||
|
* Datagram TLS (DTLS) is now supported by the tls module and enabled on the alif, mimxrt, renesas-ra, rp2, stm32 and unix ports.
|
||||||
|
* mpremote command-line tool now supports recursive remove via the new "rm -r"
|
||||||
|
* mpremote now supports relative URLs in the package.json for installing from the local filesystem
|
||||||
|
* "mpremote mount" has optimised readline support
|
||||||
|
* full support for tuples and start/end arguments in str.startswith() and str.endswith() methods
|
||||||
|
* vfs.mount() with no arguments now returns a list of mounted filesystems
|
||||||
|
* marshal module has been added with dumps() and loads() functions
|
||||||
|
* MicroPython native linker mpy_ld.py now includes support for linking in static libraries automatically
|
||||||
|
* native modules now support 32-bit RISC-V code
|
||||||
|
* force _FILE_OFFSET_BITS=64 to fix 32-bit file ABI
|
||||||
|
* enable VfsRom on standard and coverage variants
|
||||||
|
* use the bare metal mbedTLS config in the coverage buiid
|
||||||
|
* add recursive mutex support
|
||||||
|
* main: add coverage test for mounting ROMFS filesystem at startup
|
||||||
|
- Drop fix_re_sub_test_on_python3.13.patch as not needed anymore
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Mar 17 12:24:36 UTC 2025 - Dominik Heidler <dheidler@suse.de>
|
||||||
|
|
||||||
|
- Add fix_re_sub_test_on_python3.13.patch to fix re_sub test
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Feb 18 11:48:17 UTC 2025 - Dominik Heidler <dheidler@suse.de>
|
||||||
|
|
||||||
|
- Add subpackage mpy-tools which contains mpy-cross and mpy-tool
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Feb 7 10:33:24 UTC 2025 - Dominik Heidler <dheidler@suse.de>
|
||||||
|
|
||||||
|
- Fix build for 15.6
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Feb 5 23:17:33 UTC 2025 - Dominik Heidler <dheidler@suse.de>
|
||||||
|
|
||||||
|
- Build mpremote tool
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Nov 30 19:36:52 UTC 2024 - Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
|
||||||
|
|
||||||
|
- Update to 1.24.1:
|
||||||
|
* https://github.com/micropython/micropython/releases/tag/v1.24.1
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Nov 29 18:46:03 UTC 2024 - Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
|
||||||
|
|
||||||
|
- Update to 1.24.0:
|
||||||
|
* https://github.com/micropython/micropython/releases/tag/v1.24.0
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed Sep 18 11:48:47 UTC 2024 - Yunus Acar <yunus.acar@suse.com>
|
||||||
|
|
||||||
|
- Update to 1.23.0:
|
||||||
|
* https://github.com/micropython/micropython/releases/tag/v1.23.0
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 21 09:06:25 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
Tue May 21 09:06:25 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package micropython
|
# spec file for package micropython
|
||||||
#
|
#
|
||||||
# Copyright (c) 2024 SUSE LLC
|
# Copyright (c) 2025 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,24 +16,56 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%define pythons python3
|
||||||
|
%{?sle15_python_module_pythons}
|
||||||
|
|
||||||
Name: micropython
|
Name: micropython
|
||||||
Version: 1.22.2
|
Version: 1.25.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Implementation of Python 3 with very low memory footprint
|
Summary: Implementation of Python 3 with very low memory footprint
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://micropython.org/
|
URL: https://micropython.org/
|
||||||
Source: https://micropython.org/resources/source/%{name}-%{version}.tar.xz
|
Source0: %{name}-%{version}.tar.xz
|
||||||
|
Source1: prepare.sh
|
||||||
|
# PATCH-FIX-UPSTREAM
|
||||||
|
Patch0: https://patch-diff.githubusercontent.com/raw/micropython/micropython/pull/17269.patch#/micropython-gcc15-string-initialization.patch
|
||||||
BuildRequires: openssl
|
BuildRequires: openssl
|
||||||
BuildRequires: pkgconfig
|
BuildRequires: pkgconfig
|
||||||
BuildRequires: python3
|
BuildRequires: python3
|
||||||
BuildRequires: readline-devel
|
BuildRequires: readline-devel
|
||||||
BuildRequires: pkgconfig(libffi)
|
BuildRequires: pkgconfig(libffi)
|
||||||
|
|
||||||
Recommends: micropython-lib
|
Recommends: micropython-lib
|
||||||
ExcludeArch: %{ix86} %{arm} ppc64 ppc64le
|
ExcludeArch: %{ix86} %{arm} ppc64 ppc64le
|
||||||
|
|
||||||
|
%package -n mpremote
|
||||||
|
Summary: MicroPython remote control
|
||||||
|
BuildArch: noarch
|
||||||
|
BuildRequires: %{python_module hatch-requirements-txt}
|
||||||
|
BuildRequires: %{python_module hatchling}
|
||||||
|
Requires: python3-pyserial >= 3.3
|
||||||
|
BuildRequires: %{python_module base >= 3.6}
|
||||||
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
|
BuildRequires: fdupes
|
||||||
|
BuildRequires: python-rpm-macros
|
||||||
|
|
||||||
|
%package -n mpy-tools
|
||||||
|
Summary: Tools for creating and handling precompiled .mpy files for MicroPython
|
||||||
|
Provides: mpy-cross
|
||||||
|
Provides: mpy-tool
|
||||||
|
|
||||||
%description
|
%description
|
||||||
A lean and efficient Python implementation for microcontrollers and constrained systems
|
A lean and efficient Python implementation for microcontrollers and constrained systems
|
||||||
|
|
||||||
|
%description -n mpremote
|
||||||
|
This CLI tool provides an integrated set of utilities to remotely interact with
|
||||||
|
and automate a MicroPython device over a serial connection.
|
||||||
|
|
||||||
|
%description -n mpy-tools
|
||||||
|
MicroPython tools like the mpy-cross compiler for compiling.py files to .mpy files.
|
||||||
|
Also mpy-tool for inspecting .mpy files.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -p1
|
%autosetup -p1
|
||||||
|
|
||||||
@@ -42,14 +74,37 @@ sed -i -e "s:/usr/lib/micropython:%{_prefix}/lib/micropython:g" "ports/unix/main
|
|||||||
%define make_flags V=1 MICROPY_PY_BTREE=0 MICROPY_PY_USSL=0
|
%define make_flags V=1 MICROPY_PY_BTREE=0 MICROPY_PY_USSL=0
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
# micropython
|
||||||
export CFLAGS="%optflags -Wno-dangling-pointer"
|
export CFLAGS="%optflags -Wno-dangling-pointer"
|
||||||
%make_build -C mpy-cross
|
%make_build -C mpy-cross
|
||||||
%make_build -C ports/unix STRIP=true
|
%make_build -C ports/unix STRIP=true
|
||||||
|
pushd tools/mpremote
|
||||||
|
# inject version info as there is no git checkout to get tags from
|
||||||
|
echo "VERSION = '%{version}'" > version.py
|
||||||
|
sed -i -e 's/source = "vcs"/path = "version.py"/' pyproject.toml
|
||||||
|
# remove useless shebang lines
|
||||||
|
sed -i -e 's_#!/usr/bin/env python3__' mpremote/{__main__,transport,transport_serial}.py
|
||||||
|
%pyproject_wheel
|
||||||
|
popd
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
# micropython
|
||||||
install -d %{buildroot}%{_bindir}
|
install -d %{buildroot}%{_bindir}
|
||||||
install -t %{buildroot}%{_bindir} ports/unix/build-standard/micropython
|
install -t %{buildroot}%{_bindir} ports/unix/build-standard/micropython
|
||||||
|
|
||||||
|
# mpremote
|
||||||
|
pushd tools/mpremote
|
||||||
|
%pyproject_install
|
||||||
|
popd
|
||||||
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
# remove pycache to get rid of rpmlint "W: python-bytecode-inconsistent-mtime" warnings
|
||||||
|
%python_expand rm -rf %{buildroot}%{$python_sitelib}/mpremote/__pycache__
|
||||||
|
|
||||||
|
# mpy-tools
|
||||||
|
install -m755 -D -v mpy-cross/build/mpy-cross %{buildroot}%{_bindir}/mpy-cross
|
||||||
|
install -m755 -D -v tools/mpy-tool.py %{buildroot}%{_bindir}/mpy-tool
|
||||||
|
%python3_fix_shebang
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%ifnarch x86_64
|
%ifnarch x86_64
|
||||||
# 2 tests fail: float_parse float_parse_doubleprec
|
# 2 tests fail: float_parse float_parse_doubleprec
|
||||||
@@ -57,12 +112,25 @@ install -t %{buildroot}%{_bindir} ports/unix/build-standard/micropython
|
|||||||
rm -f tests/float/float_parse.py
|
rm -f tests/float/float_parse.py
|
||||||
rm -f tests/float/float_parse_doubleprec.py
|
rm -f tests/float/float_parse_doubleprec.py
|
||||||
%endif
|
%endif
|
||||||
export MICROPY_CPYTHON3=python3
|
export MICROPY_CPYTHON3=python%python_version
|
||||||
make -C ports/unix PYTHON=%{_bindir}/python3 V=1 test
|
make -C ports/unix PYTHON=%{_bindir}/python%python_version V=1 test
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc docs/unix/*
|
%doc docs/unix/*
|
||||||
%{_bindir}/micropython
|
%{_bindir}/micropython
|
||||||
|
|
||||||
|
%files -n mpremote
|
||||||
|
%license tools/mpremote/LICENSE
|
||||||
|
%doc tools/mpremote/README.md
|
||||||
|
%{_prefix}/lib/python%{python_version}/site-packages/mpremote
|
||||||
|
%{_prefix}/lib/python%{python_version}/site-packages/mpremote-%{version}.dist-info
|
||||||
|
%{_bindir}/mpremote
|
||||||
|
|
||||||
|
%files -n mpy-tools
|
||||||
|
%doc mpy-cross/README.md
|
||||||
|
%license LICENSE
|
||||||
|
%{_bindir}/mpy-cross
|
||||||
|
%{_bindir}/mpy-tool
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
36
prepare.sh
Normal file
36
prepare.sh
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# this removes some 3rd party libraries from the src tar that are not needed to build the unix port
|
||||||
|
# in order to make the legal review easier
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
version=$(rpmspec --query micropython.spec | head -1 | cut -d- -f2)
|
||||||
|
|
||||||
|
rm -fv micropython-*.tar.xz
|
||||||
|
wget "https://micropython.org/resources/source/micropython-${version}.tar.xz" -O "micropython-${version}.tar.xz"
|
||||||
|
tar xf "micropython-${version}.tar.xz"
|
||||||
|
pushd "micropython-${version}"
|
||||||
|
rm -rv "lib/fsp"
|
||||||
|
rm -rv "lib/alif-security-toolkit"
|
||||||
|
rm -rv "lib/alif_ensemble-cmsis-dfp"
|
||||||
|
rm -rv "lib/asf4"
|
||||||
|
rm -rv "lib/cyw43-driver"
|
||||||
|
rm -rv "lib/axtls"
|
||||||
|
rm -rv "lib/tinyusb"
|
||||||
|
rm -rv "lib/stm32lib"
|
||||||
|
rm -rv "lib/btstack"
|
||||||
|
rm -rv "lib/pico-sdk"
|
||||||
|
rm -rv "lib/nrfx"
|
||||||
|
rm -rv "lib/lwip"
|
||||||
|
rm -rv "lib/libffi"
|
||||||
|
rm -rv "lib/protobuf-c"
|
||||||
|
rm -rv "lib/nxp_driver"
|
||||||
|
rm -rv "lib/arduino-lib"
|
||||||
|
rm -rv "lib/mynewt-nimble"
|
||||||
|
pushd "ports"
|
||||||
|
find . -maxdepth 1 -type d | grep -v unix | grep -v esp | grep -v rp2 | grep -v minimal | grep -v qemu | grep -v webassembly | xargs rm -rv || :
|
||||||
|
popd
|
||||||
|
popd
|
||||||
|
tar caf "micropython-${version}.tar.xz" "micropython-${version}"
|
||||||
|
rm -r "micropython-${version}"
|
Reference in New Issue
Block a user