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