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.

367 lines
9.8 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:=6
  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. PYTHON3_PKG_BUILD:=0
  22. include $(INCLUDE_DIR)/package.mk
  23. include $(INCLUDE_DIR)/cmake.mk
  24. include ../../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. CMAKE_OPTIONS += \
  48. -DBUILDSWIGNODE=OFF \
  49. -DWERROR=OFF \
  50. -DPYTHON2LIBS_FOUND=FALSE \
  51. -DPYTHON2INTERP_FOUND=FALSE \
  52. define Package/libupm/Default
  53. SECTION:=libs
  54. CATEGORY:=Libraries
  55. SUBMENU:=IoT
  56. URL:=https://github.com/intel-iot-devkit/upm
  57. DEPENDS:=+libmraa +librt
  58. endef
  59. define Package/libupm/Default/description
  60. UPM is a high level repository that provides software drivers for a wide variety
  61. of commonly used sensors and actuators. These software drivers interact with the
  62. underlying hardware platform through calls to MRAA APIs.
  63. MRAA that allows you to use various sensors on platforms such as the Intel Galileo,
  64. Intel Edison, Minnowboard MAX and others.
  65. endef
  66. define Package/libupm
  67. $(call Package/libupm/Default)
  68. TITLE:=Intel IoT sensor library - Full
  69. DEPENDS+=+libjpeg +libmodbus +openzwave
  70. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module))
  71. DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-python3)
  72. endef
  73. define Package/libupm/description
  74. $(call Package/libupm/Default/description)
  75. This package contains sensor libraries
  76. endef
  77. define Package/libupm/install/Default
  78. $(INSTALL_DIR) $(1)/usr/lib/
  79. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupm*-$(2).so* $(1)/usr/lib/ ;
  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-python3,$(1),$(module)))
  92. endef
  93. define UpmPackage
  94. define UpmPackage/depends
  95. ifeq ($$(1),adafruitms1438)
  96. DEPENDS+=+libupm-pca9685
  97. endif
  98. ifeq ($$(1),ads1x15)
  99. DEPENDS+=+libupm-interfaces
  100. endif
  101. ifeq ($$(1),apa102)
  102. DEPENDS+=+libupm-utilities
  103. endif
  104. ifeq ($(1),bh1749)
  105. DEPENDS+=+libupm-utilities
  106. endif
  107. ifeq ($$(1),bh1750)
  108. DEPENDS+=+libupm-utilities
  109. endif
  110. ifeq ($(1),bh1792)
  111. DEPENDS+=+libupm-utilities
  112. endif
  113. ifeq ($$(1),bma250e)
  114. DEPENDS+=+libupm-utilities
  115. endif
  116. ifeq ($$(1),bmg160)
  117. DEPENDS+=+libupm-utilities
  118. endif
  119. ifeq ($$(1),bmi160)
  120. DEPENDS+=+libupm-utilities
  121. endif
  122. ifeq ($$(1),bmm150)
  123. DEPENDS+=+libupm-utilities
  124. endif
  125. ifeq ($$(1),bmp280)
  126. DEPENDS+=+libupm-interfaces +libupm-utilities
  127. endif
  128. ifeq ($$(1),bmpx8x)
  129. DEPENDS+=+libupm-interfaces +libupm-utilities
  130. endif
  131. ifeq ($$(1),bmx055)
  132. DEPENDS+=+libupm-utilities +libupm-bma250e +libupm-bmg160 +libupm-bmm150
  133. endif
  134. ifeq ($$(1),bno055)
  135. DEPENDS+=+libupm-utilities
  136. endif
  137. ifeq ($$(1),buzzer)
  138. DEPENDS+=+libupm-utilities
  139. endif
  140. ifeq ($$(1),cjq4435)
  141. DEPENDS+=+libupm-utilities
  142. endif
  143. ifeq ($$(1),dfrec)
  144. DEPENDS+=+libupm-utilities +libupm-ds18b20
  145. endif
  146. ifeq ($$(1),ds18b20)
  147. DEPENDS+=+libupm-utilities
  148. endif
  149. ifeq ($$(1),dfrorp)
  150. DEPENDS+=+libupm-utilities
  151. endif
  152. ifeq ($$(1),ds1808lc)
  153. DEPENDS+=+libupm-interfaces
  154. endif
  155. ifeq ($$(1),ecezo)
  156. DEPENDS+=+libupm-utilities
  157. endif
  158. ifeq ($$(1),enc03r)
  159. DEPENDS+=+libupm-utilities
  160. endif
  161. ifeq ($$(1),guvas12d)
  162. DEPENDS+=+libupm-utilities
  163. endif
  164. ifeq ($$(1),hcsr04)
  165. DEPENDS+=+libupm-utilities
  166. endif
  167. ifeq ($$(1),hka5)
  168. DEPENDS+=+libupm-utilities
  169. endif
  170. ifeq ($$(1),hlg150h)
  171. DEPENDS+=+libupm-interfaces
  172. endif
  173. ifeq ($$(1),ims)
  174. DEPENDS+=+libupm-utilities
  175. endif
  176. ifeq ($$(1),jhd1313m1)
  177. DEPENDS+=+libupm-utilities +libupm-lcm1602
  178. endif
  179. ifeq ($$(1),kxtj3)
  180. DEPENDS+=+libupm-utilities
  181. endif
  182. ifeq ($$(1),lcm1602)
  183. DEPENDS+=+libupm-utilities
  184. endif
  185. ifeq ($$(1),lcdks)
  186. DEPENDS+=+libupm-utilities +libupm-lcm1602
  187. endif
  188. ifeq ($$(1),lis2ds12)
  189. DEPENDS+=+libupm-utilities
  190. endif
  191. ifeq ($$(1),lis3dh)
  192. DEPENDS+=+libupm-utilities
  193. endif
  194. ifeq ($$(1),lp8860)
  195. DEPENDS+=+libupm-interfaces
  196. endif
  197. ifeq ($$(1),lsm303agr)
  198. DEPENDS+=+libupm-utilities
  199. endif
  200. ifeq ($$(1),lsm303d)
  201. DEPENDS+=+libupm-utilities
  202. endif
  203. ifeq ($$(1),lsm6ds3h)
  204. DEPENDS+=+libupm-utilities
  205. endif
  206. ifeq ($$(1),lsm6dsl)
  207. DEPENDS+=+libupm-utilities
  208. endif
  209. ifeq ($$(1),m24lr64e)
  210. DEPENDS+=+libupm-utilities
  211. endif
  212. ifeq ($$(1),max30100)
  213. DEPENDS+=+libupm-utilities
  214. endif
  215. ifeq ($$(1),max44009)
  216. DEPENDS+=+libupm-interfaces
  217. endif
  218. ifeq ($$(1),mb704x)
  219. DEPENDS+=+libupm-utilities
  220. endif
  221. ifeq ($$(1),mcp2515)
  222. DEPENDS+=+libupm-utilities
  223. endif
  224. ifeq ($$(1),md)
  225. DEPENDS+=+libupm-utilities
  226. endif
  227. ifeq ($$(1),mma7361)
  228. DEPENDS+=+libupm-utilities
  229. endif
  230. ifeq ($$(1),ms5611)
  231. DEPENDS+=+libupm-interfaces
  232. endif
  233. ifeq ($$(1),ms5803)
  234. DEPENDS+=+libupm-utilities
  235. endif
  236. ifeq ($$(1),my9221)
  237. DEPENDS+=+libupm-utilities
  238. endif
  239. ifeq ($$(1),nmea_gps)
  240. DEPENDS+=+libupm-utilities +libatomic
  241. endif
  242. ifeq ($$(1),nunchuck)
  243. DEPENDS+=+libupm-utilities
  244. endif
  245. ifeq ($$(1),otp538u)
  246. DEPENDS+=+libupm-utilities
  247. endif
  248. ifeq ($$(1),p9813)
  249. DEPENDS+=+libupm-utilities
  250. endif
  251. ifeq ($$(1),ppd42ns)
  252. DEPENDS+=+libupm-utilities
  253. endif
  254. ifeq ($$(1),rn2903)
  255. DEPENDS+=+libupm-utilities
  256. endif
  257. ifeq ($$(1),rsc)
  258. DEPENDS+=+libupm-utilities
  259. endif
  260. ifeq ($$(1),servo)
  261. DEPENDS+=+libupm-utilities
  262. endif
  263. ifeq ($$(1),sht1x)
  264. DEPENDS+=+libupm-utilities
  265. endif
  266. ifeq ($$(1),si1132)
  267. DEPENDS+=+libupm-interfaces
  268. endif
  269. ifeq ($$(1),si7005)
  270. DEPENDS+=+libupm-interfaces
  271. endif
  272. ifeq ($$(1),speaker)
  273. DEPENDS+=+libupm-utilities
  274. endif
  275. ifeq ($$(1),t6713)
  276. DEPENDS+=+libupm-interfaces
  277. endif
  278. ifeq ($$(1),tsl2561)
  279. DEPENDS+=+libupm-utilities
  280. endif
  281. ifeq ($$(1),uartat)
  282. DEPENDS+=+libupm-utilities
  283. endif
  284. ifeq ($$(1),uln200xa)
  285. DEPENDS+=+libupm-utilities
  286. endif
  287. ifeq ($$(1),urm37)
  288. DEPENDS+=+libupm-utilities
  289. endif
  290. ifeq ($$(1),wfs)
  291. DEPENDS+=+libupm-utilities
  292. endif
  293. ifeq ($$(1),zfm20)
  294. DEPENDS+=+libupm-utilities
  295. endif
  296. ifeq ($$(1),vcap)
  297. DEPENDS+=+libjpeg
  298. endif
  299. ifeq ($$(1),t3311)
  300. DEPENDS+=+libmodbus
  301. endif
  302. ifeq ($$(1),ozw)
  303. DEPENDS+=+openzwave
  304. endif
  305. ifeq ($$(1),hwxpxx)
  306. DEPENDS+=+libmodbus
  307. endif
  308. ifeq ($$(1),h803x)
  309. DEPENDS+=+libmodbus
  310. endif
  311. endef
  312. define Package/libupm-$(1)
  313. $(call Package/libupm/Default)
  314. $(call UpmPackage/depends,$(1))
  315. TITLE:=$(1) C/C++ library
  316. endef
  317. define Package/libupm-$(1)/description
  318. $(call Package/libupm/Default/description)
  319. This package contains $(1) sensor C/C++ library
  320. endef
  321. define Package/libupm-$(1)-python3
  322. $(call Package/libupm/Default)
  323. $(call UpmPackage/depends,$(1))
  324. TITLE:=$(1) Python3 library
  325. DEPENDS+=+libupm-$(1) +libmraa-python3 +python3-light
  326. endef
  327. define Package/libupm-$(1)-python3/description
  328. $(call Package/libupm/Default/description)
  329. This package contains $(1) sensor Python3 library
  330. endef
  331. define Package/libupm-$(1)/install
  332. $(call Package/libupm/install/Default,$$(1),$(1))
  333. endef
  334. define Package/libupm-$(1)-python3/install
  335. $(call Package/libupm/install/Default-python3,$$(1),$(1))
  336. endef
  337. endef
  338. $(eval $(call BuildPackage,libupm))
  339. $(foreach module, $(UPM_MODULES), \
  340. $(eval $(call UpmPackage,$(module))) \
  341. $(eval $(call BuildPackage,libupm-$(module))) \
  342. $(eval $(call BuildPackage,libupm-$(module)-python3)))