summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYao Zhao <yao.zhao@windriver.com>2013-05-03 14:28:39 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-05-03 12:26:06 -0700
commit22e7b5e92b33e5fe18723083ce69867749839894 (patch)
tree09d31b6511da919c3b87d645981d613c7b9271d1
parentbb8c2c420bca06c67deb05e9f63e101752110759 (diff)
downloadmeta-virtualization-22e7b5e92b33e5fe18723083ce69867749839894.tar.gz
fix libvirt-python build problem
The current libvirt's config.log: configure:65065: checking for python configure:65083: found /usr/bin/python configure:65095: result: /usr/bin/python configure:65116: checking for python version configure:65123: result: 2.7 configure:65137: checking for python platform configure:65144: result: linux2 configure:65170: checking for python script directory configure:65206: result: ${prefix}/lib/python2.7/dist-packages configure:65215: checking for python extension module directory configure:65251: result: ${exec_prefix}/lib/python2.7/dist-packages so it will use host python which may quite different with target python. remove python_incdir.patch and inherit pythonnative. use PACKAGECONFIG instead of EXTRA_OECONF. enable python in full PACKAGECONFIG. Signed-off-by: Yao Zhao <yao.zhao@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-extended/libvirt/libvirt-python.inc21
-rw-r--r--recipes-extended/libvirt/libvirt/python_incdir.patch71
-rw-r--r--recipes-extended/libvirt/libvirt_1.0.3.bb2
3 files changed, 13 insertions, 81 deletions
diff --git a/recipes-extended/libvirt/libvirt-python.inc b/recipes-extended/libvirt/libvirt-python.inc
index 297e90c8..d4cc5f35 100644
--- a/recipes-extended/libvirt/libvirt-python.inc
+++ b/recipes-extended/libvirt/libvirt-python.inc
@@ -1,14 +1,17 @@
1inherit python-dir 1inherit pythonnative python-dir
2 2
3# Enable the Python tool support 3export STAGING_INCDIR
4EXTRA_OECONF += "--with-python=yes --with-python-inc-dir=-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}" 4export STAGING_LIBDIR
5export BUILD_SYS
6export HOST_SYS
5 7
6SRC_URI += " file://python_incdir.patch" 8PACKAGECONFIG += "python"
7 9PACKAGECONFIG[python] = "--with-python,--without-python,python,"
8DEPENDS += "python python-native"
9RDEPENDS_${PN}-python += "python" 10RDEPENDS_${PN}-python += "python"
10PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python" 11PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python"
11 12
12PACKAGES += "${PN}-python-dbg ${PN}-python" 13PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python"
13FILES_${PN}-python-dbg += "${libdir}/${PYTHON_DIR}/site-packages/.debug/" 14FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
14FILES_${PN}-python += "${libdir}/${PYTHON_DIR}/site-packages" 15FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
16FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
17FILES_${PN}-python += "${PYTHON_SITEPACKAGES_DIR}"
diff --git a/recipes-extended/libvirt/libvirt/python_incdir.patch b/recipes-extended/libvirt/libvirt/python_incdir.patch
deleted file mode 100644
index 5b78c13e..00000000
--- a/recipes-extended/libvirt/libvirt/python_incdir.patch
+++ /dev/null
@@ -1,71 +0,0 @@
1Index: libvirt-1.0.3/configure.ac
2===================================================================
3--- libvirt-1.0.3.orig/configure.ac
4+++ libvirt-1.0.3/configure.ac
5@@ -1878,6 +1878,11 @@ fi
6
7 PYTHON_VERSION=
8 PYTHON_INCLUDES=
9+
10+AC_ARG_WITH(python-inc-dir,
11+ AS_HELP_STRING([--with-python-inc-dir=DIR], [directory with Python include files]),
12+ [PYTHON_INCLUDES="${withval}"], [])
13+
14 if test "$with_python" != "no" ; then
15 if test -x "$with_python/bin/python"
16 then
17@@ -1901,31 +1906,32 @@ if test "$with_python" != "no" ; then
18
19 if test "$with_python" = "yes" ; then
20 AM_PATH_PYTHON(,, [:])
21-
22+ pyexecdir=$prefix/lib/python$PYTHON_VERSION/site-packages
23 if test "$PYTHON" != : ; then
24- PYTHON_CONFIG="$PYTHON-config"
25-
26- if test -x "$PYTHON_CONFIG"
27- then
28- PYTHON_INCLUDES=`$PYTHON_CONFIG --includes`
29- else
30- if test -r $PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION/Python.h
31- then
32- PYTHON_INCLUDES=-I$PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION
33- else
34- if test -r $prefix/include/python$PYTHON_VERSION/Python.h
35- then
36- PYTHON_INCLUDES=-I$prefix/include/python$PYTHON_VERSION
37- else
38- if test -r /usr/include/python$PYTHON_VERSION/Python.h
39- then
40- PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
41- else
42- AC_MSG_ERROR([You must install python-devel to build Python bindings])
43- fi
44+ if ! test -n "$PYTHON_INCLUDES"; then
45+ PYTHON_CONFIG="$PYTHON-config"
46+ if test -x "$PYTHON_CONFIG"
47+ then
48+ PYTHON_INCLUDES=`$PYTHON_CONFIG --includes`
49+ else
50+ if test -r $PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION/Python.h
51+ then
52+ PYTHON_INCLUDES=-I$PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION
53+ else
54+ if test -r $prefix/include/python$PYTHON_VERSION/Python.h
55+ then
56+ PYTHON_INCLUDES=-I$prefix/include/python$PYTHON_VERSION
57+ else
58+ if test -r /usr/include/python$PYTHON_VERSION/Python.h
59+ then
60+ PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
61+ else
62+ AC_MSG_ERROR([You must install python-devel to build Python bindings])
63+ fi
64+ fi
65 fi
66 fi
67- fi
68+ fi
69 else
70 AC_MSG_ERROR([You must install python to build Python bindings])
71 fi
diff --git a/recipes-extended/libvirt/libvirt_1.0.3.bb b/recipes-extended/libvirt/libvirt_1.0.3.bb
index f3419240..88cb0187 100644
--- a/recipes-extended/libvirt/libvirt_1.0.3.bb
+++ b/recipes-extended/libvirt/libvirt_1.0.3.bb
@@ -106,7 +106,7 @@ INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
106 106
107# full config 107# full config
108PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \ 108PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \
109 polkit lxc test remote macvtap libvirtd netcf udev" 109 polkit lxc test remote macvtap libvirtd netcf udev python"
110 110
111PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu" 111PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu"
112PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl" 112PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl"