bindings: python: byte compile by python3-all versions
authorGavin Lai (賴建宇) <gavin09@gmail.com>
Tue, 27 Aug 2024 14:35:02 +0000 (22:35 +0800)
committerGavin Lai (賴建宇) <gavin09@gmail.com>
Tue, 27 Aug 2024 14:35:02 +0000 (22:35 +0800)
Forwarded: not-needed
Last-Update: 2024-02-25

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.
Last-Update: 2024-02-25
Gbp-Pq: Name python3-all-versions-byte-compile

bindings/python/Makefile.am

index 61d82c50a7f39fcec254ed4a66f33f4dd273187f..55347054f6b0bbccc99fece3b52b71c0c1070053 100644 (file)
@@ -12,14 +12,22 @@ BUILD_TESTS = 1
 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