Skip to contentSkip to conversation

libgpiod: new package

PATCH New Bartosz Golaszewski 3 participants 6 messages Jan 19, 2017 – Jan 23, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover libgpiod: new package

v1 -> v2:
- split the patch into two - the second updating the DEVELOPERS file
- use the github helper for download
- remove 'LIBGPIOD_AUTORECONF_OPTS = --install' as this is already handled internally
- use --enable/--disable instead of --enable=yes/--enable=no

Bartosz Golaszewski (2):
libgpiod: new package
DEVELOPERS: add Bartosz Golaszewski as developer of package/libgpiod

 DEVELOPERS                     |  1 +
 package/Config.in              |  1 +
 package/libgpiod/Config.in     | 20 ++++++++++++++++++++
 package/libgpiod/libgpiod.hash |  2 ++
 package/libgpiod/libgpiod.mk   | 14 ++++++++++++++
 5 files changed, 38 insertions(+)
 create mode 100644 package/libgpiod/Config.in
 create mode 100644 package/libgpiod/libgpiod.hash
 create mode 100644 package/libgpiod/libgpiod.mk
Signature · 1 line
2.9.3
#1 lore raw

PATCH v2 1/2 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.

---
 package/Config.in              |  1 +
 package/libgpiod/Config.in     | 20 ++++++++++++++++++++
 package/libgpiod/libgpiod.hash |  2 ++
 package/libgpiod/libgpiod.mk   | 14 ++++++++++++++
 4 files changed, 37 insertions(+)
 create mode 100644 package/libgpiod/Config.in
 create mode 100644 package/libgpiod/libgpiod.hash
 create mode 100644 package/libgpiod/libgpiod.mk
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..7de17bb
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 0f9f5215d0100a8066f4e6b064892747720e556cbb83f6c05d6151d68ec2025b libgpiod-v0.1.tar.gz
package/libgpiod/libgpiod.mk new file +14 -0
new file mode 100644
index 0000000..aca3d5d
@@ -0,0 +1,14 @@
+################################################################################
+#
+# libgpiod
+#
+################################################################################
+
+LIBGPIOD_VERSION = v0.1
+LIBGPIOD_SITE = $(call github,brgl,libgpiod,$(LIBGPIOD_VERSION))
+LIBGPIOD_LICENSE = GPLv3+
+LIBGPIOD_LICENSE_FILES = COPYING
+LIBGPIOD_AUTORECONF = YES
+LIBGPIOD_CONF_OPTS += --$(if $(BR2_PACKAGE_LIBGPIOD_TOOLS),enable,disable)-tools
+
+$(eval $(autotools-package))
Signature · 1 line
2.9.3
#4 lore raw

PATCH v2 2/2 DEVELOPERS: add Bartosz Golaszewski as developer of package/libgpiod

In reply to Bartosz Golaszewski
---
 DEVELOPERS | 1 +
 1 file changed, 1 insertion(+)
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/
Signature · 1 line
2.9.3
#2 lore raw

PATCH v2 1/2 libgpiod: new package

In reply to Bartosz Golaszewski

Hi Bartosz,

Le 19/01/2017 ? 13:01, Bartosz Golaszewski a ?crit :

Quoted 5 lines

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.

libgpiod doesn't build with a musl toolchain:

../../include/gpiod.h:232:49: warning: its scope is only this definition or declaration, which is probably not what you want ../../include/gpiod.h:249:8: warning: ?struct timespec? declared inside parameter list

        gpiod_event_cb callback, void *cbdata) GPIOD_API;
        ^

../../include/gpiod.h:683:18: error: field ?ts? has incomplete type
struct timespec ts;

Can you take a look ?

Quoted 28 lines
---
 package/Config.in              |  1 +
 package/libgpiod/Config.in     | 20 ++++++++++++++++++++
 package/libgpiod/libgpiod.hash |  2 ++
 package/libgpiod/libgpiod.mk   | 14 ++++++++++++++
 4 files changed, 37 insertions(+)
 create mode 100644 package/libgpiod/Config.in
 create mode 100644 package/libgpiod/libgpiod.hash
 create mode 100644 package/libgpiod/libgpiod.mk
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 +0 -0
new file mode 100644
index 0000000..63a7cb6

package/libgpiod/Config.in line 3

Quoted 3 lines
package/libgpiod/Config.in new file +3 -0
@@ -0,0 +1,20 @@
+config BR2_PACKAGE_LIBGPIOD
+	bool "libgpiod"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8

Why it depend on kernel headers 4.8 ?

Quoted 32 lines
package/libgpiod/Config.in new file +17 -0
+	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..7de17bb
@@ -0,0 +1,2 @@
+# Locally computed
+sha256 0f9f5215d0100a8066f4e6b064892747720e556cbb83f6c05d6151d68ec2025b libgpiod-v0.1.tar.gz
package/libgpiod/libgpiod.mk new file +1 -0
new file mode 100644
index 0000000..aca3d5d
@@ -0,0 +1,14 @@
+################################################################################

package/libgpiod/libgpiod.mk line 11

Quoted 10 lines
package/libgpiod/libgpiod.mk new file +10 -0
+#
+# libgpiod
+#
+################################################################################
+
+LIBGPIOD_VERSION = v0.1
+LIBGPIOD_SITE = $(call github,brgl,libgpiod,$(LIBGPIOD_VERSION))
+LIBGPIOD_LICENSE = GPLv3+
+LIBGPIOD_LICENSE_FILES = COPYING
+LIBGPIOD_AUTORECONF = YES

A comment must be added to explain why the package use autoreconf.

package/libgpiod/libgpiod.mk line 12

Quoted 1 line
package/libgpiod/libgpiod.mk new file +1 -0
+LIBGPIOD_CONF_OPTS += --$(if $(BR2_PACKAGE_LIBGPIOD_TOOLS),enable,disable)-tools

I'm not sure this coding style will be accepted as is, maybe you can do like util-linux package:

$(if $(BR2_PACKAGE_LIBGPIOD_TOOLS),--enable-tools,--disable-tools)

Best regards,
Romain

Quoted 3 lines
package/libgpiod/libgpiod.mk new file +2 -0
+
+$(eval $(autotools-package))
#3 lore raw

PATCH v2 1/2 libgpiod: new package

In reply to Bartosz Golaszewski

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.

Quoted 9 lines
---
 package/Config.in              |  1 +
 package/libgpiod/Config.in     | 20 ++++++++++++++++++++
 package/libgpiod/libgpiod.hash |  2 ++
 package/libgpiod/libgpiod.mk   | 14 ++++++++++++++
 4 files changed, 37 insertions(+)
 create mode 100644 package/libgpiod/Config.in
 create mode 100644 package/libgpiod/libgpiod.hash
 create mode 100644 package/libgpiod/libgpiod.mk

Applied to master, with the following changes:

[Thomas:
- add comment about autoreconf=yes (suggested by Romain Naour)
- add more conventional syntax for the --{enable,disable}-tools usage (suggested by Romain Naour)
- add patch to fix musl build.]

Thanks!

Thomas

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

PATCH v2 2/2 DEVELOPERS: add Bartosz Golaszewski as developer of package/libgpiod

In reply to Bartosz Golaszewski

Hello,

Quoted 4 lines · Bartosz Golaszewski
---
 DEVELOPERS | 1 +
 1 file changed, 1 insertion(+)

Applied to master, thanks.

Thomas

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