Skip to contentSkip to conversation

libgpiod: new package

PATCH Superseded Bartosz Golaszewski 2 participants 2 messages Jan 18, 2017 – Jan 19, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libgpiod: new package

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.

---
 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
DEVELOPERS +1 -0
index 79dd097..7326c7a 100644
@@ -126,6 +126,7 @@ F:	package/orbit/
 N:	Bartosz Golaszewski <[email protected]>
 F:	package/autoconf-archive/
 F:	package/doxygen/
+F:	package/libgpiod/
 F:	package/libserialport/
 F:	package/libsigrok/
 F:	package/libsigrokdecode/
package/Config.in +1 -0
index 8c8c33e..2100bc7 100644
@@ -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"
package/libgpiod/Config.in new file +20 -0
new file mode 100644
index 0000000..63a7cb6
@@ -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
package/libgpiod/libgpiod.hash new file +2 -0
new file mode 100644
index 0000000..7d3b092
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 0f9f5215d0100a8066f4e6b064892747720e556cbb83f6c05d6151d68ec2025b libgpiod-0.1.tar.gz
package/libgpiod/libgpiod.mk new file +15 -0
new file mode 100644
index 0000000..282581e
@@ -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))
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 libgpiod: new package

Hello,

Quoted 5 lines · Bartosz Golaszewski

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.

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

Quoted 2 lines
---
 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.

package/libgpiod/libgpiod.mk line 8

Quoted 8 lines
package/libgpiod/libgpiod.mk new file +8 -0
+################################################################################
+#
+# 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?

package/libgpiod/libgpiod.mk line 12

Quoted 4 lines
package/libgpiod/libgpiod.mk new file +4 -0
+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.

Quoted 1 line

+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

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