Skip to contentSkip to conversation

package/python-gpiod: new package

PATCH In review Marcus Hoffmann via buildroot 1 participant 2 messages Nov 20, 2025 – Nov 22, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 package/python-gpiod: new package

This adds the python bindings of libgpiod for version 2+. While the python bindings for v1 were optionally built and installed as part of the main libgpiod build, for v2 they have now been published to pypi.org for easier consumption in the general python ecosystem.

We need to set LINK_SYSTEM_LIBGPIOD=1 to actually build against the system version of libgpiod which we install and not use a separate bundled copy.

The package is licensed as libgpiod, but as published to pypi doesn't include the LICENSE file that's part of upstream repository. Reference pyproject.toml as that has the license identifier as a workaround.

---
 DEVELOPERS                             |  1 +
 package/Config.in                      |  1 +
 package/python-gpiod/Config.in         | 15 +++++++++++++++
 package/python-gpiod/python-gpiod.hash |  5 +++++
 package/python-gpiod/python-gpiod.mk   | 17 +++++++++++++++++
 5 files changed, 39 insertions(+)
 create mode 100644 package/python-gpiod/Config.in
 create mode 100644 package/python-gpiod/python-gpiod.hash
 create mode 100644 package/python-gpiod/python-gpiod.mk
DEVELOPERS +1 -0
index 0272b4ba33..68409d7c34 100644
@@ -2263,6 +2263,7 @@ F:	package/picotool/
 F:	package/python-apscheduler/
 F:	package/python-crc/
 F:	package/python-django/
+F:	package/python-gpiod/
 F:	package/python-immutabledict/
 F:	package/python-jc/
 F:	package/python-log-rate-limit/
package/Config.in +1 -0
index 12f327cb27..53fda7e086 100644
@@ -1136,6 +1136,7 @@ menu "External python modules"
 	source "package/python-google-api-core/Config.in"
 	source "package/python-google-auth/Config.in"
 	source "package/python-googleapis-common-protos/Config.in"
+	source "package/python-gpiod/Config.in"
 	source "package/python-gpiozero/Config.in"
 	source "package/python-greenlet/Config.in"
 	source "package/python-grpc-requests/Config.in"
package/python-gpiod/Config.in new file +15 -0
new file mode 100644
index 0000000000..8f67178ae7
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_PYTHON_GPIOD
+	bool "python-gpiod"
+	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10 # libgpiod2
+	depends on !BR2_PACKAGE_LIBGPIOD # libgpiod2
+	select BR2_PACKAGE_LIBGPIOD2
+	help
+	  Python bindings for libgpiod (v2+).
+
+	  https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/tree/bindings/python/
+
+comment "python-gpiod needs kernel headers >= 5.10"
+	depends on !BR2_TOOLCHAIN_HEADERS_AT_LEAST_5_10
+
+comment "python-gpiod is incompatible with libgpiod"
+	depends on BR2_PACKAGE_LIBGPIOD
package/python-gpiod/python-gpiod.hash new file +5 -0
new file mode 100644
index 0000000000..bbcc7181ff
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/gpiod/json
+md5  62cf044aa3214d0ebee6aef78db2aa52  gpiod-2.4.0.tar.g
+sha256  9243a1a59d084ec749d1df4a1e2f238ffb9d94515b0d9f5335460175143c3aa1  gpiod-2.4.0.tar.gz
+# Locally computed
+sha256  a2b24e2158144b22a77a6a404fc5a05911612c5b99d7ab6d0e2addcaeb7514a3  pyproject.toml
package/python-gpiod/python-gpiod.mk new file +17 -0
new file mode 100644
index 0000000000..8ab901972e
@@ -0,0 +1,17 @@
+################################################################################
+#
+# python-gpiod
+#
+################################################################################
+
+PYTHON_GPIOD_VERSION = 2.4.0
+PYTHON_GPIOD_SOURCE = gpiod-$(PYTHON_GPIOD_VERSION).tar.gz
+PYTHON_GPIOD_SITE = https://files.pythonhosted.org/packages/0c/dc/5a6bd309345bd9cfa7e098174ab7e65367e408539b6c1998e4f267c673cd
+PYTHON_GPIOD_SETUP_TYPE = setuptools
+PYTHON_GPIOD_LICENSE = LGPL-2.1+
+# The package license follows libgpiod's license but doesn't include the LICENSE text in the pypi distrobuted package again
+PYTHON_GPIOD_LICENSE_FILES = pyproject.toml
+PYTHON_GPIOD_DEPENDENCIES = libgpiod2
+PYTHON_GPIOD_ENV = LINK_SYSTEM_LIBGPIOD=1
+
+$(eval $(python-package))
Signature · 6 lines
2.52.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 10 lines · Marcus Hoffmann via buildroot

This adds the python bindings of libgpiod for version 2+. While the python bindings for v1 were optionally built and installed as part of the main libgpiod build, for v2 they have now been published to pypi.org for easier consumption in the general python ecosystem.

We need to set LINK_SYSTEM_LIBGPIOD=1 to actually build against the system version of libgpiod which we install and not use a separate bundled copy.

Quoted 6 lines

The package is licensed as libgpiod, but as published to pypi doesn't include the LICENSE file that's part of upstream repository. Reference pyproject.toml as that has the license identifier as a workaround.

Applied to next, thanks.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot