Skip to contentSkip to conversation

bindings: python: pass DESTDIR to setup.py

PATCH In review Bartosz Golaszewski 2 participants 2 messages Feb 13, 2023 GPIO

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bindings: python: pass DESTDIR to setup.py

From: Bartosz Golaszewski <[email protected]>

As per automake docs:

The DESTDIR variable can be used to perform a staged installation. The package should be configured as if it was going to be installed in its final location (e.g., --prefix /usr), but when running make install, the DESTDIR should be set to the absolute name of a directory into which the installation will be diverted. From this directory it is easy to review which files are being installed where, and finally copy them to their final location by some means.

Prefix $(prefix) with $(DESTDIR) when calling setup.py.

---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bindings/python/Makefile.am +1 -1
index 9fb2e95..75ce53b 100644
@@ -18,7 +18,7 @@ all-local:
 
 install-exec-local:
 	GPIOD_WITH_TESTS= \
-	$(PYTHON) $(srcdir)/setup.py install --prefix=$(prefix)
+	$(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
 
 SUBDIRS = gpiod
 
Signature · 1 line
2.37.2
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 13 lines · Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

As per automake docs:

The DESTDIR variable can be used to perform a staged installation. The package should be configured as if it was going to be installed in its final location (e.g., --prefix /usr), but when running make install, the DESTDIR should be set to the absolute name of a directory into which the installation will be diverted. From this directory it is easy to review which files are being installed where, and finally copy them to their final location by some means.

Quoted 4 lines

Prefix $(prefix) with $(DESTDIR) when calling setup.py.

Fixes the build for Fedora, thanks.

Quoted 20 lines
---
 bindings/python/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
bindings/python/Makefile.am +1 -2
index 9fb2e95..75ce53b 100644
@@ -18,7 +18,7 @@ all-local:
 
 install-exec-local:
        GPIOD_WITH_TESTS= \
-       $(PYTHON) $(srcdir)/setup.py install --prefix=$(prefix)
+       $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
 
 SUBDIRS = gpiod
 
--

2.37.2