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.

128 lines
3.7 KiB

  1. #
  2. # Copyright (C) 2015-2018 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:=libmraa
  9. PKG_VERSION:=2.1.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/eclipse/mraa/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=5351ce9eb654014d8ea7f43bdb2d17e6d1955536938a2ea0d467f4008e614345
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/mraa-$(PKG_VERSION)
  15. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>, Hirokazu MORIKAWA <morikw2@gmail.com>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_BUILD_DEPENDS:=node swig/host node/host
  19. CMAKE_INSTALL:=1
  20. PKG_USE_MIPS16:=0
  21. include $(INCLUDE_DIR)/package.mk
  22. include $(INCLUDE_DIR)/cmake.mk
  23. include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
  24. include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
  25. CMAKE_OPTIONS=-DENABLEEXAMPLES=0 \
  26. -DFIRMATA=ON
  27. TARGET_CFLAGS+=-I$(STAGING_DIR)/usr/include/node
  28. define Package/libmraa/Default
  29. SECTION:=libs
  30. CATEGORY:=Libraries
  31. SUBMENU:=IoT
  32. TITLE:=Eclipse MRAA lowlevel IO library
  33. URL:=https://projects.eclipse.org/projects/iot.mraa
  34. endef
  35. define Package/libmraa/Default/description
  36. Libmraa is a C/C++ library with bindings to Java, Python and JavaScript to interface
  37. with the IO on Galileo, Edison & other platforms, with a structured and sane API where
  38. port names/numbering matches the board that you are on. Use of libmraa does not tie you
  39. to specific hardware with board detection done at runtime you can create portable code
  40. that will work across the supported platforms.
  41. endef
  42. define Package/libmraa
  43. $(call Package/libmraa/Default)
  44. TITLE:=Eclipse MRAA lowlevel IO C/C++ library
  45. DEPENDS:=+libstdcpp +libjson-c @!arc @!armeb @!powerpc
  46. endef
  47. define Package/libmraa/description
  48. $(call Package/libmraa/Default/description)
  49. This package contains the C/C++ libraries.
  50. endef
  51. define Package/libmraa-node
  52. $(call Package/libmraa/Default)
  53. TITLE:=Eclipse MRAA lowlevel IO Node.js library
  54. DEPENDS:=+libmraa +node
  55. endef
  56. define Package/libmraa-node/description
  57. $(call Package/libmraa/Default/description)
  58. This package contains the Node.js libraries.
  59. endef
  60. define Package/libmraa-python
  61. $(call Package/libmraa/Default)
  62. TITLE:=Eclipse MRAA lowlevel IO Python library
  63. DEPENDS:=+libmraa +python-light
  64. endef
  65. define Package/libmraa-python/description
  66. $(call Package/libmraa/Default/description)
  67. This package contains the Python libraries.
  68. endef
  69. define Package/libmraa-python3
  70. $(call Package/libmraa/Default)
  71. TITLE:=Eclipse MRAA lowlevel IO Python3 library
  72. DEPENDS:=+libmraa +python3-light
  73. endef
  74. define Package/libmraa-python3/description
  75. $(call Package/libmraa/Default/description)
  76. This package contains the Python3 libraries.
  77. endef
  78. define Package/libmraa/install
  79. $(INSTALL_DIR) $(1)/usr/lib
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libmraa.so* $(1)/usr/lib/
  81. $(INSTALL_DIR) $(1)/usr/bin
  82. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/mraa-* $(1)/usr/bin/
  83. endef
  84. define Package/libmraa-node/install
  85. $(INSTALL_DIR) $(1)/usr/lib/node/mraa
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/mraa/* $(1)/usr/lib/node/mraa/
  87. endef
  88. define Package/libmraa-python/install
  89. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages
  90. $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/site-packages/* \
  91. $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/
  92. endef
  93. define Package/libmraa-python3/install
  94. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages
  95. $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/site-packages/* \
  96. $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/
  97. endef
  98. $(eval $(call BuildPackage,libmraa))
  99. $(eval $(call BuildPackage,libmraa-node))
  100. $(eval $(call BuildPackage,libmraa-python))
  101. $(eval $(call BuildPackage,libmraa-python3))