mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2] libgpiod: new package
@ 2017-05-24 15:09 Clemens Gruber
  2017-05-24 16:43 ` Robert Schwebel
  0 siblings, 1 reply; 5+ messages in thread
From: Clemens Gruber @ 2017-05-24 15:09 UTC (permalink / raw)
  To: ptxdist; +Cc: Clemens Gruber

libgpiod is a C library with tools for interacting with the Linux
GPIO character device. Add a package for it.

Note: Requires kernel-headers >= 4.8.

Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
---
 patches/libgpiod-0.2/autogen.sh |  1 +
 rules/libgpiod.in               | 58 +++++++++++++++++++++++++++++++
 rules/libgpiod.make             | 76 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 135 insertions(+)
 create mode 120000 patches/libgpiod-0.2/autogen.sh
 create mode 100644 rules/libgpiod.in
 create mode 100644 rules/libgpiod.make

diff --git a/patches/libgpiod-0.2/autogen.sh b/patches/libgpiod-0.2/autogen.sh
new file mode 120000
index 000000000..9f8a4cb7d
--- /dev/null
+++ b/patches/libgpiod-0.2/autogen.sh
@@ -0,0 +1 @@
+../autogen.sh
\ No newline at end of file
diff --git a/rules/libgpiod.in b/rules/libgpiod.in
new file mode 100644
index 000000000..23625ed49
--- /dev/null
+++ b/rules/libgpiod.in
@@ -0,0 +1,58 @@
+## SECTION=system_libraries
+
+menuconfig LIBGPIOD
+	tristate
+	prompt "libgpiod"
+	help
+	  libgpiod is a library accompanied by a set of tools for
+	  interacting with the Linux GPIO character device.
+	  Requires kernel-headers >= 4.8.
+
+if LIBGPIOD
+
+config LIBGPIOD_TOOLS
+	bool
+
+config LIBGPIOD_GPIODETECT
+	bool
+	prompt "Install gpiodetect"
+	select LIBGPIOD_TOOLS
+	help
+	  Lists all gpiochips present on the system
+
+config LIBGPIOD_GPIOINFO
+	bool
+	prompt "Install gpioinfo"
+	select LIBGPIOD_TOOLS
+	help
+	  Lists all lines of specified gpiochips
+
+config LIBGPIOD_GPIOGET
+	bool
+	prompt "Install gpioget"
+	select LIBGPIOD_TOOLS
+	help
+	  Reads values of specified GPIO lines
+
+config LIBGPIOD_GPIOSET
+	bool
+	prompt "Install gpioset"
+	select LIBGPIOD_TOOLS
+	help
+	  Sets values of specified GPIO lines
+
+config LIBGPIOD_GPIOFIND
+	bool
+	prompt "Install gpiofind"
+	select LIBGPIOD_TOOLS
+	help
+	  Finds the gpiochip given the line name
+
+config LIBGPIOD_GPIOMON
+	bool
+	prompt "Install gpiomon"
+	select LIBGPIOD_TOOLS
+	help
+	  Waits for events on a GPIO line
+
+endif
diff --git a/rules/libgpiod.make b/rules/libgpiod.make
new file mode 100644
index 000000000..b1518ae35
--- /dev/null
+++ b/rules/libgpiod.make
@@ -0,0 +1,76 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2017 by Clemens Gruber <clemens.gruber@pqgruber.com>
+#
+# See CREDITS for details about who has contributed to this project.
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBGPIOD) += libgpiod
+
+#
+# Paths and names
+#
+LIBGPIOD_VERSION	:= 0.2
+LIBGPIOD_MD5		:= e3430f35b6efa842693d659c0bfb7ad5
+LIBGPIOD		:= libgpiod-$(LIBGPIOD_VERSION)
+LIBGPIOD_SUFFIX		:= tar.gz
+LIBGPIOD_URL		:= https://github.com/brgl/libgpiod/archive/v$(LIBGPIOD_VERSION).$(LIBGPIOD_SUFFIX)
+LIBGPIOD_SOURCE		:= $(SRCDIR)/$(LIBGPIOD).$(LIBGPIOD_SUFFIX)
+LIBGPIOD_DIR		:= $(BUILDDIR)/$(LIBGPIOD)
+LIBGPIOD_LICENSE	:= LGPL-2.1
+LIBGPIOD_LICENSE_FILES	:= file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+LIBGPIOD_CONF_TOOL	:= autoconf
+LIBGPIOD_CONF_OPT	:= \
+	$(CROSS_AUTOCONF_USR) \
+	--$(call ptx/endis, PTXCONF_LIBGPIOD_TOOLS)-tools \
+	--disable-tests
+
+# libgpiod requires kernel headers >= 4.8
+ifdef PTXCONF_KERNEL_HEADER
+LIBGPIOD_CPPFLAGS	:= \
+	-I$(KERNEL_HEADERS_INCLUDE_DIR)
+endif
+
+LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIODETECT)	+= gpiodetect
+LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOINFO)	+= gpioinfo
+LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOGET)	+= gpioget
+LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOSET)	+= gpioset
+LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOFIND)	+= gpiofind
+LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOMON)	+= gpiomon
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libgpiod.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libgpiod)
+	@$(call install_fixup, libgpiod, PRIORITY, optional)
+	@$(call install_fixup, libgpiod, SECTION, base)
+	@$(call install_fixup, libgpiod, AUTHOR, "Clemens Gruber <clemens.gruber@pqgruber.com>")
+	@$(call install_fixup, libgpiod, DESCRIPTION, "Linux GPIO character device library")
+
+	@$(call install_lib, libgpiod, 0, 0, 0644, libgpiod)
+
+	@for tool in $(LIBGPIOD_TOOLS-y); do \
+		$(call install_copy, libgpiod, 0, 0, 0755, -, \
+			/usr/bin/$$tool); \
+	done
+
+	@$(call install_finish, libgpiod)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.13.0


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2] libgpiod: new package
  2017-05-24 15:09 [ptxdist] [PATCH v2] libgpiod: new package Clemens Gruber
@ 2017-05-24 16:43 ` Robert Schwebel
  2017-05-24 17:11   ` Clemens Gruber
  0 siblings, 1 reply; 5+ messages in thread
From: Robert Schwebel @ 2017-05-24 16:43 UTC (permalink / raw)
  To: ptxdist; +Cc: Clemens Gruber

On Wed, May 24, 2017 at 05:09:19PM +0200, Clemens Gruber wrote:
> libgpiod is a C library with tools for interacting with the Linux
> GPIO character device. Add a package for it.
> 
> Note: Requires kernel-headers >= 4.8.
> 
> Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
> ---

This should have a changelog below the tripledash.

>  patches/libgpiod-0.2/autogen.sh |  1 +
>  rules/libgpiod.in               | 58 +++++++++++++++++++++++++++++++
>  rules/libgpiod.make             | 76 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 135 insertions(+)
>  create mode 120000 patches/libgpiod-0.2/autogen.sh
>  create mode 100644 rules/libgpiod.in
>  create mode 100644 rules/libgpiod.make
> 
> diff --git a/patches/libgpiod-0.2/autogen.sh b/patches/libgpiod-0.2/autogen.sh
> new file mode 120000
> index 000000000..9f8a4cb7d
> --- /dev/null
> +++ b/patches/libgpiod-0.2/autogen.sh
> @@ -0,0 +1 @@
> +../autogen.sh
> \ No newline at end of file
> diff --git a/rules/libgpiod.in b/rules/libgpiod.in
> new file mode 100644
> index 000000000..23625ed49
> --- /dev/null
> +++ b/rules/libgpiod.in
> @@ -0,0 +1,58 @@
> +## SECTION=system_libraries
> +
> +menuconfig LIBGPIOD
> +	tristate
> +	prompt "libgpiod"
> +	help
> +	  libgpiod is a library accompanied by a set of tools for
> +	  interacting with the Linux GPIO character device.
> +	  Requires kernel-headers >= 4.8.
> +
> +if LIBGPIOD
> +
> +config LIBGPIOD_TOOLS
> +	bool
> +
> +config LIBGPIOD_GPIODETECT
> +	bool
> +	prompt "Install gpiodetect"
> +	select LIBGPIOD_TOOLS
> +	help
> +	  Lists all gpiochips present on the system
> +
> +config LIBGPIOD_GPIOINFO
> +	bool
> +	prompt "Install gpioinfo"
> +	select LIBGPIOD_TOOLS
> +	help
> +	  Lists all lines of specified gpiochips
> +
> +config LIBGPIOD_GPIOGET
> +	bool
> +	prompt "Install gpioget"
> +	select LIBGPIOD_TOOLS
> +	help
> +	  Reads values of specified GPIO lines
> +
> +config LIBGPIOD_GPIOSET
> +	bool
> +	prompt "Install gpioset"
> +	select LIBGPIOD_TOOLS
> +	help
> +	  Sets values of specified GPIO lines
> +
> +config LIBGPIOD_GPIOFIND
> +	bool
> +	prompt "Install gpiofind"
> +	select LIBGPIOD_TOOLS
> +	help
> +	  Finds the gpiochip given the line name
> +
> +config LIBGPIOD_GPIOMON
> +	bool
> +	prompt "Install gpiomon"
> +	select LIBGPIOD_TOOLS
> +	help
> +	  Waits for events on a GPIO line
> +
> +endif
> diff --git a/rules/libgpiod.make b/rules/libgpiod.make
> new file mode 100644
> index 000000000..b1518ae35
> --- /dev/null
> +++ b/rules/libgpiod.make
> @@ -0,0 +1,76 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2017 by Clemens Gruber <clemens.gruber@pqgruber.com>
> +#
> +# See CREDITS for details about who has contributed to this project.
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_LIBGPIOD) += libgpiod
> +
> +#
> +# Paths and names
> +#
> +LIBGPIOD_VERSION	:= 0.2
> +LIBGPIOD_MD5		:= e3430f35b6efa842693d659c0bfb7ad5
> +LIBGPIOD		:= libgpiod-$(LIBGPIOD_VERSION)
> +LIBGPIOD_SUFFIX		:= tar.gz
> +LIBGPIOD_URL		:= https://github.com/brgl/libgpiod/archive/v$(LIBGPIOD_VERSION).$(LIBGPIOD_SUFFIX)
> +LIBGPIOD_SOURCE		:= $(SRCDIR)/$(LIBGPIOD).$(LIBGPIOD_SUFFIX)
> +LIBGPIOD_DIR		:= $(BUILDDIR)/$(LIBGPIOD)
> +LIBGPIOD_LICENSE	:= LGPL-2.1
> +LIBGPIOD_LICENSE_FILES	:= file://COPYING;md5=2caced0b25dfefd4c601d92bd15116de
> +
> +# ----------------------------------------------------------------------------
> +# Prepare
> +# ----------------------------------------------------------------------------
> +
> +LIBGPIOD_CONF_TOOL	:= autoconf
> +LIBGPIOD_CONF_OPT	:= \
> +	$(CROSS_AUTOCONF_USR) \
> +	--$(call ptx/endis, PTXCONF_LIBGPIOD_TOOLS)-tools \
> +	--disable-tests
> +
> +# libgpiod requires kernel headers >= 4.8
> +ifdef PTXCONF_KERNEL_HEADER
> +LIBGPIOD_CPPFLAGS	:= \
> +	-I$(KERNEL_HEADERS_INCLUDE_DIR)
> +endif
> +
> +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIODETECT)	+= gpiodetect
> +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOINFO)	+= gpioinfo
> +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOGET)	+= gpioget
> +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOSET)	+= gpioset
> +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOFIND)	+= gpiofind
> +LIBGPIOD_TOOLS-$(PTXCONF_LIBGPIOD_GPIOMON)	+= gpiomon
> +
> +# ----------------------------------------------------------------------------
> +# Target-Install
> +# ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/libgpiod.targetinstall:
> +	@$(call targetinfo)
> +
> +	@$(call install_init, libgpiod)
> +	@$(call install_fixup, libgpiod, PRIORITY, optional)
> +	@$(call install_fixup, libgpiod, SECTION, base)
> +	@$(call install_fixup, libgpiod, AUTHOR, "Clemens Gruber <clemens.gruber@pqgruber.com>")
> +	@$(call install_fixup, libgpiod, DESCRIPTION, "Linux GPIO character device library")
> +
> +	@$(call install_lib, libgpiod, 0, 0, 0644, libgpiod)
> +
> +	@for tool in $(LIBGPIOD_TOOLS-y); do \
> +		$(call install_copy, libgpiod, 0, 0, 0755, -, \
> +			/usr/bin/$$tool); \
> +	done
> +
> +	@$(call install_finish, libgpiod)
> +
> +	@$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.13.0
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2] libgpiod: new package
  2017-05-24 16:43 ` Robert Schwebel
