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.

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