Hi,

I have trouble installing libsigrok on Gentoo because python bindings
during installation phase does not respect DESTDIR variable and try to
install *.py files directly into /usr/lib/....

Attached patch solves this problem, it add --root parameter if DESTDIR
is set. In order to achieve this bash variable expansion is used, this
might possibly lead to portability issue?

P
From 17ac989072d64519ab6d6339181196fc8480b6a7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pinkava?= <[email protected]>
Date: Sat, 22 Nov 2014 04:19:34 +0100
Subject: [PATCH] python installation respects DESTDIR

---
 Makefile.am | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index cab73cb..64813b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -503,8 +503,11 @@ $(PDIR)/timestamp: bindings/cxx/libsigrokxx.la $(PDIR)/sigrok/core/classes.i \
 		| grep -v "command line option.*Wstrict-prototypes"; true
 	$(AM_V_at)touch $(PDIR)/timestamp
 
-python-install:
-	cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet install --prefix $(prefix)
+$(DESTDIR)$(prefix):
+	$(MKDIR_P) $@
+
+python-install: $(DESTDIR)$(prefix)
+	cd $(PDIR) && $(PYTHON) $(abs_srcdir)/$(PDIR)/setup.py --quiet install --prefix=$(prefix) $${DESTDIR:+--root=$(DESTDIR)}
 
 python-clean:
 	$(AM_V_at)$(MAKE) python-quietclean
-- 
2.2.1

------------------------------------------------------------------------------
Dive into the World of Parallel Programming! The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net
_______________________________________________
sigrok-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to