Signed-off-by: Boerje Sewing <[email protected]>
---

Changes in v3:
- Fix python dependency in Kconfig file (thanks Michael)
- Remove unnecessary host python selection in Kconfig (thanks Michael)
- Simplify library copy process in Makefile (thanks Michael)

Changes in v2:
- Shorten the Makefile (thanks Denis)
- Fix indentation in Kconfig file (thanks Ladislav)

 rules/libgpiod.in   |  8 ++++++++
 rules/libgpiod.make | 10 +++++++++-
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/rules/libgpiod.in b/rules/libgpiod.in
index d3d0c6002..c871dc484 100644
--- a/rules/libgpiod.in
+++ b/rules/libgpiod.in
@@ -3,6 +3,7 @@
 menuconfig LIBGPIOD
        tristate
        prompt "libgpiod                      "
+       select PYTHON3 if LIBGPIOD_PYTHON3
        help
          libgpiod is a library accompanied by a set of tools for
          interacting with the Linux GPIO character device.
@@ -55,4 +56,11 @@ config LIBGPIOD_GPIOMON
        help
          Waits for events on a GPIO line
 
+config LIBGPIOD_PYTHON3
+       bool
+       prompt "Install python3 bindings"
+       select PYTHON3
+       help
+         Provides bindings for Python 3
+
 endif
diff --git a/rules/libgpiod.make b/rules/libgpiod.make
index ed677c2d5..ef70324ec 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,10 @@ $(STATEDIR)/libgpiod.targetinstall:
                        /usr/bin/$$tool); \
        done
 
+ifdef PTXCONF_LIBGPIOD_PYTHON3
+       @$(call install_glob, libgpiod, 0, 0, -, $(PYTHON3_SITEPACKAGES),, 
gpiod.*)
+endif
+
        @$(call install_finish, libgpiod)
 
        @$(call touch)
-- 
2.18.0


_______________________________________________
ptxdist mailing list
[email protected]

Reply via email to