libvirt: fix python script's improper paths

libvirt generates several python scripts using its python/generator.py
script. This uses the PYTHON variable, which in our case will be a
full path to the sysroot that will not exist on the target. For this
we are patching libvirt to allow for (but not require) TARGET_PYTHON
to be defined and used when generating these python scripts.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Mark Asselstine 2013-08-12 17:03:47 -04:00 committed by Bruce Ashfield
parent 7dfc79162c
commit a4565b8ce7
2 changed files with 57 additions and 0 deletions

View File

@ -15,3 +15,7 @@ FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
FILES_${PN}-python += "${PYTHON_SITEPACKAGES_DIR}"
EXTRA_OECONF += "TARGET_PYTHON=${bindir}/python"
SRC_URI += "file://libvirt-allow-location-of-python-on-the-target-to-be.patch"

View File

@ -0,0 +1,53 @@
From 44e1046619457c709a0bb4efaa4ad983d9b81cbc Mon Sep 17 00:00:00 2001
From: Mark Asselstine <mark.asselstine@windriver.com>
Date: Mon, 12 Aug 2013 16:22:56 -0400
Subject: [PATCH] libvirt: allow location of python on the target to be
specified
Allow TARGET_PYTHON to be passed to configure. TARGET_PYTHON will be
passed to generator.py where it is used to create the sh.bang line at
the top of various generated scripts. This allows separation between
what is used to build vs. install. The default behavior is to leave
TARGET_PYTHON == PYTHON unless TARGET_PYTHON is passed to configure.
Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
---
configure.ac | 8 ++++++++
python/Makefile.am | 2 +-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 35a5d76..c1a27f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1965,6 +1965,14 @@ AM_CONDITIONAL([WITH_PYTHON], [test "$with_python" = "yes"])
AC_SUBST([PYTHON_VERSION])
AC_SUBST([PYTHON_INCLUDES])
+if test "$TARGET_PYTHON"; then
+ TARGET_PYTHON=$TARGET_PYTHON
+else
+ TARGET_PYTHON=$PYTHON
+fi
+AC_SUBST(TARGET_PYTHON)
+
+
dnl Allow perl overrides
AC_PATH_PROG([PERL], [perl])
diff --git a/python/Makefile.am b/python/Makefile.am
index 7eb42c6..8b9b480 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -131,7 +131,7 @@ $(GENERATE).stamp: $(srcdir)/$(GENERATE) \
$(QEMU_API_DESC) \
$(LXC_API_DESC) \
$(CLASSES_EXTRA)
- $(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(PYTHON) && \
+ $(AM_V_GEN)$(PYTHON) $(srcdir)/$(GENERATE) $(TARGET_PYTHON) && \
touch $@
$(GENERATED) $(QEMU_GENERATED) $(LXC_GENERATED): $(GENERATE).stamp
--
1.8.1.2