summaryrefslogtreecommitdiff
path: root/lang/python/micropython-lib/Makefile
blob: 017f7cc83af8201dcf43f2a1912fc8d1313effd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#
# 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-lib
PKG_RELEASE:=1

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/micropython/micropython-lib.git
PKG_SOURCE_VERSION:=0c31e0b3d712fcd21982daec8bfca48ad5527a72
PKG_SOURCE_DATE:=20220324
PKG_MIRROR_HASH:=fb796c6d648e555e3e5233a3aec84be1692199b2cbae1efd7c22caf2a8c3f8f7

PKG_MAINTAINER:=Jeffery To <jeffery.to@gmail.com>
PKG_LICENSE:=MIT PSF-2.0
PKG_LICENSE_FILES:=LICENSE

PKG_BUILD_PARALLEL:=1

include $(INCLUDE_DIR)/package.mk

define Package/micropython-lib
  SUBMENU:=Python
  SECTION:=lang
  CATEGORY:=Languages
  TITLE:=micropython-lib
  URL:=https://github.com/micropython/micropython-lib
  DEPENDS:=+micropython
endef

define Package/micropython-lib/description
  This is a repository of libraries designed to be useful for writing
  MicroPython applications.
endef

Build/Compile:=:

define Package/micropython-lib/install
	for dir in micropython python-ecosys python-stdlib unix-ffi; do \
		$(INSTALL_DIR) $(1)/usr/lib/micropython/$$$$dir ; \
		$(CP) $(PKG_BUILD_DIR)/$$$$dir/* $(1)/usr/lib/micropython/$$$$dir/ ; \
	done
	$(FIND) $(1)/usr/lib/micropython \
		-not -type d \( -not -name '*.py' -o -name 'test_*' -o -name 'setup.py' \) -delete
	$(FIND) $(1)/usr/lib/micropython -mindepth 1 -empty -type d -delete
endef

$(eval $(call BuildPackage,micropython-lib))