瀏覽代碼

Merge pull request #211 from roger-/micropython

add micropython
sbyx 10 年之前
父節點
當前提交
fbbe7093c4
共有 1 個檔案被更改,包括 58 行新增0 行删除
  1. 58
    0
      lang/micropython/Makefile

+ 58
- 0
lang/micropython/Makefile 查看文件

@@ -0,0 +1,58 @@
1
+#
2
+# Copyright (C) 2008-2010 OpenWrt.org
3
+#
4
+# This is free software, licensed under the GNU General Public License v2.
5
+# See /LICENSE for more information.
6
+#
7
+
8
+include $(TOPDIR)/rules.mk
9
+
10
+PKG_NAME:=micropython
11
+PKG_VERSION:=8.16.14
12
+PKG_RELEASE:=$(PKG_SOURCE_VERSION)-1
13
+
14
+PKG_MAINTAINER:=Roger D <rogerdammit@gmail.com>
15
+PKG_LICENSE:=MIT
16
+PKG_LICENSE_FILES:=LICENSE
17
+
18
+PKG_SOURCE_PROTO:=git
19
+PKG_SOURCE_URL:=https://github.com/micropython/micropython.git
20
+PKG_SOURCE_VERSION:=86de21b810693bccdd88d53aacb6d8acf26f09e0
21
+
22
+PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
23
+PKG_SOURCE:=$(PKG_SOURCE_SUBDIR).tar.gz
24
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
25
+PKG_BUILD_PARALLEL:=1
26
+
27
+include $(INCLUDE_DIR)/package.mk
28
+
29
+define Package/micropython
30
+  SECTION:=lang
31
+  CATEGORY:=Languages
32
+  TITLE:=Micro Python
33
+  URL:=http://micropython.org
34
+  DEPENDS:=+libc +libffi +libdl +libm
35
+endef
36
+
37
+define Package/micropython/description
38
+ This package contains Micro Python, a lean and fast implementation of the Python 3.4 programming language
39
+ that is optimised to run on a microcontroller (and low power computers).
40
+endef
41
+
42
+# The following hacks have been tested for MIPS builds, but may need to be modified for other platforms.
43
+# (Based on: https://github.com/pfalcon/micropython/blob/2663b63241498569d9acb9c7cf9e01e831dbd816/unix/build-mips.sh)
44
+TARGET_CFLAGS_EXTRA += -DMICROPY_GCREGS_SETJMP=1 -DMICROPY_NLR_SETJMP=1 -DMICROPY_EMIT_X64=0
45
+TARGET_STRIPFLAGS_EXTRA += --remove-section=.pdr -R .comment -R .gnu.version -R .gnu.version_r -R .gnu.attributes -R .reginfo -R .mdebug.abi32
46
+
47
+MAKE_FLAGS += \
48
+       -C $(PKG_BUILD_DIR)/unix \
49
+       MICROPY_USE_READLINE=0 \
50
+       CFLAGS_EXTRA="$(TARGET_CFLAGS_EXTRA)" \
51
+       STRIPFLAGS_EXTRA="$(TARGET_STRIPFLAGS_EXTRA)"
52
+
53
+define Package/micropython/install
54
+	$(INSTALL_DIR) $(1)/usr/bin
55
+	$(INSTALL_BIN) $(PKG_BUILD_DIR)/unix/micropython $(1)/usr/bin/micropython
56
+endef
57
+
58
+$(eval $(call BuildPackage,micropython))