meta-virtualization/recipes-networking/openvswitch/openvswitch_git.bb
Mark Asselstine b6d051a197 openvswitch: fix build host contamination
There is only a single PYTHON variable for configure and yet python is
used for the build as well as scripts installed on the target. If we
set a path in PYTHON as we had we end up using this same path during
the build and since it isn't to the sysroot we end up with host
contamination (as demonstrated by python failing to import 'six' on
build hosts without python-six installed.

The best approach is to set PYTHON to "python" when calling configure,
ie. without a path. This will use 'python' from the path during build
time and by ensuring all the installed scripts use '/usr/bin/env' we
can ensure python will be found on the target when the scripts are
run.

Since 'six' is used as part of the build we have to ensure it is
-native'ly buildable and we set all the required build and runtime
dependencies.

Signed-off-by: Mark Asselstine <mark.asselstine@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
2017-01-14 19:26:17 -05:00

55 lines
1.7 KiB
BlitzBasic

require openvswitch.inc
DEPENDS += "virtual/kernel"
RDEPENDS_${PN}-ptest += "\
python-logging python-syslog python-argparse python-io \
python-fcntl python-shell python-lang python-xml python-math \
python-datetime python-netclient python sed \
ldd perl-module-socket perl-module-carp perl-module-exporter \
perl-module-xsloader python-netserver python-threading \
python-resource python-subprocess \
"
S = "${WORKDIR}/git"
PV = "2.6.1+${SRCREV}"
FILESEXTRAPATHS_append := "${THISDIR}/${PN}-git:"
SRCREV = "f4b0e64cffb4777ff03d48621c3eadcf1d8c19f3"
SRC_URI += "\
git://github.com/openvswitch/ovs.git;protocol=git;branch=branch-2.6 \
file://openvswitch-add-ptest-${SRCREV}.patch \
file://run-ptest \
file://disable_m4_check.patch \
file://kernel_module.patch \
file://openvswitch-ptest-Fix-python-path.patch \
file://python-make-remaining-scripts-use-usr-bin-env.patch \
"
LIC_FILES_CHKSUM = "file://COPYING;md5=17b2c9d4c70853a09c0e143137754b35"
PACKAGECONFIG ?= ""
PACKAGECONFIG[dpdk] = "--with-dpdk=${STAGING_DIR_TARGET}/opt/dpdk/${TARGET_ARCH}-native-linuxapp-gcc,,dpdk,"
# Don't compile kernel modules by default since it heavily depends on
# kernel version. Use the in-kernel module for now.
# distro layers can enable with EXTRA_OECONF_pn_openvswitch += ""
# EXTRA_OECONF += "--with-linux=${STAGING_KERNEL_BUILDDIR} --with-linux-source=${STAGING_KERNEL_DIR} KARCH=${TARGET_ARCH}"
# silence a warning
FILES_${PN} += "/lib/modules"
inherit ptest
EXTRA_OEMAKE += "TEST_DEST=${D}${PTEST_PATH} TEST_ROOT=${PTEST_PATH}"
do_install_ptest() {
oe_runmake test-install
}
do_install_append() {
oe_runmake modules_install INSTALL_MOD_PATH=${D}
rm -r ${D}/${localstatedir}/run
}