From patchwork Mon Apr 25 14:07:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: fabrice.fontaine@orange.com X-Patchwork-Id: 614487 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 3qtp2Q0rk7z9s0k for ; Tue, 26 Apr 2016 00:07:26 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5C5FB8A396; Mon, 25 Apr 2016 14:07:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4AEclTphfwCP; Mon, 25 Apr 2016 14:07:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id EAC508A33F; Mon, 25 Apr 2016 14:07:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 05F5F1C0BA9 for ; Mon, 25 Apr 2016 14:07:21 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 0253A23029 for ; Mon, 25 Apr 2016 14:07:21 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Mo7yYapRHVR7 for ; Mon, 25 Apr 2016 14:07:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from relais-inet.francetelecom.com (relais-ias92.francetelecom.com [193.251.215.92]) by silver.osuosl.org (Postfix) with ESMTPS id 136E525F27 for ; Mon, 25 Apr 2016 14:07:19 +0000 (UTC) Received: from omfedm08.si.francetelecom.fr (unknown [xx.xx.xx.4]) by omfedm13.si.francetelecom.fr (ESMTP service) with ESMTP id 645B03244DE for ; Mon, 25 Apr 2016 16:07:16 +0200 (CEST) Received: from Exchangemail-eme2.itn.ftgroup (unknown [10.114.31.13]) by omfedm08.si.francetelecom.fr (ESMTP service) with ESMTP id 438AB238074 for ; Mon, 25 Apr 2016 16:07:16 +0200 (CEST) Received: from r-x-uffo8396.rd.francetelecom.fr (10.168.234.1) by OPEXCLILM6D.corporate.adroot.infra.ftgroup (10.114.31.13) with Microsoft SMTP Server id 14.3.279.2; Mon, 25 Apr 2016 16:07:12 +0200 From: To: Date: Mon, 25 Apr 2016 16:07:10 +0200 X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.168.234.1] Message-ID: <18234_1461593236_571E2494_18234_9415_1_d894cc93-b732-4ef7-ad29-329991781b34@OPEXCLILM6D.corporate.adroot.infra.ftgroup> X-PMX-Version: 6.2.1.2478543, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.4.25.132416 Cc: Fabrice Fontaine Subject: [Buildroot] [PATCH v3] openzwave: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Free software library that interfaces with selected Z-Wave PC controllers, allowing anyone to create applications that manipulate and respond to devices on a Z-Wave network, without requiring in-depth knowledge of the Z-Wave protocol Signed-off-by: Fabrice Fontaine Tested-by: Julien Boibessot Tested-by: Julien Boibessot --- Changes v2 -> v3 (after reviews of Thomas Petazzoni and Julien Boibessot): - Remove empty line in Config.in - Add hash file with locally computed sha256 of openzwave-v1.4.tar.gz - Format correctly the wcsdup patch (git patch with signed-off-by description) - Remove unneeded comments before OPENZWAVE_LICENSE - Add TARGET_MAKE_ENV in openzwave.mk - Use instlibdir variable to install library in /usr/lib instead of /usr/lib64 - Use sysconfdir variable to install configuration files in /etc/openzwave instead of /usr/etc/openzwave - Remove unneeded ozw_config binary from target directory Changes v1 -> v2: - Fix indentation in Config.in - Add dependency on BR2_USE_WCHAR (from patch of Joris Lijssens) - Remove TARGET_CONFIGURE_ENV from openzwave.mk - Use CROSS_COMPILE variable to build (from patch of Joris Lijssens) - Add a patch to fix wcsdup implicit declaration (from review of Julien Boibessot) package/Config.in | 1 + ...ix-warning-on-wcsdup-implicit-declaration.patch | 29 ++++++++++++ package/openzwave/Config.in | 17 +++++++ package/openzwave/openzwave.hash | 2 + package/openzwave/openzwave.mk | 52 ++++++++++++++++++++++ 5 files changed, 101 insertions(+) create mode 100644 package/openzwave/0001-Fix-warning-on-wcsdup-implicit-declaration.patch create mode 100644 package/openzwave/Config.in create mode 100644 package/openzwave/openzwave.hash create mode 100644 package/openzwave/openzwave.mk diff --git a/package/Config.in b/package/Config.in index e860f72..f242181 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1172,6 +1172,7 @@ menu "Networking" source "package/omniorb/Config.in" source "package/openldap/Config.in" source "package/openpgm/Config.in" + source "package/openzwave/Config.in" source "package/ortp/Config.in" source "package/qdecoder/Config.in" source "package/qpid-proton/Config.in" diff --git a/package/openzwave/0001-Fix-warning-on-wcsdup-implicit-declaration.patch b/package/openzwave/0001-Fix-warning-on-wcsdup-implicit-declaration.patch new file mode 100644 index 0000000..1fe30e4 --- /dev/null +++ b/package/openzwave/0001-Fix-warning-on-wcsdup-implicit-declaration.patch @@ -0,0 +1,29 @@ +From 0878d933223158343af3fe13e03bcd128e8b4cbc Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +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 +--- + 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 + #include +-- +1.9.1 + diff --git a/package/openzwave/Config.in b/package/openzwave/Config.in new file mode 100644 index 0000000..190b88b --- /dev/null +++ b/package/openzwave/Config.in @@ -0,0 +1,17 @@ +config BR2_PACKAGE_OPENZWAVE + bool "openzwave" + depends on BR2_TOOLCHAIN_HAS_THREADS + depends on BR2_INSTALL_LIBSTDCPP + depends on BR2_PACKAGE_HAS_UDEV + depends on BR2_USE_WCHAR + help + Free software library that interfaces with selected Z-Wave PC + controllers, allowing anyone to create applications that manipulate + and respond to devices on a Z-Wave network, without requiring + in-depth knowledge of the Z-Wave protocol + + http://www.openzwave.net + +comment "openzwave needs udev and a toolchain w/ C++, threads, wchar" + depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \ + !BR2_PACKAGE_HAS_UDEV || !BR2_USE_WCHAR diff --git a/package/openzwave/openzwave.hash b/package/openzwave/openzwave.hash new file mode 100644 index 0000000..bab940e --- /dev/null +++ b/package/openzwave/openzwave.hash @@ -0,0 +1,2 @@ +# Locally computed: +sha256 ca122365f6237dc245be0129eb460e78126976b9c7bd06487795d3acfc9f2a5f openzwave-v1.4.tar.gz diff --git a/package/openzwave/openzwave.mk b/package/openzwave/openzwave.mk new file mode 100644 index 0000000..eab9943 --- /dev/null +++ b/package/openzwave/openzwave.mk @@ -0,0 +1,52 @@ +################################################################################ +# +# openzwave +# +################################################################################ + +OPENZWAVE_VERSION = v1.4 +OPENZWAVE_SITE = $(call github,OpenZWave,open-zwave,$(OPENZWAVE_VERSION)) +OPENZWAVE_LICENSE = LGPLv3+, GPLv3 (examples), Apache-2.0 (sh2ju.sh) +OPENZWAVE_LICENSE_FILES = license/license.txt license/lgpl.txt \ + license/gpl.txt license/Apache-License-2.0.txt + +OPENZWAVE_DEPENDENCIES = host-pkgconf udev +OPENZWAVE_INSTALL_STAGING = YES + +define OPENZWAVE_BUILD_CMDS + $(TARGET_MAKE_ENV) $(MAKE) CROSS_COMPILE="$(TARGET_CROSS)" -C $(@D) +endef + +# 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. +# Set pkgconfigdir to /lib/pkgconfig to install libopenzwave.pc in the +# correct directory otherwise openzwave will call +# "pkg-config --variable pc_path pkg-config" which returns an incorrect value. +# Set sysconfdir to /etc/openzwave to install openzwave configuration files in +# the correct directory otherwise openzwave will install configuration files in +# $(PREFIX)/etc/openzwave. +define OPENZWAVE_INSTALL_STAGING_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ + PREFIX=/usr DESTDIR=$(STAGING_DIR) \ + instlibdir=/usr/lib \ + pkgconfigdir=/usr/lib/pkgconfig \ + sysconfdir=/etc/openzwave \ + install +endef + +# Apply the same tricks (even if the trick on pkgconfigdir is not needed as +# libopenzwave.pc is not useful in target directory). +# Delete unneeded ozw_config binary from target directory as this is an utility +# application used to get the openzwave build configuration. +define OPENZWAVE_INSTALL_TARGET_CMDS + $(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \ + PREFIX=/usr DESTDIR=$(TARGET_DIR) \ + instlibdir=/usr/lib \ + pkgconfigdir=/usr/lib/pkgconfig \ + sysconfdir=/etc/openzwave \ + install + rm -f $(TARGET_DIR)/usr/bin/ozw_config +endef + +$(eval $(generic-package))