You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

58 lines
1.9 KiB

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