Files
packages/lang/python/micropython/Makefile
T
Alexandru Ardelean cf71b42c4b micropython: update to 1.28.0
Changes since 1.27.0:
- New machine.CAN class with bindings for the stm32 port; support across
  all ports to follow
- machine.PWM support added to stm32 and alif ports, completing coverage
  of all Tier 1/2 MCU-based ports
- Template strings (t-strings, PEP 750) added at the "full feature" level
- weakref module added with weakref.ref and weakref.finalize classes
- f-strings now support nested f-strings within expressions
- Optimisations to native emitter; new RISC-V Zcmp arch flag for RV32
- extmod.mk: add extmod/machine_can.c (shifts the mbedtls hunk by 1 line;
  update 040-extmod-use-external-mbedtls.patch accordingly)

micropython-lib is updated in lockstep in a separate commit.

Ref: https://github.com/micropython/micropython/releases/tag/v1.28.0
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
2026-05-11 14:58:59 +03:00

132 lines
3.5 KiB
Makefile

#
# Copyright (C) 2008-2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=micropython
PKG_VERSION:=1.28.0
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://github.com/micropython/micropython/releases/download/v$(PKG_VERSION)
PKG_HASH:=4e43c59657b8da33b4bc503509a827cc3ea6cb66c446475c57776cf4467ba215
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_CPE_ID:=cpe:/a:micropython:micropython
PKG_BUILD_DEPENDS:=python3/host
PKG_BUILD_FLAGS:=no-mips16 no-mold
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
define Package/micropython/Default
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=MicroPython
URL:=https://micropython.org
DEPENDS:=+libffi
PROVIDES:=micropython
endef
define Package/micropython-mbedtls
$(call Package/micropython/Default)
TITLE+= (mbedtls)
DEPENDS+= +PACKAGE_micropython-mbedtls:libmbedtls
CONFLICTS:=micropython-nossl
VARIANT:=mbedtls
DEFAULT_VARIANT:=1
endef
define Package/micropython-nossl
$(call Package/micropython/Default)
TITLE+= (nossl)
VARIANT:=nossl
endef
define Package/micropython/Default/description
MicroPython is a lean and efficient implementation of the Python 3
programming language that includes a small subset of the Python standard
library and is optimised to run on microcontrollers and in constrained
environments.
endef
define Package/micropython-mbedtls/description
$(call Package/micropython/Default/description)
This version uses the Mbed TLS library.
endef
define Package/micropython-nossl/description
$(call Package/micropython/Default/description)
This version is built without TLS and mip.
endef
MAKE_FLAGS += BUILD_VERBOSE=1 STRIP=
ifneq ($(CONFIG_DEBUG),)
MAKE_FLAGS += DEBUG=1
endif
ifeq ($(BUILD_VARIANT),nossl)
MAKE_FLAGS += MICROPY_PY_SSL=0 FROZEN_MANIFEST=variants/standard/manifest-nossl.py
endif
# Work around "variable might be clobbered" warning leading to build error
# https://github.com/micropython/micropython/issues/12838
ifeq ($(ARCH),riscv64)
MAKE_FLAGS += CFLAGS_EXTRA=-Wno-error=clobbered
endif
TARGET_CFLAGS += \
-DMBEDTLS_CONFIG_FILE=\\\"mbedtls/build_info.h\\\"
# FIXME: remove this asap; this fixes some build issues with mbedtls from OpenWrt
TARGET_CFLAGS += \
-Wno-error=implicit-function-declaration
MAKE_PATH = ports/unix
define Build/Configure
+$(HOST_MAKE_VARS) \
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/mpy-cross \
$(HOST_MAKE_FLAGS) BUILD_VERBOSE=1
endef
define Build/InstallDev
$(INSTALL_DIR) $(2)/lib/micropython/mpy-cross
$(CP) \
$(PKG_BUILD_DIR)/mpy-cross/mpy_cross \
$(2)/lib/micropython/mpy-cross/
$(INSTALL_DIR) $(2)/lib/micropython/mpy-cross/build
$(INSTALL_BIN) \
$(PKG_BUILD_DIR)/mpy-cross/build/mpy-cross \
$(2)/lib/micropython/mpy-cross/build/
$(INSTALL_DIR) $(2)/lib/micropython/tools
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/tools/manifestfile.py \
$(2)/lib/micropython/tools/
endef
define Package/micropython/Default/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ports/unix/build-standard/micropython $(1)/usr/bin/
endef
Package/micropython-mbedtls/install = $(Package/micropython/Default/install)
Package/micropython-nossl/install = $(Package/micropython/Default/install)
$(eval $(call BuildPackage,micropython-mbedtls))
$(eval $(call BuildPackage,micropython-nossl))