From patchwork Mon Dec 15 16:46:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 421483 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id EA3651400DD for ; Tue, 16 Dec 2014 03:48:03 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 873C8951AE; Mon, 15 Dec 2014 16:48:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id FosQbgHS9AVS; Mon, 15 Dec 2014 16:48:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 26EAA95188; Mon, 15 Dec 2014 16:48:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 294311C229A for ; Mon, 15 Dec 2014 16:48:00 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2393890F43 for ; Mon, 15 Dec 2014 16:48:00 +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 Gujliv5yhRyj for ; Mon, 15 Dec 2014 16:47:59 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1bon0088.outbound.protection.outlook.com [157.56.111.88]) by whitealder.osuosl.org (Postfix) with ESMTPS id A32A591431 for ; Mon, 15 Dec 2014 16:47:58 +0000 (UTC) Received: from CH1PR03CA004.namprd03.prod.outlook.com (10.255.156.149) by BY1PR0301MB0853.namprd03.prod.outlook.com (25.160.193.147) with Microsoft SMTP Server (TLS) id 15.1.31.17; Mon, 15 Dec 2014 16:47:56 +0000 Received: from BN1BFFO11FD009.protection.gbl (10.255.156.132) by CH1PR03CA004.outlook.office365.com (10.255.156.149) with Microsoft SMTP Server (TLS) id 15.1.31.17 via Frontend Transport; Mon, 15 Dec 2014 16:47:54 +0000 Received: from nwd2mta1.analog.com (137.71.25.55) by BN1BFFO11FD009.mail.protection.outlook.com (10.58.144.72) with Microsoft SMTP Server (TLS) id 15.1.26.17 via Frontend Transport; Mon, 15 Dec 2014 16:47:54 +0000 Received: from NWD2HUBCAS9.ad.analog.com (nwd2hubcas9.ad.analog.com [10.64.72.142]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id sBFGlFxK029614 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL) for ; Mon, 15 Dec 2014 08:47:15 -0800 Received: from zeus.spd.analog.com (10.64.82.11) by NWD2HUBCAS9.ad.analog.com (10.64.72.142) with Microsoft SMTP Server id 14.3.210.2; Mon, 15 Dec 2014 11:46:45 -0500 Received: from carl.analog.com ([10.44.2.133]) by zeus.spd.analog.com (8.14.6/8.14.6) with ESMTP id sBFGkhM2016716; Mon, 15 Dec 2014 11:46:43 -0500 From: Paul Cercueil To: Date: Mon, 15 Dec 2014 17:46:35 +0100 Message-ID: <1418661995-29711-1-git-send-email-paul.cercueil@analog.com> X-Mailer: git-send-email 2.1.3 MIME-Version: 1.0 X-EOPAttributedMessage: 0 Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=Paul.Cercueil@analog.com; X-Forefront-Antispam-Report: CIP:137.71.25.55; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(438002)(199003)(189002)(107046002)(50226001)(53416004)(4396001)(92566001)(77096005)(77156002)(86362001)(575784001)(2351001)(19580405001)(36756003)(229853001)(6806004)(106466001)(87936001)(46102003)(19580395003)(31966008)(50986999)(1720100001)(89996001)(20776003)(99396003)(62966003)(120916001)(15975445007)(50466002)(110136001)(450100001)(33646002)(64706001)(47776003)(48376002)(21056001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR0301MB0853; H:nwd2mta1.analog.com; FPR:; SPF:Pass; MLV:sfv; PTR:nwd2mail10.analog.com; A:1; MX:1; LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY1PR0301MB0853; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601003); SRVR:BY1PR0301MB0853; X-Forefront-PRVS: 04267075BD X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:; SRVR:BY1PR0301MB0853; X-OriginatorOrg: analog.com Cc: Paul Cercueil Subject: [Buildroot] [PATCH v4] libiio: 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" Libiio is a library to ease the development of software interfacing Linux Industrial I/O (IIO) devices. http://wiki.analog.com/resources/tools-software/linux-software/libiio v2: Simplify greatly the patch (upstream now uses CMake) v3: Add support for IPv6 and allow installation of systemd service file v4: Added .hash file Signed-off-by: Paul Cercueil --- package/Config.in | 1 + package/libiio/Config.in | 43 +++++++++++++++++++++++++++++++++++++ package/libiio/S99iiod.sh | 42 ++++++++++++++++++++++++++++++++++++ package/libiio/libiio.hash | 2 ++ package/libiio/libiio.mk | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 package/libiio/Config.in create mode 100644 package/libiio/S99iiod.sh create mode 100644 package/libiio/libiio.hash create mode 100644 package/libiio/libiio.mk diff --git a/package/Config.in b/package/Config.in index 48be2df..3ce5260 100644 --- a/package/Config.in +++ b/package/Config.in @@ -707,6 +707,7 @@ menu "Hardware handling" source "package/libfreefare/Config.in" source "package/libftdi/Config.in" source "package/libhid/Config.in" + source "package/libiio/Config.in" source "package/libinput/Config.in" source "package/libiqrf/Config.in" source "package/libllcp/Config.in" diff --git a/package/libiio/Config.in b/package/libiio/Config.in new file mode 100644 index 0000000..4bded41 --- /dev/null +++ b/package/libiio/Config.in @@ -0,0 +1,43 @@ +config BR2_PACKAGE_LIBIIO + bool "libiio" + select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND if !BR2_PACKAGE_LIBIIO_NETWORK_BACKEND + help + Libiio is a library to ease the development of software interfacing + Linux Industrial I/O (IIO) devices. + + http://wiki.analog.com/resources/tools-software/linux-software/libiio + +if BR2_PACKAGE_LIBIIO + +config BR2_PACKAGE_LIBIIO_LOCAL_BACKEND + bool "Local backend" + default y + help + Enable the local backend of the library. + +config BR2_PACKAGE_LIBIIO_NETWORK_BACKEND + bool "Network backend" + select BR2_PACKAGE_LIBXML2 + default y + help + Enable the network backend of the library. + +config BR2_PACKAGE_LIBIIO_IIOD + bool "IIO Daemon" + select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND + depends on BR2_TOOLCHAIN_HAS_THREADS + default y + help + Install the IIO Daemon. + +comment "IIO Daemon needs a toolchain w/ threads" + depends on !BR2_TOOLCHAIN_HAS_THREADS + +config BR2_PACKAGE_LIBIIO_TESTS + bool "Install test programs" + select BR2_PACKAGE_LIBIIO_LOCAL_BACKEND + select BR2_PACKAGE_LIBIIO_NETWORK_BACKEND + help + Install the test programs (iio_info, iio_genxml, iio_readdev). + +endif diff --git a/package/libiio/S99iiod.sh b/package/libiio/S99iiod.sh new file mode 100644 index 0000000..f900999 --- /dev/null +++ b/package/libiio/S99iiod.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# Server-side demuxing by default +IIOD_OPTS=-D + +[ -r /etc/default/iiod ] && . /etc/default/iiod + +case "$1" in + start) + echo "Starting IIO Server Daemon" + start-stop-daemon -S -b -q -m -p /var/run/iiod.pid -x /usr/sbin/iiod -- $IIOD_OPTS + exit $? + ;; + + stop) + echo "Stopping IIO Server Daemon" + start-stop-daemon -K -q -p /var/run/iiod.pid 2>/dev/null + exit $? + ;; + + status) + RET=1 + if [ -f /var/run/iiod.pid ] ; then + kill -0 `cat /var/run/iiod.pid` >/dev/null 2>&1 + RET=$? + fi + + if [ $RET -eq 0 ] ; then + echo "iiod is running" + else + echo "iiod is NOT running" + fi + + return $RET + ;; + + *) + echo "Usage: $0 {start|stop|status}" + exit 1 +esac + +exit 0 diff --git a/package/libiio/libiio.hash b/package/libiio/libiio.hash new file mode 100644 index 0000000..bbca4c8 --- /dev/null +++ b/package/libiio/libiio.hash @@ -0,0 +1,2 @@ +# From https://github.com/analogdevicesinc/libiio/archive/v0.3/ +sha256 a3571bbf7e80b9e0a8d6bd4b39a5bcd18f80a3d36c4a6f2092dfeefc98e20e07 libiio-v0.3.tar.gz diff --git a/package/libiio/libiio.mk b/package/libiio/libiio.mk new file mode 100644 index 0000000..5553cc7 --- /dev/null +++ b/package/libiio/libiio.mk @@ -0,0 +1,53 @@ +################################################################################ +# +# libiio +# +################################################################################ + +LIBIIO_VERSION = v0.3 +LIBIIO_SITE = $(call github,analogdevicesinc,libiio,$(LIBIIO_VERSION)) +LIBIIO_INSTALL_STAGING = YES +LIBIIO_LICENSE = LGPLv2.1+ +LIBIIO_LICENSE_FILES = COPYING + +# Avahi support in libiio requires avahi-client, which needs avahi-daemon +ifeq ($(BR2_PACKAGE_AVAHI)$(BR2_PACKAGE_AVAHI_DAEMON),yy) +LIBIIO_DEPENDENCIES += avahi +endif + +ifneq ($(BR2_INET_IPV6),y) +LIBIIO_CONF_OPTS += -DENABLE_IPV6=OFF +endif + +ifneq ($(BR2_PACKAGE_LIBIIO_LOCAL_BACKEND),y) +LIBIIO_CONF_OPTS += -DWITH_LOCAL_BACKEND=OFF +endif + +ifeq ($(BR2_PACKAGE_LIBIIO_NETWORK_BACKEND),y) +LIBIIO_DEPENDENCIES += libxml2 +else +LIBIIO_CONF_OPTS += -DWITH_NETWORK_BACKEND=OFF +endif + +ifneq ($(BR2_PACKAGE_LIBIIO_IIOD),y) +LIBIIO_CONF_OPTS += -DWITH_IIOD=OFF +else +LIBIIO_DEPENDENCIES += host-flex host-bison +define LIBIIO_INSTALL_INIT_SYSV + $(INSTALL) -D -m 0755 package/libiio/S99iiod.sh \ + $(TARGET_DIR)/etc/init.d/S99iiod.sh +endef +define LIBIIO_INSTALL_INIT_SYSTEMD + $(INSTALL) -d $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants + $(INSTALL) -D -m 0644 $(@D)/debian/iiod.service \ + $(TARGET_DIR)/lib/systemd/system/iiod.service + ln -fs /lib/systemd/system/iiod.service \ + $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/iiod.service +endef +endif + +ifneq ($(BR2_PACKAGE_LIBIIO_TESTS),y) +LIBIIO_CONF_OPTS += -DWITH_TESTS=OFF +endif + +$(eval $(cmake-package))