From a4565b8ce7614b3a6453220c31a4c103c9d857ef Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Mon, 12 Aug 2013 17:03:47 -0400 Subject: 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 Signed-off-by: Bruce Ashfield --- recipes-extended/libvirt/libvirt-python.inc | 4 ++ ...ow-location-of-python-on-the-target-to-be.patch | 53 ++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 recipes-extended/libvirt/libvirt/libvirt-allow-location-of-python-on-the-target-to-be.patch diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc index d4cc5f35..63e06577 100644 --- a/recipes-extended/libvirt/libvirt-python.inc +++ b/recipes-extended/libvirt/libvirt-python.inc @@ -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" \ No newline at end of file diff --git a/recipes-extended/libvirt/libvirt/libvirt-allow-location-of-python-on-the-target-to-be.patch b/recipes-extended/libvirt/libvirt/libvirt-allow-location-of-python-on-the-target-to-be.patch new file mode 100644 index 00000000..6fff8ea0 --- /dev/null +++ b/recipes-extended/libvirt/libvirt/libvirt-allow-location-of-python-on-the-target-to-be.patch @@ -0,0 +1,53 @@ +From 44e1046619457c709a0bb4efaa4ad983d9b81cbc Mon Sep 17 00:00:00 2001 +From: Mark Asselstine +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 +--- + 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 + -- cgit v1.2.3-54-g00ecf