Description: bindings: python: byte compile by python3-all versions
 This patch ensures this package is compatible with the Python versions in
 python3-all. Before this patch, there will be an import error for the Python
 version, which is not installed in the python3 package.
Author: Gavin Lai (賴建宇) <gavin09@gmail.com>
Forwarded: not-needed
Last-Update: 2024-02-25
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -12,14 +12,22 @@
 endif
 
 all-local:
-	GPIOD_WITH_TESTS=$(BUILD_TESTS) \
-	$(PYTHON) setup.py build_ext --inplace \
-		--include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
-		--library-dirs=$(top_builddir)/lib/.libs/:$(top_srcdir)/tests/gpiosim/.libs/
+	@PYTHON_VERSIONS=$$(py3versions -s); \
+	for py in $$PYTHON_VERSIONS; do \
+		echo "Using $$py for building..."; \
+		GPIOD_WITH_TESTS=$(BUILD_TESTS) \
+			$$py setup.py build_ext --inplace \
+			--include-dirs=$(top_srcdir)/include/:$(top_srcdir)/tests/gpiosim/ \
+			--library-dirs=$(top_builddir)/lib/.libs/:$(top_srcdir)/tests/gpiosim/.libs/; \
+	done
 
 install-exec-local:
-	GPIOD_WITH_TESTS= \
-	$(PYTHON) setup.py install --root=$(if $(DESTDIR),$(DESTDIR),/) --prefix=$(prefix)
+	@PYTHON_VERSIONS=$$(py3versions -s); \
+	for py in $$PYTHON_VERSIONS; do \
+		echo "Using $$py for building..."; \
+		GPIOD_WITH_TESTS= \
+		$$py setup.py install --root=$(if $(DESTDIR),$(DESTDIR),/) --prefix=$(prefix); \
+	done
 
 SUBDIRS = gpiod
 
