From: Boerje Sewing <Boerje.Sewing@who-ing.de>
To: ptxdist@pengutronix.de
Cc: clemens.gruber@pqgruber.com
Subject: [ptxdist] [PATCH v2] libgpiod: add support for python3 bindings
Date: Mon, 27 Aug 2018 14:17:38 +0200 [thread overview]
Message-ID: <20180827121738.9748-1-Boerje.Sewing@who-ing.de> (raw)
Signed-off-by: Boerje Sewing <Boerje.Sewing@who-ing.de>
---
Changes in v2:
- Shorten the Makefile (thanks Denis)
- Fix indentation in Kconfig file (thanks Ladislav)
rules/libgpiod.in | 8 ++++++++
rules/libgpiod.make | 14 +++++++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/rules/libgpiod.in b/rules/libgpiod.in
index d3d0c6002..c62d24f12 100644
--- a/rules/libgpiod.in
+++ b/rules/libgpiod.in
@@ -55,4 +55,12 @@ config LIBGPIOD_GPIOMON
help
Waits for events on a GPIO line
+config LIBGPIOD_PYTHON3
+ bool
+ prompt "Install python3 bindings"
+ select PYTHON3
+ select HOST_SYSTEM_PYTHON3
+ help
+ Provides bindings for Python 3
+
endif
diff --git a/rules/libgpiod.make b/rules/libgpiod.make
index ed677c2d5..e35e20c8f 100644
--- a/rules/libgpiod.make
+++ b/rules/libgpiod.make
@@ -36,7 +36,11 @@ LIBGPIOD_CONF_OPT := \
--$(call ptx/endis, PTXCONF_LIBGPIOD_TOOLS)-tools \
--disable-tests \
--disable-bindings-cxx \
- --disable-bindings-python
+ --$(call ptx/endis, PTXCONF_LIBGPIOD_PYTHON3)-bindings-python
+
+LIBGPIOD_CONF_ENV := \
+ $(CROSS_ENV) \
+ $(if $(PTXCONF_PYTHON3), ac_cv_path_PYTHON=$(CROSS_PYTHON3))
# libgpiod requires kernel headers >= 4.8
ifdef PTXCONF_KERNEL_HEADER
@@ -71,6 +75,14 @@ $(STATEDIR)/libgpiod.targetinstall:
/usr/bin/$$tool); \
done
+ifdef PTXCONF_LIBGPIOD_PYTHON3
+ @$(call install_copy, libgpiod, 0, 0, 0755, $(PYTHON3_SITEPACKAGES))
+ @for file in $(shell cd $(LIBGPIOD_PKGDIR) && find . -name "gpiod.*"); \
+ do \
+ $(call install_copy, libgpiod, 0, 0, 0644, -, /$$file); \
+ done
+endif
+
@$(call install_finish, libgpiod)
@$(call touch)
--
2.18.0
_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
reply other threads:[~2018-08-27 12:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180827121738.9748-1-Boerje.Sewing@who-ing.de \
--to=boerje.sewing@who-ing.de \
--cc=clemens.gruber@pqgruber.com \
--cc=ptxdist@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox