2014-08-17 18:13:11 +02:00
|
|
|
#
|
2015-07-03 18:54:20 +02:00
|
|
|
# Copyright (C) 2008-2015 OpenWrt.org
|
2014-08-17 18:13:11 +02:00
|
|
|
#
|
|
|
|
# This is free software, licensed under the GNU General Public License v2.
|
|
|
|
# See /LICENSE for more information.
|
|
|
|
#
|
|
|
|
|
|
|
|
include $(TOPDIR)/rules.mk
|
|
|
|
|
|
|
|
PKG_NAME:=micropython-lib
|
2023-10-31 10:20:33 +01:00
|
|
|
PKG_RELEASE:=1
|
2014-08-17 18:13:11 +02:00
|
|
|
|
2022-01-11 10:52:47 +01:00
|
|
|
PKG_SOURCE_PROTO:=git
|
|
|
|
PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
|
2023-10-31 10:20:33 +01:00
|
|
|
PKG_SOURCE_VERSION:=d8e163bb5f3ef45e71e145c27bc4f207beaad70f
|
|
|
|
PKG_SOURCE_DATE:=20231031
|
2024-04-06 12:47:54 +02:00
|
|
|
PKG_MIRROR_HASH:=311651a719ae645d3e40c3c8ebf706fa2e964ac1455d84bee73606ec6d7c13a2
|
2018-10-07 14:48:45 +02:00
|
|
|
|
2022-01-11 10:52:47 +01:00
|
|
|
PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
|
2023-05-29 21:24:54 +02:00
|
|
|
PKG_LICENSE:=MIT Python-2.0.1
|
2014-08-29 00:48:12 +02:00
|
|
|
PKG_LICENSE_FILES:=LICENSE
|
2014-08-17 18:13:11 +02:00
|
|
|
|
2023-05-29 21:24:54 +02:00
|
|
|
PKG_BUILD_DEPENDS:=python3/host
|
2014-08-17 18:13:11 +02:00
|
|
|
PKG_BUILD_PARALLEL:=1
|
|
|
|
|
2023-10-31 10:20:33 +01:00
|
|
|
# keep in sync with micropython (MPY_VERSION in py/persistentcode.h)
|
|
|
|
MICROPYTHON_MPY_VERSION:=6
|
2023-05-29 21:24:54 +02:00
|
|
|
|
2014-08-17 18:13:11 +02:00
|
|
|
include $(INCLUDE_DIR)/package.mk
|
|
|
|
|
2023-05-29 21:24:54 +02:00
|
|
|
define Package/micropython-lib/Default
|
2022-01-11 10:52:47 +01:00
|
|
|
SUBMENU:=Python
|
|
|
|
SECTION:=lang
|
|
|
|
CATEGORY:=Languages
|
2023-05-29 21:24:54 +02:00
|
|
|
TITLE:=MicroPython package repository
|
2022-01-11 10:52:47 +01:00
|
|
|
URL:=https://github.com/micropython/micropython-lib
|
2023-05-29 21:24:54 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib
|
|
|
|
$(call Package/micropython-lib/Default)
|
2022-01-11 10:52:47 +01:00
|
|
|
DEPENDS:=+micropython
|
2014-08-17 18:13:11 +02:00
|
|
|
endef
|
|
|
|
|
2023-05-29 21:24:54 +02:00
|
|
|
define Package/micropython-lib-src
|
|
|
|
$(call Package/micropython-lib/Default)
|
|
|
|
TITLE+= (sources)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-unix
|
|
|
|
$(call Package/micropython-lib/Default)
|
|
|
|
TITLE+= - Unix port packages
|
2023-09-28 23:51:28 +02:00
|
|
|
DEPENDS:=+micropython +libpcre2 +librt +libsqlite3
|
2023-05-29 21:24:54 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-unix-src
|
|
|
|
$(call Package/micropython-lib/Default)
|
|
|
|
TITLE+= - Unix port packages (sources)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib/Default/description
|
|
|
|
This is a repository of packages designed to be useful for writing
|
|
|
|
MicroPython applications.
|
|
|
|
endef
|
|
|
|
|
2014-08-17 18:13:11 +02:00
|
|
|
define Package/micropython-lib/description
|
2023-05-29 21:24:54 +02:00
|
|
|
$(call Package/micropython-lib/Default/description)
|
|
|
|
|
|
|
|
This contains packages common to all MicroPython ports.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-src/description
|
|
|
|
$(call Package/micropython-lib/Default/description)
|
|
|
|
|
|
|
|
This contains source files for packages common to all MicroPython ports.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-unix/description
|
|
|
|
$(call Package/micropython-lib/Default/description)
|
|
|
|
|
|
|
|
This contains packages specific to the MicroPython Unix port.
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-unix-src/description
|
|
|
|
$(call Package/micropython-lib/Default/description)
|
|
|
|
|
|
|
|
This contains source files for packages specific to the MicroPython Unix
|
|
|
|
port.
|
|
|
|
endef
|
|
|
|
|
2023-10-15 16:16:44 +02:00
|
|
|
MP_INSTALLDEV_PATH:=$(STAGING_DIR)/host/lib/micropython
|
2023-05-29 21:24:54 +02:00
|
|
|
|
|
|
|
define MicroPythonLib/Compile
|
|
|
|
cd "$(PKG_BUILD_DIR)" && python3 tools/build.py \
|
|
|
|
--hash-prefix 64 \
|
|
|
|
--micropython "$(MP_INSTALLDEV_PATH)" \
|
|
|
|
--mpy-cross "$(MP_INSTALLDEV_PATH)/mpy-cross/build/mpy-cross" \
|
|
|
|
--output "$(PKG_BUILD_DIR)/$(strip $(1))" \
|
|
|
|
$(2)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define MicroPythonLib/Install
|
|
|
|
python3 install.py \
|
|
|
|
--input "$(PKG_BUILD_DIR)/$(strip $(1))" \
|
|
|
|
--output "$(strip $(3))" \
|
|
|
|
--version "$(strip $(2))"
|
2014-08-17 18:13:11 +02:00
|
|
|
endef
|
|
|
|
|
2023-05-29 21:24:54 +02:00
|
|
|
define Build/Compile
|
|
|
|
$(call MicroPythonLib/Compile)
|
|
|
|
$(call MicroPythonLib/Compile,unix-ffi-index,--unix-ffi)
|
|
|
|
endef
|
2014-08-17 18:13:11 +02:00
|
|
|
|
|
|
|
define Package/micropython-lib/install
|
2023-10-31 10:20:33 +01:00
|
|
|
$(call MicroPythonLib/Install,,$(MICROPYTHON_MPY_VERSION),$(1)/usr/lib/micropython)
|
2023-05-29 21:24:54 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-src/install
|
|
|
|
$(call MicroPythonLib/Install,,py,$(1)/usr/lib/micropython)
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-unix/install
|
2023-10-31 10:20:33 +01:00
|
|
|
$(call MicroPythonLib/Install,unix-ffi-index,$(MICROPYTHON_MPY_VERSION),$(1)/usr/lib/micropython/unix)
|
2023-05-29 21:24:54 +02:00
|
|
|
|
|
|
|
$(INSTALL_DIR) $(1)/usr/bin
|
|
|
|
$(INSTALL_BIN) ./files/micropython-unix $(1)/usr/bin/
|
|
|
|
endef
|
|
|
|
|
|
|
|
define Package/micropython-lib-unix-src/install
|
|
|
|
$(call MicroPythonLib/Install,unix-ffi-index,py,$(1)/usr/lib/micropython/unix)
|
2014-08-17 18:13:11 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call BuildPackage,micropython-lib))
|
2023-05-29 21:24:54 +02:00
|
|
|
$(eval $(call BuildPackage,micropython-lib-src))
|
|
|
|
$(eval $(call BuildPackage,micropython-lib-unix))
|
|
|
|
$(eval $(call BuildPackage,micropython-lib-unix-src))
|