diff mbox series

[libgpiod] bindings: python: fix package installation with Makefile build

Message ID 20240109191828.73100-1-brgl@bgdev.pl
State New
Headers show
Series [libgpiod] bindings: python: fix package installation with Makefile build | expand

Commit Message

Bartosz Golaszewski Jan. 9, 2024, 7:18 p.m. UTC
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>

The modules are installed in the .egg directory, and therefore cannot be
imported after that. Additionally PIP tries to remove the global gpiod
module if it's not invoked with the --ignore-installed option.

Specify correct --root and fix the --prefix switch.

Link: https://github.com/pypa/pip/issues/3063
Suggested-by: Maxim Devaev <mdevaev@gmail.com>
Reported-by: Maxim Devaev <mdevaev@gmail.com>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 804b214..65964c7 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -36,7 +36,7 @@  all-local: python-tests
 
 install-exec-local:
 	$(PYTHON) -m pip install dist/*.whl \
-	--prefix=$(DESTDIR)$(prefix)
+	--ignore-installed --prefix=$(prefix) --root=$(if $(DESTDIR),$(DESTDIR),/)
 
 SUBDIRS = gpiod