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.

412 lines
12 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:=1.7.1
  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:=b253742b01146f4b86e20714aa24e75ca1e9d46629eab9aa8db070ce94cf3619
  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. PKG_USE_MIPS16:=0
  20. include $(INCLUDE_DIR)/package.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
  23. include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
  24. UPM_MODULES:= \
  25. a110x abp ad8232 adafruitms1438 adafruitss adc121c021 adis16448 ads1x15 adxl335 adxl345 \
  26. adxrs610 am2315 apa102 apds9002 apds9930 at42qt1070 bh1749 bh1750 bh1792 biss0001 bma220 \
  27. bma250e bmg160 bmi160 bmm150 bmp280 bmpx8x bmx055 bno055 button buzzer cjq4435 collision \
  28. cwlsxxa dfrec dfrorp dfrph ds1307 ds1808lc ds18b20 ds2413 ecezo ecs1030 \
  29. ehr eldriver electromagnet emg enc03r flex gas gp2y0a gprs grove grovecollision groveehr \
  30. groveeldriver groveelectromagnet groveemg grovegprs grovegsr grovelinefinder grovemd \
  31. grovemoisture groveo2 grovescam grovespeaker groveultrasonic grovevdiv grovewater grovewfs \
  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. define Package/libupm/Default
  48. SECTION:=libs
  49. CATEGORY:=Libraries
  50. SUBMENU:=IoT
  51. URL:=https://github.com/intel-iot-devkit/upm
  52. DEPENDS:=+libmraa +librt
  53. endef
  54. define Package/libupm/Default/description
  55. UPM is a high level repository that provides software drivers for a wide variety
  56. of commonly used sensors and actuators. These software drivers interact with the
  57. underlying hardware platform through calls to MRAA APIs.
  58. MRAA that allows you to use various sensors on platforms such as the Intel Galileo,
  59. Intel Edison, Minnowboard MAX and others.
  60. endef
  61. define Package/libupm
  62. $(call Package/libupm/Default)
  63. TITLE:=Intel IoT sensor library - Full
  64. DEPENDS+=+libjpeg +libmodbus +openzwave
  65. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module))
  66. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-node)
  67. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-python)
  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-python
  83. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm
  84. $(CP) $(PKG_BUILD_DIR)/src/$(2)/python$(PYTHON_VERSION)/pyupm_$(2).py \
  85. $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm/
  86. $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm/_pyupm_$(2).so \
  87. $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm/ ;
  88. endef
  89. define Package/libupm/install/Default-python3
  90. $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm
  91. $(CP) $(PKG_BUILD_DIR)/src/$(2)/python$(PYTHON3_VERSION)/pyupm_$(2).py \
  92. $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/
  93. $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/_pyupm_$(2).so \
  94. $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/ ;
  95. endef
  96. define Package/libupm/install
  97. $(foreach module, $(UPM_MODULES), \
  98. $(call Package/libupm/install/Default,$(1),$(module)) \
  99. $(call Package/libupm/install/Default-node,$(1),$(module)) \
  100. $(call Package/libupm/install/Default-python,$(1),$(module)) \
  101. $(call Package/libupm/install/Default-python3,$(1),$(module)))
  102. endef
  103. define UpmPackage
  104. define UpmPackage/depends
  105. ifeq ($$(1),adafruitms1438)
  106. DEPENDS+=+libupm-pca9685
  107. endif
  108. ifeq ($$(1),ads1x15)
  109. DEPENDS+=+libupm-interfaces
  110. endif
  111. ifeq ($$(1),apa102)
  112. DEPENDS+=+libupm-utilities
  113. endif
  114. ifeq ($(1),bh1749)
  115. DEPENDS+=+libupm-utilities
  116. endif
  117. ifeq ($$(1),bh1750)
  118. DEPENDS+=+libupm-utilities
  119. endif
  120. ifeq ($(1),bh1792)
  121. DEPENDS+=+libupm-utilities
  122. endif
  123. ifeq ($$(1),bma250e)
  124. DEPENDS+=+libupm-utilities
  125. endif
  126. ifeq ($$(1),bmg160)
  127. DEPENDS+=+libupm-utilities
  128. endif
  129. ifeq ($$(1),bmi160)
  130. DEPENDS+=+libupm-utilities
  131. endif
  132. ifeq ($$(1),bmm150)
  133. DEPENDS+=+libupm-utilities
  134. endif
  135. ifeq ($$(1),bmp280)
  136. DEPENDS+=+libupm-interfaces +libupm-utilities
  137. endif
  138. ifeq ($$(1),bmpx8x)
  139. DEPENDS+=+libupm-interfaces +libupm-utilities
  140. endif
  141. ifeq ($$(1),bmx055)
  142. DEPENDS+=+libupm-utilities +libupm-bma250e +libupm-bmg160 +libupm-bmm150
  143. endif
  144. ifeq ($$(1),bno055)
  145. DEPENDS+=+libupm-utilities
  146. endif
  147. ifeq ($$(1),buzzer)
  148. DEPENDS+=+libupm-utilities
  149. endif
  150. ifeq ($$(1),cjq4435)
  151. DEPENDS+=+libupm-utilities
  152. endif
  153. ifeq ($$(1),dfrec)
  154. DEPENDS+=+libupm-utilities +libupm-ds18b20
  155. endif
  156. ifeq ($$(1),ds18b20)
  157. DEPENDS+=+libupm-utilities
  158. endif
  159. ifeq ($$(1),dfrorp)
  160. DEPENDS+=+libupm-utilities
  161. endif
  162. ifeq ($$(1),ds1808lc)
  163. DEPENDS+=+libupm-interfaces
  164. endif
  165. ifeq ($$(1),ecezo)
  166. DEPENDS+=+libupm-utilities
  167. endif
  168. ifeq ($$(1),enc03r)
  169. DEPENDS+=+libupm-utilities
  170. endif
  171. ifeq ($$(1),guvas12d)
  172. DEPENDS+=+libupm-utilities
  173. endif
  174. ifeq ($$(1),hcsr04)
  175. DEPENDS+=+libupm-utilities
  176. endif
  177. ifeq ($$(1),hka5)
  178. DEPENDS+=+libupm-utilities
  179. endif
  180. ifeq ($$(1),hlg150h)
  181. DEPENDS+=+libupm-interfaces
  182. endif
  183. ifeq ($$(1),ims)
  184. DEPENDS+=+libupm-utilities
  185. endif
  186. ifeq ($$(1),jhd1313m1)
  187. DEPENDS+=+libupm-utilities +libupm-lcm1602
  188. endif
  189. ifeq ($$(1),kxtj3)
  190. DEPENDS+=+libupm-utilities
  191. endif
  192. ifeq ($$(1),lcm1602)
  193. DEPENDS+=+libupm-utilities
  194. endif
  195. ifeq ($$(1),lcdks)
  196. DEPENDS+=+libupm-utilities +libupm-lcm1602
  197. endif
  198. ifeq ($$(1),lis2ds12)
  199. DEPENDS+=+libupm-utilities
  200. endif
  201. ifeq ($$(1),lis3dh)
  202. DEPENDS+=+libupm-utilities
  203. endif
  204. ifeq ($$(1),lp8860)
  205. DEPENDS+=+libupm-interfaces
  206. endif
  207. ifeq ($$(1),lsm303agr)
  208. DEPENDS+=+libupm-utilities
  209. endif
  210. ifeq ($$(1),lsm303d)
  211. DEPENDS+=+libupm-utilities
  212. endif
  213. ifeq ($$(1),lsm6ds3h)
  214. DEPENDS+=+libupm-utilities
  215. endif
  216. ifeq ($$(1),lsm6dsl)
  217. DEPENDS+=+libupm-utilities
  218. endif
  219. ifeq ($$(1),m24lr64e)
  220. DEPENDS+=+libupm-utilities
  221. endif
  222. ifeq ($$(1),max30100)
  223. DEPENDS+=+libupm-utilities
  224. endif
  225. ifeq ($$(1),max44009)
  226. DEPENDS+=+libupm-interfaces
  227. endif
  228. ifeq ($$(1),mb704x)
  229. DEPENDS+=+libupm-utilities
  230. endif
  231. ifeq ($$(1),mcp2515)
  232. DEPENDS+=+libupm-utilities
  233. endif
  234. ifeq ($$(1),md)
  235. DEPENDS+=+libupm-utilities
  236. endif
  237. ifeq ($$(1),mma7361)
  238. DEPENDS+=+libupm-utilities
  239. endif
  240. ifeq ($$(1),ms5611)
  241. DEPENDS+=+libupm-interfaces
  242. endif
  243. ifeq ($$(1),ms5803)
  244. DEPENDS+=+libupm-utilities
  245. endif
  246. ifeq ($$(1),my9221)
  247. DEPENDS+=+libupm-utilities
  248. endif
  249. ifeq ($$(1),nmea_gps)
  250. DEPENDS+=+libupm-utilities +libatomic
  251. endif
  252. ifeq ($$(1),nunchuck)
  253. DEPENDS+=+libupm-utilities
  254. endif
  255. ifeq ($$(1),otp538u)
  256. DEPENDS+=+libupm-utilities
  257. endif
  258. ifeq ($$(1),p9813)
  259. DEPENDS+=+libupm-utilities
  260. endif
  261. ifeq ($$(1),ppd42ns)
  262. DEPENDS+=+libupm-utilities
  263. endif
  264. ifeq ($$(1),rn2903)
  265. DEPENDS+=+libupm-utilities
  266. endif
  267. ifeq ($$(1),rsc)
  268. DEPENDS+=+libupm-utilities
  269. endif
  270. ifeq ($$(1),servo)
  271. DEPENDS+=+libupm-utilities
  272. endif
  273. ifeq ($$(1),sht1x)
  274. DEPENDS+=+libupm-utilities
  275. endif
  276. ifeq ($$(1),si1132)
  277. DEPENDS+=+libupm-interfaces
  278. endif
  279. ifeq ($$(1),si7005)
  280. DEPENDS+=+libupm-interfaces
  281. endif
  282. ifeq ($$(1),speaker)
  283. DEPENDS+=+libupm-utilities
  284. endif
  285. ifeq ($$(1),t6713)
  286. DEPENDS+=+libupm-interfaces
  287. endif
  288. ifeq ($$(1),tsl2561)
  289. DEPENDS+=+libupm-utilities
  290. endif
  291. ifeq ($$(1),uartat)
  292. DEPENDS+=+libupm-utilities
  293. endif
  294. ifeq ($$(1),uln200xa)
  295. DEPENDS+=+libupm-utilities
  296. endif
  297. ifeq ($$(1),urm37)
  298. DEPENDS+=+libupm-utilities
  299. endif
  300. ifeq ($$(1),wfs)
  301. DEPENDS+=+libupm-utilities
  302. endif
  303. ifeq ($$(1),zfm20)
  304. DEPENDS+=+libupm-utilities
  305. endif
  306. ifeq ($$(1),vcap)
  307. DEPENDS+=+libjpeg
  308. endif
  309. ifeq ($$(1),t3311)
  310. DEPENDS+=+libmodbus
  311. endif
  312. ifeq ($$(1),ozw)
  313. DEPENDS+=+openzwave
  314. endif
  315. ifeq ($$(1),hwxpxx)
  316. DEPENDS+=+libmodbus
  317. endif
  318. ifeq ($$(1),h803x)
  319. DEPENDS+=+libmodbus
  320. endif
  321. endef
  322. define Package/libupm-$(1)
  323. $(call Package/libupm/Default)
  324. $(call UpmPackage/depends,$(1))
  325. TITLE:=$(1) C/C++ library
  326. endef
  327. define Package/libupm-$(1)/description
  328. $(call Package/libupm/Default/description)
  329. This package contains $(1) sensor C/C++ library
  330. endef
  331. define Package/libupm-$(1)-node
  332. $(call Package/libupm/Default)
  333. $(call UpmPackage/depends,$(1))
  334. TITLE:=$(1) Node.js library
  335. DEPENDS+=+libupm-$(1) +libmraa-node +node
  336. endef
  337. define Package/libupm-$(1)-node/description
  338. $(call Package/libupm/Default/description)
  339. This package contains $(1) sensor Node.js library
  340. endef
  341. define Package/libupm-$(1)-python
  342. $(call Package/libupm/Default)
  343. $(call UpmPackage/depends,$(1))
  344. TITLE:=$(1) Python library
  345. DEPENDS+=+libupm-$(1) +libmraa-python +python-light
  346. endef
  347. define Package/libupm-$(1)-python/description
  348. $(call Package/libupm/Default/description)
  349. This package contains $(1) sensor Python library
  350. endef
  351. define Package/libupm-$(1)-python3
  352. $(call Package/libupm/Default)
  353. $(call UpmPackage/depends,$(1))
  354. TITLE:=$(1) Python3 library
  355. DEPENDS+=+libupm-$(1) +libmraa-python3 +python3-light
  356. endef
  357. define Package/libupm-$(1)-python3/description
  358. $(call Package/libupm/Default/description)
  359. This package contains $(1) sensor Python3 library
  360. endef
  361. define Package/libupm-$(1)/install
  362. $(call Package/libupm/install/Default,$$(1),$(1))
  363. endef
  364. define Package/libupm-$(1)-node/install
  365. $(call Package/libupm/install/Default-node,$$(1),$(1))
  366. endef
  367. define Package/libupm-$(1)-python/install
  368. $(call Package/libupm/install/Default-python,$$(1),$(1))
  369. endef
  370. define Package/libupm-$(1)-python3/install
  371. $(call Package/libupm/install/Default-python3,$$(1),$(1))
  372. endef
  373. endef
  374. $(eval $(call BuildPackage,libupm))
  375. $(foreach module, $(UPM_MODULES), \
  376. $(eval $(call UpmPackage,$(module))) \
  377. $(eval $(call BuildPackage,libupm-$(module))) \
  378. $(eval $(call BuildPackage,libupm-$(module)-node)) \
  379. $(eval $(call BuildPackage,libupm-$(module)-python)) \
  380. $(eval $(call BuildPackage,libupm-$(module)-python3)))