summaryrefslogtreecommitdiff
path: root/recipes-devtools
diff options
context:
space:
mode:
authorNorbert Wesp <n.wesp@phytec.de>2018-11-07 17:06:12 +0100
committerStefan Müller-Klieser <s.mueller-klieser@phytec.de>2018-12-04 14:32:44 +0100
commitd2c6a45a406722d00a23d5df99be55491c483bee (patch)
tree2e99b1f4331b976f0e7a5c54a8a52b2cf6457f0b /recipes-devtools
parent551d31a949e4209e2871f6e9b128c6c11ddac8b7 (diff)
downloadmeta-yogurt-d2c6a45a406722d00a23d5df99be55491c483bee.tar.bz2
meta-yogurt-d2c6a45a406722d00a23d5df99be55491c483bee.zip
upm: Add recipe for upm v1.7.0
The new recipe is based on a meta-oe recipe in master-branch for upm v1.6 The SRC_URI has been changed, so instead of a git-repository a tar.gz file will be downloaded. There is no recipe for upm v1.7.0 (even in master-branch) so it will be added to our meta-yogurt layer. Furthermore another patch is needed to get rid of some compiler FLAGS, which will end up in ERRORs. This patch can be removed as soon as the upm source-code is fixed upstream. Signed-off-by: Norbert Wesp <n.wesp@phytec.de> Signed-off-by: Stefan Müller-Klieser <s.mueller-klieser@phytec.de>
Diffstat (limited to 'recipes-devtools')
-rw-r--r--recipes-devtools/upm/upm/0001-Replace-strncpy-with-memcpy.patch49
-rw-r--r--recipes-devtools/upm/upm/0001-include-sys-types.h-for-uint-definition.patch34
-rw-r--r--recipes-devtools/upm/upm/0001-upm-CMakeLists.txt-Skip-some-C-C-Compiler-FLAGS.patch42
-rw-r--r--recipes-devtools/upm/upm_1.7.0.bb46
4 files changed, 171 insertions, 0 deletions
diff --git a/recipes-devtools/upm/upm/0001-Replace-strncpy-with-memcpy.patch b/recipes-devtools/upm/upm/0001-Replace-strncpy-with-memcpy.patch
new file mode 100644
index 0000000..4b17087
--- /dev/null
+++ b/recipes-devtools/upm/upm/0001-Replace-strncpy-with-memcpy.patch
@@ -0,0 +1,49 @@
+From d314f26e024aaf15bf4ab22ceb98501148d0eac8 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Mon, 7 May 2018 19:53:33 -0700
+Subject: [PATCH] Replace strncpy with memcpy
+
+gcc8 detects that strncpy is overwiritng the null terminating character
+the source strings are already initialized to 0 so memcpy would do the same
+job
+
+Fixes
+rn2903.c:153:5: error: 'strncpy' output may be truncated copying 16 bytes from a string of length 511 [-Werror=stringop-truncation]
+ strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/ecezo/ecezo.c | 2 +-
+ src/rn2903/rn2903.c | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/ecezo/ecezo.c b/src/ecezo/ecezo.c
+index 6a195fc1..56c6dab3 100644
+--- a/src/ecezo/ecezo.c
++++ b/src/ecezo/ecezo.c
+@@ -488,7 +488,7 @@ int ecezo_send_command(const ecezo_context dev, char *cmd, char *buffer,
+ // our write buffer
+ char writeBuffer[ECEZO_MAX_BUFFER_LEN];
+
+- strncpy(writeBuffer, cmd, ECEZO_MAX_BUFFER_LEN);
++ memcpy(writeBuffer, cmd, ECEZO_MAX_BUFFER_LEN-1);
+ writeBuffer[ECEZO_MAX_BUFFER_LEN - 1] = 0;
+
+ int writelen = strlen(writeBuffer);
+diff --git a/src/rn2903/rn2903.c b/src/rn2903/rn2903.c
+index f30a33ae..01a011da 100644
+--- a/src/rn2903/rn2903.c
++++ b/src/rn2903/rn2903.c
+@@ -150,7 +150,7 @@ static rn2903_context _rn2903_postinit(rn2903_context dev,
+ rn2903_close(dev);
+ return NULL;
+ }
+- strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64);
++ memcpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64);
+
+ return dev;
+ }
+--
+2.17.0
+
diff --git a/recipes-devtools/upm/upm/0001-include-sys-types.h-for-uint-definition.patch b/recipes-devtools/upm/upm/0001-include-sys-types.h-for-uint-definition.patch
new file mode 100644
index 0000000..3cc123f
--- /dev/null
+++ b/recipes-devtools/upm/upm/0001-include-sys-types.h-for-uint-definition.patch
@@ -0,0 +1,34 @@
+From 48a580bd402cf6a3ee9e42013653219bfeb3caf6 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 21 Jun 2018 18:39:16 -0700
+Subject: [PATCH] include sys/types.h for uint definition
+
+uint is defined in sys/types.h, therefore this
+header needs to be included, it gets exposed with
+musl where this header is not getting included indirectly
+as it is happening when building on glibc
+
+Fixes build errors on musl e.g.
+upm/src/kx122/kx122.hpp:456:31: error: 'uint' has not been declared
+| void setBufferThreshold(uint samples);
+| ^~~~
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+Upstream-Status: Submitted [https://github.com/intel-iot-devkit/upm/pull/656]
+ src/kx122/kx122.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/kx122/kx122.h b/src/kx122/kx122.h
+index 1622ed50..56e5215e 100644
+--- a/src/kx122/kx122.h
++++ b/src/kx122/kx122.h
+@@ -31,6 +31,7 @@ extern "C"{
+ #include <assert.h>
+ #include <unistd.h>
+ #include <math.h>
++#include <sys/types.h>
+
+ #include <mraa/i2c.h>
+ #include <mraa/spi.h>
+
diff --git a/recipes-devtools/upm/upm/0001-upm-CMakeLists.txt-Skip-some-C-C-Compiler-FLAGS.patch b/recipes-devtools/upm/upm/0001-upm-CMakeLists.txt-Skip-some-C-C-Compiler-FLAGS.patch
new file mode 100644
index 0000000..58d5794
--- /dev/null
+++ b/recipes-devtools/upm/upm/0001-upm-CMakeLists.txt-Skip-some-C-C-Compiler-FLAGS.patch
@@ -0,0 +1,42 @@
+From bef277d19718a868d45878ce94e8a6673b08ceee Mon Sep 17 00:00:00 2001
+From: Norbert Wesp <n.wesp@phytec.de>
+Date: Wed, 7 Nov 2018 13:02:01 +0100
+Subject: [PATCH] upm: CMakeLists.txt: Skip some C/C++-Compiler-FLAGS
+
+With the standard compiler FLAGS for C/C++ we get some WARNINGs,
+which will be shown as ERRORS because of configuration.
+To get rid of them for build right now, we simply disable this WARNINGs.
+
+Signed-off-by: Norbert Wesp <n.wesp@phytec.de>
+---
+ CMakeLists.txt | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 03b7e13a..59d5b7af 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,6 +93,9 @@ endfunction ()
+ # Enable -Wall
+ # GCC-6 added -Wmisleading-indentation to -Wall, skip these for now
+ set (C_CXX_WARNING_FLAGS -Wall
++ -Wno-unused-result
++ -Wno-int-conversion
++ -Wno-maybe-uninitialized
+ -Wno-misleading-indentation
+ -Wno-strict-aliasing
+ -Wno-deprecated-declarations # Temp fix for MRAA deprecated methods
+@@ -116,9 +119,9 @@ upm_add_compile_flags(C ${C_CXX_WARNING_FLAGS}
+ # unsupported flags
+ upm_add_compile_flags(CXX ${C_CXX_WARNING_FLAGS}
+ -Wnon-virtual-dtor
+- -Woverloaded-virtual
+ -Wsign-compare
+ -Wreorder)
++# -Woverloaded-virtual
+
+ # Allow exception error handling for Android C++
+ if (ANDROID)
+--
+2.17.1
+
diff --git a/recipes-devtools/upm/upm_1.7.0.bb b/recipes-devtools/upm/upm_1.7.0.bb
new file mode 100644
index 0000000..f11100c
--- /dev/null
+++ b/recipes-devtools/upm/upm_1.7.0.bb
@@ -0,0 +1,46 @@
+SUMMARY = "Sensor/Actuator repository for Mraa"
+HOMEPAGE = "https://github.com/intel-iot-devkit/upm"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=66493d54e65bfc12c7983ff2e884f37f"
+
+DEPENDS = "libjpeg-turbo mraa"
+
+SRC_URI = "https://github.com/intel-iot-devkit/upm/archive/v${PV}.tar.gz \
+ file://0001-upm-CMakeLists.txt-Skip-some-C-C-Compiler-FLAGS.patch \
+"
+SRC_URI[md5sum] = "c60b87b9ff2ee4135e16f62e099487e8"
+SRC_URI[sha256sum] = "66ac1a869b0b06144a3ebe96c20b2e4195ec9c1879d14bde77ac706d237dfca8"
+
+S = "${WORKDIR}/${PN}-${PV}"
+
+# Depends on mraa which only supports x86 and ARM for now
+COMPATIBLE_HOST = "(x86_64.*|i.86.*|aarch64.*|arm.*)-linux"
+
+inherit distutils3-base cmake
+
+# override this in local.conf to get needed bindings.
+# BINDINGS_pn-upm="python"
+# will result in only the python bindings being built/packaged.
+BINDINGS ??= "python nodejs"
+
+# nodejs isn't available for armv4/armv5 architectures
+BINDINGS_armv4 ??= "python"
+BINDINGS_armv5 ??= "python"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('PACKAGES', 'node-${PN}', 'nodejs', '', d)} \
+ ${@bb.utils.contains('PACKAGES', '${PYTHON_PN}-${PN}', 'python', '', d)}"
+
+PACKAGECONFIG[python] = "-DBUILDSWIGPYTHON=ON, -DBUILDSWIGPYTHON=OFF, swig-native ${PYTHON_PN},"
+PACKAGECONFIG[nodejs] = "-DBUILDSWIGNODE=ON, -DBUILDSWIGNODE=OFF, swig-native nodejs-native,"
+
+FILES_${PYTHON_PN}-${PN} = "${PYTHON_SITEPACKAGES_DIR}"
+RDEPENDS_${PYTHON_PN}-${PN} += "${PYTHON_PN}"
+
+FILES_node-${PN} = "${prefix}/lib/node_modules/"
+RDEPENDS_node-${PN} += "nodejs"
+
+### Include desired language bindings ###
+PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'nodejs', 'node-${PN}', '', d)}"
+PACKAGES =+ "${@bb.utils.contains('BINDINGS', 'python', '${PYTHON_PN}-${PN}', '', d)}"