All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] libgpiod: new package
@ 2017-01-18 13:58 Bartosz Golaszewski
  2017-01-19  2:22 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Bartosz Golaszewski @ 2017-01-18 13:58 UTC (permalink / raw
  To: buildroot

Add a package containing a C library and a set of command-line tools
for controlling GPIOs from user space using the new character device
interface on linux.

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
---
 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/libgpiod/Config.in     | 20 ++++++++++++++++++++
 package/libgpiod/libgpiod.hash |  2 ++
 package/libgpiod/libgpiod.mk   | 15 +++++++++++++++
 5 files changed, 39 insertions(+)
 create mode 100644 package/libgpiod/Config.in
 create mode 100644 package/libgpiod/libgpiod.hash
 create mode 100644 package/libgpiod/libgpiod.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 79dd097..7326c7a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -126,6 +126,7 @@ F:	package/orbit/
 N:	Bartosz Golaszewski <bgolaszewski@baylibre.com>
 F:	package/autoconf-archive/
 F:	package/doxygen/
+F:	package/libgpiod/
 F:	package/libserialport/
 F:	package/libsigrok/
 F:	package/libsigrokdecode/
diff --git a/package/Config.in b/package/Config.in
index 8c8c33e..2100bc7 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1045,6 +1045,7 @@ menu "Hardware handling"
 	source "package/libfreefare/Config.in"
 	source "package/libftdi/Config.in"
 	source "package/libftdi1/Config.in"
+	source "package/libgpiod/Config.in"
 	source "package/libgudev/Config.in"
 	source "package/libhid/Config.in"
 	source "package/libiio/Config.in"
diff --git a/package/libgpiod/Config.in b/package/libgpiod/Config.in
new file mode 100644
index 0000000..63a7cb6
--- /dev/null
+++ b/package/libgpiod/Config.in
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBGPIOD
+	bool "libgpiod"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
+	help
+	  This is a C library that abstracts the GPIO character
+	  device operations on linux.
+
+	  https://github.com/brgl/libgpiod
+
+if BR2_PACKAGE_LIBGPIOD
+
+config BR2_PACKAGE_LIBGPIOD_TOOLS
+	bool "install tools"
+	help
+	  Include a set of command-line tools for managing GPIOs.
+
+endif
+
+comment "libgpiod needs kernel headers >= 4.8"
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8
diff --git a/package/libgpiod/libgpiod.hash b/package/libgpiod/libgpiod.hash
new file mode 100644
index 0000000..7d3b092
--- /dev/null
+++ b/package/libgpiod/libgpiod.hash
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 0f9f5215d0100a8066f4e6b064892747720e556cbb83f6c05d6151d68ec2025b libgpiod-0.1.tar.gz
diff --git a/package/libgpiod/libgpiod.mk b/package/libgpiod/libgpiod.mk
new file mode 100644
index 0000000..282581e
--- /dev/null
+++ b/package/libgpiod/libgpiod.mk
@@ -0,0 +1,15 @@
+################################################################################
+#
+# libgpiod
+#
+################################################################################
+
+LIBGPIOD_VERSION = 0.1
+LIBGPIOD_SITE = https://github.com/brgl/libgpiod/archive/v$(LIBGPIOD_VERSION)
+LIBGPIOD_LICENSE = GPLv3+
+LIBGPIOD_LICENSE_FILES = COPYING
+LIBGPIOD_AUTORECONF = YES
+LIBGPIOD_AUTORECONF_OPTS = --install
+LIBGPIOD_CONF_OPTS += --enable-tools=$(if $(BR2_PACKAGE_LIBGPIOD_TOOLS),yes,no)
+
+$(eval $(autotools-package))
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [PATCH] libgpiod: new package
  2017-01-18 13:58 [Buildroot] [PATCH] libgpiod: new package Bartosz Golaszewski
@ 2017-01-19  2:22 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2017-01-19  2:22 UTC (permalink / raw
  To: buildroot

Hello,

On Wed, 18 Jan 2017 14:58:08 +0100, Bartosz Golaszewski wrote:
> Add a package containing a C library and a set of command-line tools
> for controlling GPIOs from user space using the new character device
> interface on linux.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>

Thanks! This looks mostly good. A few comments below though.

> ---
>  DEVELOPERS                     |  1 +

Some people prefer to see the change to the DEVELOPERS file as a
separate patch. Indeed, when backporting patches to older Buildroot
versions, the changes in the DEVELOPERS file tend to cause conflicts.

> +################################################################################
> +#
> +# libgpiod
> +#
> +################################################################################
> +
> +LIBGPIOD_VERSION = 0.1
> +LIBGPIOD_SITE = https://github.com/brgl/libgpiod/archive/v$(LIBGPIOD_VERSION)

Any reason not to use the github helper here?

> +LIBGPIOD_LICENSE = GPLv3+
> +LIBGPIOD_LICENSE_FILES = COPYING
> +LIBGPIOD_AUTORECONF = YES
> +LIBGPIOD_AUTORECONF_OPTS = --install

This should not be needed, we already pass the "-i" option to
autoreconf by default. See the definition of the AUTORECONF variable in
package/autoconf/autoconf.mk.

> +LIBGPIOD_CONF_OPTS += --enable-tools=$(if $(BR2_PACKAGE_LIBGPIOD_TOOLS),yes,no)

We normally use --enable/--disable instead of --enable=yes/--enable=no,
so:

ifeq ($(BR2_PACKAGE_LIBGIOPD_TOOLS),y)
LIBGPIOD_CONF_OPTS += --enable-tools
else
LIBGPIOD_CONF_OPTS += --disable-tools
endif

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-19  2:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-18 13:58 [Buildroot] [PATCH] libgpiod: new package Bartosz Golaszewski
2017-01-19  2:22 ` Thomas Petazzoni

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.