From e8845b49a22b6e32fb48f2fa08f2abe98a82dc6e Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Tue, 13 Nov 2018 13:50:37 -0800 Subject: [PATCH] libupm: Update to 1.7.1 The libmraa update introduced several API changes that broke libupm. Signed-off-by: Rosen Penev --- libs/libupm/Makefile | 405 ++++++++++++++++++-- libs/libupm/patches/001-version.patch | 16 +- libs/libupm/patches/002-at42qt1070-id.patch | 2 +- libs/libupm/patches/003-link-atomic.patch | 8 + libs/libupm/patches/003-lsm303-args.patch | 11 - 5 files changed, 385 insertions(+), 57 deletions(-) create mode 100644 libs/libupm/patches/003-link-atomic.patch delete mode 100644 libs/libupm/patches/003-lsm303-args.patch diff --git a/libs/libupm/Makefile b/libs/libupm/Makefile index 4ff86afc83..384ab1816c 100644 --- a/libs/libupm/Makefile +++ b/libs/libupm/Makefile @@ -1,5 +1,5 @@ # -# Copyright (C) 2015 OpenWrt.org +# Copyright (C) 2015-2018 OpenWrt.org # # This is free software, licensed under the GNU General Public License v2. # See /LICENSE for more information. @@ -8,76 +8,405 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libupm -PKG_VERSION:=0.4.0 +PKG_VERSION:=1.7.1 +PKG_RELEASE:=1 -PKG_RELEASE=$(PKG_SOURCE_VERSION)-1 +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/intel-iot-devkit/upm/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=b253742b01146f4b86e20714aa24e75ca1e9d46629eab9aa8db070ce94cf3619 +PKG_BUILD_DIR:=$(BUILD_DIR)/upm-$(PKG_VERSION) + +PKG_MAINTAINER:=John Crispin , Hirokazu MORIKAWA +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/intel-iot-devkit/upm.git -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=04dc6df4297a7766d6f1a8fef9699d586e7e0d92 -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz -PKG_MIRROR_HASH:=26bc9c32eea0b8aa6218735e30a3d2317431518f0b2a055c0f21e78e6d92ca4f CMAKE_INSTALL:=1 - -PKG_MAINTAINER:=John Crispin -PKG_LICENSE:=LGPL-2.1 +PKG_USE_MIPS16:=0 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk +include $(TOPDIR)/feeds/packages/lang/python/python-package.mk +include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk UPM_MODULES:= \ - a110x ad8232 adafruitss adc121c021 adis16448 adxl335 adxl345 am2315 apds9002 at42qt1070 biss0001 bmpx8x buzzer \ - cjq4435 ds1307 ecs1030 enc03r flex gas gp2y0a grovecircularled grovecollision groveehr groveeldriver groveelectromagnet \ - groveemg grovegprs grovegsr grovelinefinder grovemd grovemoisture groveo2 grovescam grove grovespeaker grovevdiv grovewater \ - grovewfs guvas12d h3lis331dl hcsr04 hm11 hmc5883l hmtrp hp20x ht9170 htu21d hx711 i2clcd ina132 isd1820 itg3200 joystick12 \ - l298 ldt0028 lm35 lol loudness lpd8806 lsm303 lsm9ds0 m24lr64e max31723 max31855 max44000 max5487 maxds3231m maxsonarez \ - mg811 mhz16 mic mlx90614 mma7455 mma7660 mpl3115a2 mpr121 mpu9150 mq303a my9221 nrf24l01 nrf8001 nunchuck otp538u \ - pn532 ppd42ns pulsensor rfr359f rgbringcoder rotaryencoder rpr220 servo si114x sm130 st7735 stepmotor sx6119 ta12200 tcs3414cs \ - th02 tm1637 tsl2561 ttp223 ublox6 uln200xa waterlevel wheelencoder wt5001 yg1006 zfm20 - -CMAKE_OPTIONS=-DBUILDARCH=$(CONFIG_ARCH) \ - -DNODE_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/node \ - -DPython_ADDITIONAL_VERSIONS=2.7 + a110x abp ad8232 adafruitms1438 adafruitss adc121c021 adis16448 ads1x15 adxl335 adxl345 \ + adxrs610 am2315 apa102 apds9002 apds9930 at42qt1070 bh1749 bh1750 bh1792 biss0001 bma220 \ + bma250e bmg160 bmi160 bmm150 bmp280 bmpx8x bmx055 bno055 button buzzer cjq4435 collision \ + cwlsxxa dfrec dfrorp dfrph ds1307 ds1808lc ds18b20 ds2413 ecezo ecs1030 \ + ehr eldriver electromagnet emg enc03r flex gas gp2y0a gprs grove grovecollision groveehr \ + groveeldriver groveelectromagnet groveemg grovegprs grovegsr grovelinefinder grovemd \ + grovemoisture groveo2 grovescam grovespeaker groveultrasonic grovevdiv grovewater grovewfs \ + gsr guvas12d h3lis331dl hcsr04 hdc1000 hdxxvxta hka5 hlg150h hm11 hmc5883l hmtrp hp20x \ + ht9170 htu21d hx711 ili9341 ims ina132 interfaces isd1820 itg3200 jhd1313m1 joystick12 kx122 \ + kxcjk1013 kxtj3 l298 l3gd20 lcd lcdks lcm1602 ldt0028 led lidarlitev3 light linefinder lis2ds12 \ + lis3dh lm35 lol loudness lp8860 lpd8806 lsm303agr lsm303d lsm303dlh lsm6ds3h lsm6dsl lsm9ds0 \ + m24lr64e mag3110 max30100 max31723 max31855 max44000 max44009 max5487 maxds3231m maxsonarez \ + mb704x mcp2515 mcp9808 md mg811 mhz16 mic micsv89 mlx90614 mma7361 mma7455 mma7660 mma8x5x \ + mmc35240 moisture mpl3115a2 mpr121 mpu9150 mq303a ms5611 ms5803 my9221 nlgpio16 nmea_gps \ + nrf24l01 nrf8001 nunchuck o2 otp538u p9813 pca9685 pn532 ppd42ns pulsensor relay rf22 \ + rfr359f rgbringcoder rhusb rn2903 rotary rotaryencoder rpr220 rsc scam sensortemplate \ + servo sht1x si1132 si114x si7005 slide sm130 smartdrive speaker ssd1351 st7735 stepmotor \ + sx1276 sx6119 t6713 ta12200 tca9548a tcs3414cs tcs37727 teams temperature \ + tex00 th02 tm1637 tmp006 tsl2561 ttp223 uartat uln200xa ultrasonic urm37 utilities vdiv \ + veml6070 water waterlevel wfs wheelencoder wt5001 xbee yg1006 zfm20 \ + vcap t3311 hwxpxx h803x ozw curieimu +# (require libbacnet) tb7300 t8100 e50hx bacnetmstp define Package/libupm/Default SECTION:=libs CATEGORY:=Libraries - DEPENDS:=+libmraa +librt SUBMENU:=IoT + URL:=https://github.com/intel-iot-devkit/upm + DEPENDS:=+libmraa +librt +endef + +define Package/libupm/Default/description + UPM is a high level repository that provides software drivers for a wide variety +of commonly used sensors and actuators. These software drivers interact with the +underlying hardware platform through calls to MRAA APIs. + MRAA that allows you to use various sensors on platforms such as the Intel Galileo, +Intel Edison, Minnowboard MAX and others. endef define Package/libupm $(call Package/libupm/Default) TITLE:=Intel IoT sensor library - Full + DEPENDS+=+libjpeg +libmodbus +openzwave + DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)) + DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-node) + DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-python) + DEPENDS+= $(foreach module, $(UPM_MODULES), +libupm-$(module)-python3) +endef + +define Package/libupm/description +$(call Package/libupm/Default/description) + +This package contains sensor libraries endef define Package/libupm/install/Default - $(INSTALL_DIR) $(1)/usr/lib/{node/,python2.7/site-packages}; \ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupm-$(2).so* $(1)/usr/lib/; \ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/jsupm_$(2) $(1)/usr/lib/node/; \ - $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/{pyupm_$(2).py,_pyupm_$(2).so} \ - $(1)/usr/lib/python2.7/site-packages/ ; + $(INSTALL_DIR) $(1)/usr/lib/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libupm*-$(2).so* $(1)/usr/lib/ ; +endef + +define Package/libupm/install/Default-node + $(INSTALL_DIR) $(1)/usr/lib/node/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/node_modules/jsupm_$(2) $(1)/usr/lib/node/ ; +endef + +define Package/libupm/install/Default-python + $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm + $(CP) $(PKG_BUILD_DIR)/src/$(2)/python$(PYTHON_VERSION)/pyupm_$(2).py \ + $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm/_pyupm_$(2).so \ + $(1)/usr/lib/python$(PYTHON_VERSION)/site-packages/upm/ ; +endef + +define Package/libupm/install/Default-python3 + $(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm + $(CP) $(PKG_BUILD_DIR)/src/$(2)/python$(PYTHON3_VERSION)/pyupm_$(2).py \ + $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/ + $(CP) $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/_pyupm_$(2).so \ + $(1)/usr/lib/python$(PYTHON3_VERSION)/site-packages/upm/ ; endef define Package/libupm/install - $(foreach module, $(UPM_MODULES), \ - $(call Package/libupm/install/Default,$(1),$(module))) + $(foreach module, $(UPM_MODULES), \ + $(call Package/libupm/install/Default,$(1),$(module)) \ + $(call Package/libupm/install/Default-node,$(1),$(module)) \ + $(call Package/libupm/install/Default-python,$(1),$(module)) \ + $(call Package/libupm/install/Default-python3,$(1),$(module))) endef define UpmPackage +define UpmPackage/depends + ifeq ($$(1),adafruitms1438) + DEPENDS+=+libupm-pca9685 + endif + ifeq ($$(1),ads1x15) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),apa102) + DEPENDS+=+libupm-utilities + endif + ifeq ($(1),bh1749) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),bh1750) + DEPENDS+=+libupm-utilities + endif + ifeq ($(1),bh1792) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),bma250e) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),bmg160) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),bmi160) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),bmm150) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),bmp280) + DEPENDS+=+libupm-interfaces +libupm-utilities + endif + ifeq ($$(1),bmpx8x) + DEPENDS+=+libupm-interfaces +libupm-utilities + endif + ifeq ($$(1),bmx055) + DEPENDS+=+libupm-utilities +libupm-bma250e +libupm-bmg160 +libupm-bmm150 + endif + ifeq ($$(1),bno055) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),buzzer) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),cjq4435) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),dfrec) + DEPENDS+=+libupm-utilities +libupm-ds18b20 + endif + ifeq ($$(1),ds18b20) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),dfrorp) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),ds1808lc) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),ecezo) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),enc03r) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),guvas12d) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),hcsr04) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),hka5) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),hlg150h) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),ims) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),jhd1313m1) + DEPENDS+=+libupm-utilities +libupm-lcm1602 + endif + ifeq ($$(1),kxtj3) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lcm1602) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lcdks) + DEPENDS+=+libupm-utilities +libupm-lcm1602 + endif + ifeq ($$(1),lis2ds12) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lis3dh) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lp8860) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),lsm303agr) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lsm303d) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lsm6ds3h) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),lsm6dsl) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),m24lr64e) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),max30100) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),max44009) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),mb704x) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),mcp2515) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),md) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),mma7361) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),ms5611) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),ms5803) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),my9221) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),nmea_gps) + DEPENDS+=+libupm-utilities +libatomic + endif + ifeq ($$(1),nunchuck) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),otp538u) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),p9813) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),ppd42ns) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),rn2903) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),rsc) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),servo) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),sht1x) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),si1132) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),si7005) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),speaker) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),t6713) + DEPENDS+=+libupm-interfaces + endif + ifeq ($$(1),tsl2561) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),uartat) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),uln200xa) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),urm37) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),wfs) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),zfm20) + DEPENDS+=+libupm-utilities + endif + ifeq ($$(1),vcap) + DEPENDS+=+libjpeg + endif + ifeq ($$(1),t3311) + DEPENDS+=+libmodbus + endif + ifeq ($$(1),ozw) + DEPENDS+=+openzwave + endif + ifeq ($$(1),hwxpxx) + DEPENDS+=+libmodbus + endif + ifeq ($$(1),h803x) + DEPENDS+=+libmodbus + endif +endef + define Package/libupm-$(1) $(call Package/libupm/Default) - TITLE:=Intel IoT sensor library - $(1) + $(call UpmPackage/depends,$(1)) + TITLE:=$(1) C/C++ library +endef + +define Package/libupm-$(1)/description +$(call Package/libupm/Default/description) + +This package contains $(1) sensor C/C++ library +endef + +define Package/libupm-$(1)-node + $(call Package/libupm/Default) + $(call UpmPackage/depends,$(1)) + TITLE:=$(1) Node.js library + DEPENDS+=+libupm-$(1) +libmraa-node +node +endef + +define Package/libupm-$(1)-node/description +$(call Package/libupm/Default/description) + +This package contains $(1) sensor Node.js library +endef + +define Package/libupm-$(1)-python + $(call Package/libupm/Default) + $(call UpmPackage/depends,$(1)) + TITLE:=$(1) Python library + DEPENDS+=+libupm-$(1) +libmraa-python +python-light +endef + +define Package/libupm-$(1)-python/description +$(call Package/libupm/Default/description) + +This package contains $(1) sensor Python library +endef + +define Package/libupm-$(1)-python3 + $(call Package/libupm/Default) + $(call UpmPackage/depends,$(1)) + TITLE:=$(1) Python3 library + DEPENDS+=+libupm-$(1) +libmraa-python3 +python3-light +endef + +define Package/libupm-$(1)-python3/description +$(call Package/libupm/Default/description) + +This package contains $(1) sensor Python3 library endef define Package/libupm-$(1)/install - $(call Package/libupm/install/Default,$$(1),$(1)) + $(call Package/libupm/install/Default,$$(1),$(1)) +endef +define Package/libupm-$(1)-node/install + $(call Package/libupm/install/Default-node,$$(1),$(1)) +endef +define Package/libupm-$(1)-python/install + $(call Package/libupm/install/Default-python,$$(1),$(1)) +endef +define Package/libupm-$(1)-python3/install + $(call Package/libupm/install/Default-python3,$$(1),$(1)) endef endef $(eval $(call BuildPackage,libupm)) -$(foreach package, $(UPM_MODULES), \ - $(eval $(call UpmPackage,$(package))) \ - $(eval $(call BuildPackage,libupm-$(package))) \ -) +$(foreach module, $(UPM_MODULES), \ + $(eval $(call UpmPackage,$(module))) \ + $(eval $(call BuildPackage,libupm-$(module))) \ + $(eval $(call BuildPackage,libupm-$(module)-node)) \ + $(eval $(call BuildPackage,libupm-$(module)-python)) \ + $(eval $(call BuildPackage,libupm-$(module)-python3))) diff --git a/libs/libupm/patches/001-version.patch b/libs/libupm/patches/001-version.patch index 3d4fd6cac6..ef07c25dc3 100644 --- a/libs/libupm/patches/001-version.patch +++ b/libs/libupm/patches/001-version.patch @@ -1,16 +1,18 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -26,12 +26,7 @@ - include(GNUInstallDirs) +@@ -225,14 +225,7 @@ include(GNUInstallDirs) + set (LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "Installation path for libraries") # Make a version file containing the current version from git. -include (GetGitRevisionDescription) -git_describe (VERSION "--tags") --if ("x_${VERSION}" STREQUAL "x_GIT-NOTFOUND") -- message (WARNING " - Install git to compile a production UPM!") -- set (VERSION "v0.4.0-dirty") +-# If git_describe fails, use a dirty version +-if (${VERSION} MATCHES -NOTFOUND) +- set (VERSION "v1.7.1") +- message (WARNING "Failed to retrieve UPM version with 'git describe' (using " +- "${VERSION}). Check that git is installed and this is a valid git repo.") -endif () -+set (VERSION "v0.4.0") ++set (VERSION "v1.7.1") - message (INFO " - UPM Version ${VERSION}") + message (STATUS "UPM Version ${VERSION}") diff --git a/libs/libupm/patches/002-at42qt1070-id.patch b/libs/libupm/patches/002-at42qt1070-id.patch index 85544c972e..94758ef163 100644 --- a/libs/libupm/patches/002-at42qt1070-id.patch +++ b/libs/libupm/patches/002-at42qt1070-id.patch @@ -1,6 +1,6 @@ --- a/src/at42qt1070/at42qt1070.cxx +++ b/src/at42qt1070/at42qt1070.cxx -@@ -53,7 +53,7 @@ +@@ -53,7 +53,7 @@ AT42QT1070::AT42QT1070(int bus, uint8_t address) return; } diff --git a/libs/libupm/patches/003-link-atomic.patch b/libs/libupm/patches/003-link-atomic.patch new file mode 100644 index 0000000000..e7e995998e --- /dev/null +++ b/libs/libupm/patches/003-link-atomic.patch @@ -0,0 +1,8 @@ +--- a/src/nmea_gps/CMakeLists.txt ++++ b/src/nmea_gps/CMakeLists.txt +@@ -6,4 +6,4 @@ upm_mixed_module_init (NAME nmea_gps + CPP_SRC nmea_gps.cxx + FTI_SRC nmea_gps_fti.c + CPP_WRAPS_C +- REQUIRES mraa utilities-c ${CMAKE_THREAD_LIBS_INIT}) ++ REQUIRES mraa utilities-c atomic ${CMAKE_THREAD_LIBS_INIT}) diff --git a/libs/libupm/patches/003-lsm303-args.patch b/libs/libupm/patches/003-lsm303-args.patch deleted file mode 100644 index d2b2d0e59e..0000000000 --- a/libs/libupm/patches/003-lsm303-args.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/src/lsm303/lsm303.h -+++ b/src/lsm303/lsm303.h -@@ -34,7 +34,7 @@ - - /* LSM303 Address definitions */ - #define LSM303_MAG 0x1E // assuming SA0 grounded --#define LSM303_ACC 0x18 // assuming SA0 grounded -+#define LSM303_ACC 0x1E // assuming SA0 grounded - - /* LSM303 Register definitions */ - #define CTRL_REG1_A 0x20