Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/micropython: add support for manifest.py in the configuration
@ 2024-02-04  6:26 Abilio Marques
  2024-02-05 13:24 ` Yann E. MORIN
  0 siblings, 1 reply; 5+ messages in thread
From: Abilio Marques @ 2024-02-04  6:26 UTC (permalink / raw)
  To: buildroot; +Cc: Chris Packham, Abilio Marques

Micropython can embed packages an modules as frozen bytecode. What code
gets built this way can be defined by means of a "manifest.py" file.

This commit exposes the variable FROZEN_MANIFEST to Buildroot users
through a new variable called BR2_PACKAGE_MICROPYTHON_MANIFEST.

Please check Micropython's documentation for more information:
https://docs.micropython.org/en/latest/reference/manifest.html

Signed-off-by: Abilio Marques <abiliojr@gmail.com>
---
 package/micropython/Config.in      | 8 ++++++++
 package/micropython/micropython.mk | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/package/micropython/Config.in b/package/micropython/Config.in
index 26a00baab0..52717d815a 100644
--- a/package/micropython/Config.in
+++ b/package/micropython/Config.in
@@ -17,6 +17,14 @@ config BR2_PACKAGE_MICROPYTHON_LIB
 	help
 	  Core Python libraries ported to MicroPython.
 
+config BR2_PACKAGE_MICROPYTHON_MANIFEST
+	string "Path to a manifest.py file"
+	help
+	  MicroPython allows Python code to be “frozen” as bytecode
+	  into its binary, as an alternative to loading code from
+	  the filesystem. See MicroPython's documentation for more
+	  information.
+
 endif # BR2_PACKAGE_MICROPYTHON
 
 comment "micropython needs a toolchain w/ threads, dynamic library"
diff --git a/package/micropython/micropython.mk b/package/micropython/micropython.mk
index 125a0edcfb..5a2c136547 100644
--- a/package/micropython/micropython.mk
+++ b/package/micropython/micropython.mk
@@ -43,6 +43,11 @@ else
 MICROPYTHON_MAKE_OPTS += MICROPY_PY_FFI=0
 endif
 
+ifneq ($(BR2_PACKAGE_MICROPYTHON_MANIFEST),"")
+MICROPYTHON_MAKE_OPTS += \
+	FROZEN_MANIFEST=$(BR2_PACKAGE_MICROPYTHON_MANIFEST)
+endif
+
 define MICROPYTHON_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/mpy-cross
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/ports/unix \
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-12  5:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-04  6:26 [Buildroot] [PATCH] package/micropython: add support for manifest.py in the configuration Abilio Marques
2024-02-05 13:24 ` Yann E. MORIN
2024-02-11 17:15   ` Abilio Marques
2024-02-11 17:54     ` Yann E. MORIN
2024-02-12  5:16       ` Abilio Marques

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox