summaryrefslogtreecommitdiffstats
path: root/recipes-containers/lxc
diff options
context:
space:
mode:
authorMark Asselstine <mark.asselstine@windriver.com>2016-03-17 12:25:05 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2016-03-21 10:26:01 -0400
commit5fcc6d24c35442dd1ac4018e1b2d2f981f0f20b2 (patch)
tree83e1480f2b2619c8d4b57e2737ae2d715157d5f8 /recipes-containers/lxc
parentf3e598729639546303e4bf041989417efe23613d (diff)
downloadmeta-virtualization-5fcc6d24c35442dd1ac4018e1b2d2f981f0f20b2.tar.gz
lxc: fix build issue - unable to find Python.h
Prior to poky commit 3d45853eef1269b455d840a60491802251368378 [python3: fix do_configure check platform triplet error] lxc's configure scripts would fail to find python3 and would therefor configure with python3 support disabled. After poky integrated the above commit lxc can, and does, detect python3 and attempts to configure with python support. Unfortunately it would detect the host's python3 which it would use to run setup.py and therefor get the host's include path etc. and ultimately fail to build. To fix this we make 'python' support configurable via a PACKAGECONFIG and we default to not configuring with this support, to match our previous configuration. We also fix things such that 'python' support can be enabled in the PACKAGECONFIG and the build will complete successfully, using our python3 and not the host's. We might want to eventually enable the python support but since this not only enables python extensions but even goes as far as turning scripts like lxc-ls into python scripts, instead of shell scripts, keeping it disabled for now is the minimally invasive approach. Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-containers/lxc')
-rw-r--r--recipes-containers/lxc/lxc_1.1.4.bb21
1 files changed, 21 insertions, 0 deletions
diff --git a/recipes-containers/lxc/lxc_1.1.4.bb b/recipes-containers/lxc/lxc_1.1.4.bb
index e017dcf4..a4c44d22 100644
--- a/recipes-containers/lxc/lxc_1.1.4.bb
+++ b/recipes-containers/lxc/lxc_1.1.4.bb
@@ -64,6 +64,13 @@ PACKAGECONFIG[apparmour] = "--enable-apparmor,--disable-apparmor,apparmor,apparm
64PACKAGECONFIG[templates] = ",,, ${PN}-templates" 64PACKAGECONFIG[templates] = ",,, ${PN}-templates"
65PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux" 65PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux,libselinux"
66PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp" 66PACKAGECONFIG[seccomp] ="--enable-seccomp,--disable-seccomp,libseccomp,libseccomp"
67PACKAGECONFIG[python] = "--enable-python,--disable-python,python3,python3-core"
68
69# required by python3 to run setup.py
70export BUILD_SYS
71export HOST_SYS
72export STAGING_INCDIR
73export STAGING_LIBDIR
67 74
68inherit autotools pkgconfig ptest update-rc.d systemd 75inherit autotools pkgconfig ptest update-rc.d systemd
69 76
@@ -78,6 +85,7 @@ INITSCRIPT_PARAMS_${PN}-setup = "${OS_DEFAULT_INITSCRIPT_PARAMS}"
78FILES_${PN}-doc = "${mandir} ${infodir}" 85FILES_${PN}-doc = "${mandir} ${infodir}"
79# For LXC the docdir only contains example configuration files and should be included in the lxc package 86# For LXC the docdir only contains example configuration files and should be included in the lxc package
80FILES_${PN} += "${docdir}" 87FILES_${PN} += "${docdir}"
88FILES_${PN} += "${libdir}/python3*"
81FILES_${PN}-dbg += "${libexecdir}/lxc/.debug" 89FILES_${PN}-dbg += "${libexecdir}/lxc/.debug"
82PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking" 90PACKAGES =+ "${PN}-templates ${PN}-setup ${PN}-networking"
83FILES_${PN}-templates += "${datadir}/lxc/templates" 91FILES_${PN}-templates += "${datadir}/lxc/templates"
@@ -92,6 +100,12 @@ FILES_${PN}-setup += "/etc/init.d"
92 100
93PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1" 101PRIVATE_LIBS_${PN}-ptest = "liblxc.so.1"
94 102
103CACHED_CONFIGUREVARS += " \
104 ac_cv_path_PYTHON='${STAGING_BINDIR_NATIVE}/python3-native/python3' \
105 am_cv_python_pyexecdir='${exec_prefix}/${libdir}/python3.5/site-packages' \
106 am_cv_python_pythondir='${prefix}/${libdir}/python3.5/site-packages' \
107"
108
95do_install_append() { 109do_install_append() {
96 # The /var/cache/lxc directory created by the Makefile 110 # The /var/cache/lxc directory created by the Makefile
97 # is wiped out in volatile, we need to create this at boot. 111 # is wiped out in volatile, we need to create this at boot.
@@ -107,6 +121,13 @@ do_install_append() {
107 install -d ${D}${sysconfdir}/init.d 121 install -d ${D}${sysconfdir}/init.d
108 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d 122 install -m 755 config/init/sysvinit/lxc* ${D}${sysconfdir}/init.d
109 fi 123 fi
124
125 # since python3-native is used for install location this will not be
126 # suitable for the target and we will have to correct the package install
127 if ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
128 if [ -d ${D}${exec_prefix}/lib/python* ]; then mv ${D}${exec_prefix}/lib/python* ${D}${libdir}/; fi
129 rmdir --ignore-fail-on-non-empty ${D}${exec_prefix}/lib
130 fi
110} 131}
111 132
112EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests" 133EXTRA_OEMAKE += "TEST_DIR=${D}${PTEST_PATH}/src/tests"