diff mbox series

[RFC,2/3] package/python-rgbmatrix: new package

Message ID 20240825-rgbmatrix-v1-2-0f2b0106f2ee@gmx.net
State Superseded
Headers show
Series Version bump and python bindings for rpi-rgb-led-matrix | expand

Commit Message

J. Neuschäfer Aug. 25, 2024, 1:55 p.m. UTC
The "rgbmatrix" python module is the Python binding for
rpi-rgb-led-matrix, built from the same source repository.

Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
---
 package/Config.in                              |  1 +
 package/python-rgbmatrix/Config.in             |  8 ++++++++
 package/python-rgbmatrix/python-rgbmatrix.hash |  3 +++
 package/python-rgbmatrix/python-rgbmatrix.mk   | 23 +++++++++++++++++++++++
 4 files changed, 35 insertions(+)


--
2.43.0
diff mbox series

Patch

diff --git a/package/Config.in b/package/Config.in
index 07bd1499d8..b3665a7569 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1343,6 +1343,7 @@  menu "External python modules"
 	source "package/python-requests-oauthlib/Config.in"
 	source "package/python-requests-toolbelt/Config.in"
 	source "package/python-rfc3987/Config.in"
+	source "package/python-rgbmatrix/Config.in"
 	source "package/python-rpds-py/Config.in"
 	source "package/python-rpi-gpio/Config.in"
 	source "package/python-rpi-ws281x/Config.in"
diff --git a/package/python-rgbmatrix/Config.in b/package/python-rgbmatrix/Config.in
new file mode 100644
index 0000000000..3b39bd500c
--- /dev/null
+++ b/package/python-rgbmatrix/Config.in
@@ -0,0 +1,8 @@ 
+config BR2_PACKAGE_PYTHON_RGBMATRIX
+	bool "python-rgbmatrix"
+	depends on BR2_aarch64 || BR2_arm
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	depends on !BR2_STATIC_LIBS
+	select BR2_PACKAGE_HOST_PYTHON_CYTHON
+	select BR2_PACKAGE_RPI_RGB_LED_MATRIX
diff --git a/package/python-rgbmatrix/python-rgbmatrix.hash b/package/python-rgbmatrix/python-rgbmatrix.hash
new file mode 100644
index 0000000000..175081eb5d
--- /dev/null
+++ b/package/python-rgbmatrix/python-rgbmatrix.hash
@@ -0,0 +1,3 @@ 
+# Locally computed
+sha256  9a6da5b0ad730883a5fa18afc59b1297b4b05eb581c2c14ae50a3583296a4bed  python-rgbmatrix-f55736f7595bc028451658996eedea9742688bbc.tar.gz
+sha256  8177f97513213526df2cf6184d8ff986c675afb514d4e68a404010521b880643  COPYING
diff --git a/package/python-rgbmatrix/python-rgbmatrix.mk b/package/python-rgbmatrix/python-rgbmatrix.mk
new file mode 100644
index 0000000000..545c3fa878
--- /dev/null
+++ b/package/python-rgbmatrix/python-rgbmatrix.mk
@@ -0,0 +1,23 @@ 
+################################################################################
+#
+# python-rgbmatrix
+#
+################################################################################
+
+PYTHON_RGBMATRIX_VERSION = f55736f7595bc028451658996eedea9742688bbc  # 2024-08-18
+PYTHON_RGBMATRIX_SITE = $(call github,hzeller,rpi-rgb-led-matrix,$(PYTHON_RGBMATRIX_VERSION))
+PYTHON_RGBMATRIX_LICENSE = GPL-2.0
+PYTHON_RGBMATRIX_LICENSE_FILES = COPYING
+PYTHON_RGBMATRIX_INSTALL_STAGING = YES
+PYTHON_RGBMATRIX_SETUP_TYPE = setuptools
+PYTHON_RGBMATRIX_SUBDIR = bindings/python
+PYTHON_RGBMATRIX_DEPENDENCIES = host-python-cython rpi-rgb-led-matrix
+
+# Generate bindings with cython
+define PYTHON_RGBMATRIX_CYTHON
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)/bindings/python/rgbmatrix \
+		CYTHON=$(HOST_DIR)/bin/cython all
+endef
+PYTHON_RGBMATRIX_PRE_BUILD_HOOKS += PYTHON_RGBMATRIX_CYTHON
+
+$(eval $(python-package))