@ 2017-05-24 17:11   ` Clemens Gruber
  2017-05-26  8:57     ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Clemens Gruber @ 2017-05-24 17:11 UTC (permalink / raw)
  To: ptxdist

On Wed, May 24, 2017 at 06:43:16PM +0200, Robert Schwebel wrote:
> On Wed, May 24, 2017 at 05:09:19PM +0200, Clemens Gruber wrote:
> > libgpiod is a C library with tools for interacting with the Linux
> > GPIO character device. Add a package for it.
> > 
> > Note: Requires kernel-headers >= 4.8.
> > 
> > Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
> > ---
> 
> This should have a changelog below the tripledash.

Right. Not sure if I should resend though, as the changelog will not
show up in the commit message.
Let me know if you want me to resend the patch with the changelog
anyway.

Changes since v1:
- Added the kernel-headers include directory to CPPFLAGS
- Added some warning notes/comments that >= v4.8 is required

Cheers,
Clemens

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2] libgpiod: new package
  2017-05-24 17:11   ` Clemens Gruber
@ 2017-05-26  8:57     ` Uwe Kleine-König
  2017-05-26  9:29       ` Clemens Gruber
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2017-05-26  8:57 UTC (permalink / raw)
  To: ptxdist

On Wed, May 24, 2017 at 07:11:59PM +0200, Clemens Gruber wrote:
> On Wed, May 24, 2017 at 06:43:16PM +0200, Robert Schwebel wrote:
> > On Wed, May 24, 2017 at 05:09:19PM +0200, Clemens Gruber wrote:
> > > libgpiod is a C library with tools for interacting with the Linux
> > > GPIO character device. Add a package for it.
> > > 
> > > Note: Requires kernel-headers >= 4.8.
> > > 
> > > Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
> > > ---
> > 
> > This should have a changelog below the tripledash.
> 
> Right. Not sure if I should resend though, as the changelog will not
> show up in the commit message.
> Let me know if you want me to resend the patch with the changelog
> anyway.
> 
> Changes since v1:
> - Added the kernel-headers include directory to CPPFLAGS
> - Added some warning notes/comments that >= v4.8 is required

Is this a copy of the kernel's tools/gpio directory? If so, I'd prefer
to stick to the official source.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2] libgpiod: new package
  2017-05-26  8:57     ` Uwe Kleine-König
@ 2017-05-26  9:29       ` Clemens Gruber
  0 siblings, 0 replies; 5+ messages in thread
From: Clemens Gruber @ 2017-05-26  9:29 UTC (permalink / raw)
  To: ptxdist

On Fri, May 26, 2017 at 10:57:05AM +0200, Uwe Kleine-König wrote:
> On Wed, May 24, 2017 at 07:11:59PM +0200, Clemens Gruber wrote:
> > On Wed, May 24, 2017 at 06:43:16PM +0200, Robert Schwebel wrote:
> > > On Wed, May 24, 2017 at 05:09:19PM +0200, Clemens Gruber wrote:
> > > > libgpiod is a C library with tools for interacting with the Linux
> > > > GPIO character device. Add a package for it.
> > > > 
> > > > Note: Requires kernel-headers >= 4.8.
> > > > 
> > > > Signed-off-by: Clemens Gruber <clemens.gruber@pqgruber.com>
> > > > ---
> > > 
> > > This should have a changelog below the tripledash.
> > 
> > Right. Not sure if I should resend though, as the changelog will not
> > show up in the commit message.
> > Let me know if you want me to resend the patch with the changelog
> > anyway.
> > 
> > Changes since v1:
> > - Added the kernel-headers include directory to CPPFLAGS
> > - Added some warning notes/comments that >= v4.8 is required
> 
> Is this a copy of the kernel's tools/gpio directory? If so, I'd prefer
> to stick to the official source.

No.. it's a separate userspace library (and tools) to interact with the
GPIO character device.

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2017-05-26  9:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-24 15:09 [ptxdist] [PATCH v2] libgpiod: new package Clemens Gruber
2017-05-24 16:43 ` Robert Schwebel
2017-05-24 17:11   ` Clemens Gruber
2017-05-26  8:57     ` Uwe Kleine-König
2017-05-26  9:29       ` Clemens Gruber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox