--- /dev/null
+From 599e2a11c6f48dde744012ec45686c08e15f3059 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fabrice.fontaine@orange.com>
+Date: Mon, 3 Oct 2016 10:35:52 +0200
+Subject: [PATCH] Fix compilation of MinOZW (#991)
+
+LIBDIR was used in cpp/examples/MinOZW/Makefile to add dynamic
+libraries. However, as it was unset by default, the cross-compilation
+could fail if the host had a library such as libnss3.so in /.
+To fix this issue, this patch sets LIBDIR to top_buildir if it is unset
+
+Fixes:
+ http://autobuild.buildroot.net/results/68719fdf1320a69310bada6d3c47654dacdb5898
+
+Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
+[Upstream commit: https://github.com/OpenZWave/open-zwave/commit/599e2a11c6f48dde744012ec45686c08e15f3059]
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+---
+ cpp/examples/MinOZW/Makefile | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/cpp/examples/MinOZW/Makefile b/cpp/examples/MinOZW/Makefile
+index e575632a3..95d684b77 100644
+--- a/cpp/examples/MinOZW/Makefile
++++ b/cpp/examples/MinOZW/Makefile
+@@ -17,9 +17,11 @@ DEBUG_LDFLAGS := -g
+
+ top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../../)
+
++#where is put the temporary library
++LIBDIR ?= $(top_builddir)
+
+ INCLUDES := -I $(top_srcdir)/cpp/src -I $(top_srcdir)/cpp/tinyxml/ -I $(top_srcdir)/cpp/hidapi/hidapi/
+-LIBS = $(wildcard $(LIBDIR)/*.so $(LIBDIR)/*.dylib $(top_builddir)/*.so $(top_builddir)/*.dylib $(top_builddir)/cpp/build/*.so $(top_builddir)/cpp/build/*.dylib )
++LIBS = $(wildcard $(LIBDIR)/*.so $(LIBDIR)/*.dylib $(top_builddir)/cpp/build/*.so $(top_builddir)/cpp/build/*.dylib )
+ LIBSDIR = $(abspath $(dir $(firstword $(LIBS))))
+ minozwsrc := $(notdir $(wildcard $(top_srcdir)/cpp/examples/MinOZW/*.cpp))
+ VPATH := $(top_srcdir)/cpp/examples/MinOZW
+++ /dev/null
-From 0878d933223158343af3fe13e03bcd128e8b4cbc Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fabrice.fontaine@orange.com>
-Date: Fri, 22 Apr 2016 17:06:27 +0200
-Subject: [PATCH 1/1] Fix warning on wcsdup implicit declaration
-
-Define __GNU_SOURCE in cpp/hidapi/linux/hid.c (like already done in
-cpp/hidapi/libusb/hid.c) to fix implicit declaration of wcsdup function
-
-Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
----
- cpp/hidapi/linux/hid.c | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/cpp/hidapi/linux/hid.c b/cpp/hidapi/linux/hid.c
-index dbf9b9b..c3eb22b 100644
---- a/cpp/hidapi/linux/hid.c
-+++ b/cpp/hidapi/linux/hid.c
-@@ -21,6 +21,8 @@
- http://github.com/signal11/hidapi .
- ********************************************************/
-
-+#define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
-+
- /* C */
- #include <stdio.h>
- #include <string.h>
---
-1.9.1
-
+++ /dev/null
-From 89cdc83307f61422db21cc7965ea294862c128bf Mon Sep 17 00:00:00 2001
-From: Fabrice Fontaine <fabrice.fontaine@orange.com>
-Date: Mon, 30 May 2016 10:37:42 +0200
-Subject: [PATCH 2/2] Ensure correct git repository path
-
-Add "--git-dir ./.git" to ensure the correct git repository path is used (this
-fix a bug when trying to add openzwave to buildroot build system)
-
-Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
----
- cpp/build/support.mk | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/cpp/build/support.mk b/cpp/build/support.mk
-index 3f74c7e..f529b25 100644
---- a/cpp/build/support.mk
-+++ b/cpp/build/support.mk
-@@ -29,7 +29,7 @@ GIT := $(shell which git)
- ifeq ($(GIT),)
- VERSION_REV ?= 0
- else
--GITVERSION := $(shell $(GIT) describe --long --tags --dirty 2>/dev/null | sed s/^v//)
-+GITVERSION := $(shell $(GIT) --git-dir ./.git describe --long --tags --dirty 2>/dev/null | sed s/^v//)
- ifeq ($(GITVERSION),)
- GITVERSION := $(VERSION_MAJ).$(VERSION_MIN).-1
- VERSION_REV := 0
---
-2.7.4
-
--- /dev/null
+From 0878d933223158343af3fe13e03bcd128e8b4cbc Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fabrice.fontaine@orange.com>
+Date: Fri, 22 Apr 2016 17:06:27 +0200
+Subject: [PATCH 1/1] Fix warning on wcsdup implicit declaration
+
+Define __GNU_SOURCE in cpp/hidapi/linux/hid.c (like already done in
+cpp/hidapi/libusb/hid.c) to fix implicit declaration of wcsdup function
+
+Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
+---
+ cpp/hidapi/linux/hid.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/cpp/hidapi/linux/hid.c b/cpp/hidapi/linux/hid.c
+index dbf9b9b..c3eb22b 100644
+--- a/cpp/hidapi/linux/hid.c
++++ b/cpp/hidapi/linux/hid.c
+@@ -21,6 +21,8 @@
+ http://github.com/signal11/hidapi .
+ ********************************************************/
+
++#define _GNU_SOURCE /* needed for wcsdup() before glibc 2.10 */
++
+ /* C */
+ #include <stdio.h>
+ #include <string.h>
+--
+1.9.1
+
--- /dev/null
+From 89cdc83307f61422db21cc7965ea294862c128bf Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fabrice.fontaine@orange.com>
+Date: Mon, 30 May 2016 10:37:42 +0200
+Subject: [PATCH 2/2] Ensure correct git repository path
+
+Add "--git-dir ./.git" to ensure the correct git repository path is used (this
+fix a bug when trying to add openzwave to buildroot build system)
+
+Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
+---
+ cpp/build/support.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpp/build/support.mk b/cpp/build/support.mk
+index 3f74c7e..f529b25 100644
+--- a/cpp/build/support.mk
++++ b/cpp/build/support.mk
+@@ -29,7 +29,7 @@ GIT := $(shell which git)
+ ifeq ($(GIT),)
+ VERSION_REV ?= 0
+ else
+-GITVERSION := $(shell $(GIT) describe --long --tags --dirty 2>/dev/null | sed s/^v//)
++GITVERSION := $(shell $(GIT) --git-dir ./.git describe --long --tags --dirty 2>/dev/null | sed s/^v//)
+ ifeq ($(GITVERSION),)
+ GITVERSION := $(VERSION_MAJ).$(VERSION_MIN).-1
+ VERSION_REV := 0
+--
+2.7.4
+
# Locally computed:
sha256 abfb4c7e7728e86ba374c2e0ef7de912594eb24a8c44935457352df844530238 openzwave-V1.5.tar.gz
-sha256 98851964fd8de3dd40f00d0032b47c61c17a4cf789ad5792e14149da5ab8755e 599e2a11c6f48dde744012ec45686c08e15f3059.patch
OPENZWAVE_DEPENDENCIES = host-pkgconf udev
OPENZWAVE_INSTALL_STAGING = YES
-# This patch fixes incorrect default value of LIBDIR:
-# http://autobuild.buildroot.net/results/68719fdf1320a69310bada6d3c47654dacdb5898
-# This patch is currently in dev branch and will be a part of v1.6
-OPENZWAVE_PATCH = \
- https://github.com/OpenZWave/open-zwave/commit/599e2a11c6f48dde744012ec45686c08e15f3059.patch
-
# Set instlibdir to install libopenzwave.so* in the correct directory
# otherwise openzwave will check that /lib64 exists (on the host) to
# know if the library should be installed in $(PREFIX)/lib or $(PREFIX)/lib64.