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.

386 lines
10 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:=libupm
  9. PKG_VERSION:=2.0.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:=https://codeload.github.com/intel-iot-devkit/upm/tar.gz/v$(PKG_VERSION)?
  13. PKG_HASH:=7dd2f4165b71e071d100b58d6a392f3cf57b0f257c82ffabf49e931b5ed6bc23
  14. PKG_BUILD_DIR:=$(BUILD_DIR)/upm-$(PKG_VERSION)
  15. PKG_MAINTAINER:=John Crispin <blogic@openwrt.org>, Hirokazu MORIKAWA <morikw2@gmail.com>
  16. PKG_LICENSE:=MIT
  17. PKG_LICENSE_FILES:=LICENSE
  18. CMAKE_INSTALL:=1
  19. CMAKE_BINARY_SUBDIR:=build
  20. PKG_USE_MIPS16:=0
  21. PKG_BUILD_PARALLEL:=1
  22. PYTHON3_PKG_BUILD:=0
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/cmake.mk
  25. include ../../lang/python/python3-package.mk
  26. UPM_MODULES:= \
  27. a110x abp ad8232 adafruitms1438 adafruitss adc121c021 adis16448 ads1x15 adxl335 adxl345 \
  28. adxrs610 am2315 apa102 apds9002 apds9930 at42qt1070 bh1749 bh1750 bh1792 biss0001 bma220 \
  29. bma250e bmg160 bmi160 bmm150 bmp280 bmpx8x bmx055 bno055 button buzzer cjq4435 collision \
  30. cwlsxxa dfrec dfrorp dfrph ds1307 ds1808lc ds18b20 ds2413 ecezo ecs1030 \
  31. ehr eldriver electromagnet emg enc03r flex gas gp2y0a gprs \
  32. gsr guvas12d h3lis331dl hcsr04 hdc1000 hdxxvxta hka5 hlg150h hm11 hmc5883l hmtrp hp20x \
  33. ht9170 htu21d hx711 ili9341 ims ina132 interfaces isd1820 itg3200 jhd1313m1 joystick12 kx122 \
  34. kxcjk1013 kxtj3 l298 l3gd20 lcd lcdks lcm1602 ldt0028 led lidarlitev3 light linefinder lis2ds12 \
  35. lis3dh lm35 lol loudness lp8860 lpd8806 lsm303agr lsm303d lsm303dlh lsm6ds3h lsm6dsl lsm9ds0 \
  36. m24lr64e mag3110 max30100 max31723 max31855 max44000 max44009 max5487 maxds3231m maxsonarez \
  37. mb704x mcp2515 mcp9808 md mg811 mhz16 mic micsv89 mlx90614 mma7361 mma7455 mma7660 mma8x5x \
  38. mmc35240 moisture mpl3115a2 mpr121 mpu9150 mq303a ms5611 ms5803 my9221 nlgpio16 nmea_gps \
  39. nrf24l01 nrf8001 nunchuck o2 otp538u p9813 pca9685 pn532 ppd42ns pulsensor relay rf22 \
  40. rfr359f rgbringcoder rhusb rn2903 rotary rotaryencoder rpr220 rsc scam sensortemplate \
  41. servo sht1x si1132 si114x si7005 slide sm130 smartdrive speaker ssd1351 st7735 stepmotor \
  42. sx1276 sx6119 t6713 ta12200 tca9548a tcs3414cs tcs37727 teams temperature \
  43. tex00 th02 tm1637 tmp006 tsl2561 ttp223 uartat uln200xa ultrasonic urm37 utilities vdiv \
  44. veml6070 water waterlevel wfs wheelencoder wt5001 xbee yg1006 zfm20 \
  45. vcap t3311 hwxpxx h803x ozw curieimu
  46. # (require libbacnet) tb7300 t8100 e50hx bacnetmstp
  47. # (require libtinyb) 2jciebu01_ble 2jciebu01_usb
  48. define Package/libupm/Default
  49. SECTION:=libs
  50. CATEGORY:=Libraries
  51. SUBMENU:=IoT
  52. URL:=https://github.com/intel-iot-devkit/upm
  53. DEPENDS:=+libmraa +librt
  54. endef
  55. define Package/libupm/Default/description
  56. UPM is a high level repository that provides software drivers for a wide variety
  57. of commonly used sensors and actuators. These software drivers interact with the
  58. underlying hardware platform through calls to MRAA APIs.
  59. MRAA that allows you to use various sensors on platforms such as the Intel Galileo,
  60. Intel Edison, Minnowboard MAX and others.
  61. endef
  62. define Package/libupm
  63. $(call Package/libupm/Default)
  64. TITLE:=Intel IoT sensor library - Full
  65. DEPENDS+=+libjpeg +libmodbus +openzwave
  66. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module))
  67. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-node)
  68. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-python3)
  69. endef
  70. define Package/libupm/description
  71. $(call Package/libupm/Default/description)
  72. This package contains sensor libraries
  73. endef
  74. define Package/libupm/install/Default
  75. $(INSTALL_DIR) $(1)/usr/lib/
  76. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupm*-$(2).so* $(1)/usr/lib/ ;
  77. endef
  78. define Package/libupm/install/Default-node
  79. $(INSTALL_DIR) $(1)/usr/lib/node/
  80. $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/jsupm_$(2) $(1)/usr/lib/node/ ;
  81. endef
  82. define Package/libupm/install/Default-python3
  83. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm
  84. $(CP) $(CMAKE_BINARY_DIR)/$(if $(filter interfaces, $(2)),,src/)$(2)/python$(PYTHON3_VERSION)/pyupm_$(2).py \
  85. $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/_pyupm_$(2).so \
  87. $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/ ;
  88. endef
  89. define Package/libupm/install
  90. $(foreach module, $(UPM_MODULES), \
  91. $(call Package/libupm/install/Default,$(1),$(module)) \
  92. $(call Package/libupm/install/Default-node,$(1),$(module)) \
  93. $(call Package/libupm/install/Default-python3,$(1),$(module)))
  94. endef
  95. define UpmPackage
  96. define UpmPackage/depends
  97. ifeq ($$(1),adafruitms1438)
  98. DEPENDS+=+libupm-pca9685
  99. endif
  100. ifeq ($$(1),ads1x15)
  101. DEPENDS+=+libupm-interfaces
  102. endif
  103. ifeq ($$(1),apa102)
  104. DEPENDS+=+libupm-utilities
  105. endif
  106. ifeq ($(1),bh1749)
  107. DEPENDS+=+libupm-utilities
  108. endif
  109. ifeq ($$(1),bh1750)
  110. DEPENDS+=+libupm-utilities
  111. endif
  112. ifeq ($(1),bh1792)
  113. DEPENDS+=+libupm-utilities
  114. endif
  115. ifeq ($$(1),bma250e)
  116. DEPENDS+=+libupm-utilities
  117. endif
  118. ifeq ($$(1),bmg160)
  119. DEPENDS+=+libupm-utilities
  120. endif
  121. ifeq ($$(1),bmi160)
  122. DEPENDS+=+libupm-utilities
  123. endif
  124. ifeq ($$(1),bmm150)
  125. DEPENDS+=+libupm-utilities
  126. endif
  127. ifeq ($$(1),bmp280)
  128. DEPENDS+=+libupm-interfaces +libupm-utilities
  129. endif
  130. ifeq ($$(1),bmpx8x)
  131. DEPENDS+=+libupm-interfaces +libupm-utilities
  132. endif
  133. ifeq ($$(1),bmx055)
  134. DEPENDS+=+libupm-utilities +libupm-bma250e +libupm-bmg160 +libupm-bmm150
  135. endif
  136. ifeq ($$(1),bno055)
  137. DEPENDS+=+libupm-utilities
  138. endif
  139. ifeq ($$(1),buzzer)
  140. DEPENDS+=+libupm-utilities
  141. endif
  142. ifeq ($$(1),cjq4435)
  143. DEPENDS+=+libupm-utilities
  144. endif
  145. ifeq ($$(1),dfrec)
  146. DEPENDS+=+libupm-utilities +libupm-ds18b20
  147. endif
  148. ifeq ($$(1),ds18b20)
  149. DEPENDS+=+libupm-utilities
  150. endif
  151. ifeq ($$(1),dfrorp)
  152. DEPENDS+=+libupm-utilities
  153. endif
  154. ifeq ($$(1),ds1808lc)
  155. DEPENDS+=+libupm-interfaces
  156. endif
  157. ifeq ($$(1),ecezo)
  158. DEPENDS+=+libupm-utilities
  159. endif
  160. ifeq ($$(1),enc03r)
  161. DEPENDS+=+libupm-utilities
  162. endif
  163. ifeq ($$(1),guvas12d)
  164. DEPENDS+=+libupm-utilities
  165. endif
  166. ifeq ($$(1),hcsr04)
  167. DEPENDS+=+libupm-utilities
  168. endif
  169. ifeq ($$(1),hka5)
  170. DEPENDS+=+libupm-utilities
  171. endif
  172. ifeq ($$(1),hlg150h)
  173. DEPENDS+=+libupm-interfaces
  174. endif
  175. ifeq ($$(1),ims)
  176. DEPENDS+=+libupm-utilities
  177. endif
  178. ifeq ($$(1),jhd1313m1)
  179. DEPENDS+=+libupm-utilities +libupm-lcm1602
  180. endif
  181. ifeq ($$(1),kxtj3)
  182. DEPENDS+=+libupm-utilities
  183. endif
  184. ifeq ($$(1),lcm1602)
  185. DEPENDS+=+libupm-utilities
  186. endif
  187. ifeq ($$(1),lcdks)
  188. DEPENDS+=+libupm-utilities +libupm-lcm1602
  189. endif
  190. ifeq ($$(1),lis2ds12)
  191. DEPENDS+=+libupm-utilities
  192. endif
  193. ifeq ($$(1),lis3dh)
  194. DEPENDS+=+libupm-utilities
  195. endif
  196. ifeq ($$(1),lp8860)
  197. DEPENDS+=+libupm-interfaces
  198. endif
  199. ifeq ($$(1),lsm303agr)
  200. DEPENDS+=+libupm-utilities
  201. endif
  202. ifeq ($$(1),lsm303d)
  203. DEPENDS+=+libupm-utilities
  204. endif
  205. ifeq ($$(1),lsm6ds3h)
  206. DEPENDS+=+libupm-utilities
  207. endif
  208. ifeq ($$(1),lsm6dsl)
  209. DEPENDS+=+libupm-utilities
  210. endif
  211. ifeq ($$(1),m24lr64e)
  212. DEPENDS+=+libupm-utilities
  213. endif
  214. ifeq ($$(1),max30100)
  215. DEPENDS+=+libupm-utilities
  216. endif
  217. ifeq ($$(1),max44009)
  218. DEPENDS+=+libupm-interfaces
  219. endif
  220. ifeq ($$(1),mb704x)
  221. DEPENDS+=+libupm-utilities
  222. endif
  223. ifeq ($$(1),mcp2515)
  224. DEPENDS+=+libupm-utilities
  225. endif
  226. ifeq ($$(1),md)
  227. DEPENDS+=+libupm-utilities
  228. endif
  229. ifeq ($$(1),mma7361)
  230. DEPENDS+=+libupm-utilities
  231. endif
  232. ifeq ($$(1),ms5611)
  233. DEPENDS+=+libupm-interfaces
  234. endif
  235. ifeq ($$(1),ms5803)
  236. DEPENDS+=+libupm-utilities
  237. endif
  238. ifeq ($$(1),my9221)
  239. DEPENDS+=+libupm-utilities
  240. endif
  241. ifeq ($$(1),nmea_gps)
  242. DEPENDS+=+libupm-utilities +libatomic
  243. endif
  244. ifeq ($$(1),nunchuck)
  245. DEPENDS+=+libupm-utilities
  246. endif
  247. ifeq ($$(1),otp538u)
  248. DEPENDS+=+libupm-utilities
  249. endif
  250. ifeq ($$(1),p9813)
  251. DEPENDS+=+libupm-utilities
  252. endif
  253. ifeq ($$(1),ppd42ns)
  254. DEPENDS+=+libupm-utilities
  255. endif
  256. ifeq ($$(1),rn2903)
  257. DEPENDS+=+libupm-utilities
  258. endif
  259. ifeq ($$(1),rsc)
  260. DEPENDS+=+libupm-utilities
  261. endif
  262. ifeq ($$(1),servo)
  263. DEPENDS+=+libupm-utilities
  264. endif
  265. ifeq ($$(1),sht1x)
  266. DEPENDS+=+libupm-utilities
  267. endif
  268. ifeq ($$(1),si1132)
  269. DEPENDS+=+libupm-interfaces
  270. endif
  271. ifeq ($$(1),si7005)
  272. DEPENDS+=+libupm-interfaces
  273. endif
  274. ifeq ($$(1),speaker)
  275. DEPENDS+=+libupm-utilities
  276. endif
  277. ifeq ($$(1),t6713)
  278. DEPENDS+=+libupm-interfaces
  279. endif
  280. ifeq ($$(1),tsl2561)
  281. DEPENDS+=+libupm-utilities
  282. endif
  283. ifeq ($$(1),uartat)
  284. DEPENDS+=+libupm-utilities
  285. endif
  286. ifeq ($$(1),uln200xa)
  287. DEPENDS+=+libupm-utilities
  288. endif
  289. ifeq ($$(1),urm37)
  290. DEPENDS+=+libupm-utilities
  291. endif
  292. ifeq ($$(1),wfs)
  293. DEPENDS+=+libupm-utilities
  294. endif
  295. ifeq ($$(1),zfm20)
  296. DEPENDS+=+libupm-utilities
  297. endif
  298. ifeq ($$(1),vcap)
  299. DEPENDS+=+libjpeg
  300. endif
  301. ifeq ($$(1),t3311)
  302. DEPENDS+=+libmodbus
  303. endif
  304. ifeq ($$(1),ozw)
  305. DEPENDS+=+openzwave
  306. endif
  307. ifeq ($$(1),hwxpxx)
  308. DEPENDS+=+libmodbus
  309. endif
  310. ifeq ($$(1),h803x)
  311. DEPENDS+=+libmodbus
  312. endif
  313. endef
  314. define Package/libupm-$(1)
  315. $(call Package/libupm/Default)
  316. $(call UpmPackage/depends,$(1))
  317. TITLE:=$(1) C/C++ library
  318. endef
  319. define Package/libupm-$(1)/description
  320. $(call Package/libupm/Default/description)
  321. This package contains $(1) sensor C/C++ library
  322. endef
  323. define Package/libupm-$(1)-node
  324. $(call Package/libupm/Default)
  325. $(call UpmPackage/depends,$(1))
  326. TITLE:=$(1) Node.js library
  327. DEPENDS+=+libupm-$(1) +libmraa-node +node
  328. endef
  329. define Package/libupm-$(1)-node/description
  330. $(call Package/libupm/Default/description)
  331. This package contains $(1) sensor Node.js library
  332. endef
  333. define Package/libupm-$(1)-python3
  334. $(call Package/libupm/Default)
  335. $(call UpmPackage/depends,$(1))
  336. TITLE:=$(1) Python3 library
  337. DEPENDS+=+libupm-$(1) +libmraa-python3 +python3-light
  338. endef
  339. define Package/libupm-$(1)-python3/description
  340. $(call Package/libupm/Default/description)
  341. This package contains $(1) sensor Python3 library
  342. endef
  343. define Package/libupm-$(1)/install
  344. $(call Package/libupm/install/Default,$$(1),$(1))
  345. endef
  346. define Package/libupm-$(1)-node/install
  347. $(call Package/libupm/install/Default-node,$$(1),$(1))
  348. endef
  349. define Package/libupm-$(1)-python3/install
  350. $(call Package/libupm/install/Default-python3,$$(1),$(1))
  351. endef
  352. endef
  353. $(eval $(call BuildPackage,libupm))
  354. $(foreach module, $(UPM_MODULES), \
  355. $(eval $(call UpmPackage,$(module))) \
  356. $(eval $(call BuildPackage,libupm-$(module))) \
  357. $(eval $(call BuildPackage,libupm-$(module)-node)) \
  358. $(eval $(call BuildPackage,libupm-$(module)-python3)))