From 592baed18e1ec9aa3e01aabd82494c36c5160c78 Mon Sep 17 00:00:00 2001 From: Henrik Grimler Date: Fri, 17 Apr 2020 16:39:16 +0200 Subject: [PATCH] open-zwave: fix build errors --- root-packages/open-zwave/Makefile.patch | 24 +++++++++ root-packages/open-zwave/build.sh | 6 ++- root-packages/open-zwave/support.mk.patch | 59 +++++++++++++++++++++++ 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 root-packages/open-zwave/Makefile.patch create mode 100644 root-packages/open-zwave/support.mk.patch diff --git a/root-packages/open-zwave/Makefile.patch b/root-packages/open-zwave/Makefile.patch new file mode 100644 index 000000000..7faeb3e66 --- /dev/null +++ b/root-packages/open-zwave/Makefile.patch @@ -0,0 +1,24 @@ +--- ../Makefile.orig 2020-04-17 15:36:09.952403604 +0200 ++++ ./cpp/build/Makefile 2020-04-17 15:37:27.535654652 +0200 +@@ -21,11 +21,6 @@ + #what flags we will use for linking in debug mode + DEBUG_LDFLAGS := -g + +-#default Libraries we should link with +-ifneq ($(UNAME),FreeBSD) +-LIBS += -lresolv +-endif +- + top_srcdir := $(abspath $(dir $(lastword $(MAKEFILE_LIST)))../../) + + include $(top_srcdir)/cpp/build/support.mk +@@ -132,9 +132,7 @@ + endif + endif # USE_HID + +-ifeq ($(BITBAKE_ENV),1) + ar_option := "rc" +-endif + + cclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/command_classes/*.cpp)) + vclasses := $(notdir $(wildcard $(top_srcdir)/cpp/src/value_classes/*.cpp)) diff --git a/root-packages/open-zwave/build.sh b/root-packages/open-zwave/build.sh index 7569f185b..6d7b3dab2 100644 --- a/root-packages/open-zwave/build.sh +++ b/root-packages/open-zwave/build.sh @@ -1,7 +1,11 @@ TERMUX_PKG_HOMEPAGE=https://github.com/OpenZWave/open-zwave -TERMUX_PKG_DESCRIPTION="a C++ library to control Z-Wave Networks via a USB Z-Wave Controller. " +TERMUX_PKG_DESCRIPTION="A C++ library to control Z-Wave Networks via a USB Z-Wave Controller" TERMUX_PKG_LICENSE="LGPL-3.0" TERMUX_PKG_VERSION=1.6.1 TERMUX_PKG_SRCURL=https://github.com/sviete/open-zwave/archive/v$TERMUX_PKG_VERSION.zip TERMUX_PKG_SHA256=ecf10aa7cd5dd51172e960c0fd3ea418a24ad39d3d5db026d6bfc3d8c08ef4a0 TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_pre_configure() { + export pkgconfigdir=$TERMUX_PREFIX/lib/pkgconfig +} diff --git a/root-packages/open-zwave/support.mk.patch b/root-packages/open-zwave/support.mk.patch new file mode 100644 index 000000000..547f6059f --- /dev/null +++ b/root-packages/open-zwave/support.mk.patch @@ -0,0 +1,59 @@ +--- ../support.mk.orig 2020-04-17 15:25:18.603094464 +0200 ++++ ./cpp/build/support.mk 2020-04-17 15:29:46.329477179 +0200 +@@ -79,7 +79,7 @@ + ifneq ($(VERFILE),) + VERSION_REV := $(shell sed -n 's/uint16_t ozw_vers_revision = \(.*\);$$/\1/p' $(VERFILE)) + else +-$(warning Missing Either Git Binary, Not a Source Checkout or doesn't have a vers.cpp) ++$(warning Missing Either Git Binary, Not a Source Checkout or does not have a vers.cpp) + endif + endif + endif +@@ -91,38 +91,11 @@ + VERSION := $(VERSION_MAJ).$(VERSION_MIN) + + +-# using seting from bitbake +-ifeq ($(BITBAKE_ENV),1) + CC := $(CC) + CXX := $(CXX) + LD := $(CXX) + AR := $(AR) + RANLIB := $(RANLIB) +-else +- +-# support Cross Compiling options +-ifeq ($(UNAME),FreeBSD) +-# Actually hide behind c++ which works for both clang based 10.0 and earlier(?) +-CC := $(CROSS_COMPILE)cc +-CXX := $(CROSS_COMPILE)c++ +-LD := $(CROSS_COMPILE)c++ +-else +-CC := $(CROSS_COMPILE)gcc +-CXX := $(CROSS_COMPILE)g++ +-LD := $(CROSS_COMPILE)g++ +-endif +-ifeq ($(UNAME),Darwin) +-AR := libtool -static -o +-RANLIB := ranlib +-CC := clang +-CXX := clang++ +-LD := clang++ +-else +-AR := $(CROSS_COMPILE)ar rc +-RANLIB := $(CROSS_COMPILE)ranlib +-endif +- +-endif + SED := sed + + +@@ -153,7 +126,7 @@ + instlibdir ?= $(PREFIX)$(instlibdir.default) + endif + +-#pkg-config doesn't exist, lets try to guess best place to put the pc file ++#pkg-config does not exist, lets try to guess best place to put the pc file + ifeq ($(PKGCONFIG),) + pkgconfigdir ?= $(shell if [ -d "/usr/lib64/pkgconfig" ]; then echo "/usr/lib64/pkgconfig"; else echo "/usr/lib/pkgconfig"; fi) + else