From b6d051a19770e65bd23bccbd2fc6e948092a6f16 Mon Sep 17 00:00:00 2001 From: Mark Asselstine Date: Fri, 13 Jan 2017 16:49:56 -0500 Subject: 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 Signed-off-by: Bruce Ashfield --- ...on-make-remaining-scripts-use-usr-bin-env.patch | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch (limited to 'recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch') diff --git a/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch b/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch new file mode 100644 index 00000000..6091930e --- /dev/null +++ b/recipes-networking/openvswitch/files/python-make-remaining-scripts-use-usr-bin-env.patch @@ -0,0 +1,53 @@ +From 33769657e951da855b9258eb91fa9838373023ad Mon Sep 17 00:00:00 2001 +From: Mark Asselstine +Date: Fri, 13 Jan 2017 16:12:55 -0500 +Subject: [PATCH] python: make remaining scripts use /usr/bin/env + +Unfortunately there is no concept of a host python vs. target python +to facilitate cross compilation. There is only one PYTHON variable and +this is used during building and in the header of python scripts after +installation. The best approach for cross compilation is to thus to +ensure python is in the path and avoid passing a path as part of +PYTHON. To make this function smoothly all installed scripts should +make use of /usr/bin/env to increase the chances of finding python. + +Signed-off-by: Mark Asselstine +--- + ovsdb/ovsdb-dot.in | 2 +- + ovsdb/ovsdb-idlc.in | 2 +- + utilities/bugtool/ovs-bugtool.in | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/ovsdb/ovsdb-dot.in b/ovsdb/ovsdb-dot.in +index 134ce22..893c408 100755 +--- a/ovsdb/ovsdb-dot.in ++++ b/ovsdb/ovsdb-dot.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! /usr/bin/env @PYTHON@ + + from datetime import date + import ovs.db.error +diff --git a/ovsdb/ovsdb-idlc.in b/ovsdb/ovsdb-idlc.in +index cd4532e..dceb02f 100755 +--- a/ovsdb/ovsdb-idlc.in ++++ b/ovsdb/ovsdb-idlc.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! /usr/bin/env @PYTHON@ + + import getopt + import os +diff --git a/utilities/bugtool/ovs-bugtool.in b/utilities/bugtool/ovs-bugtool.in +index bb771b0..152d171 100755 +--- a/utilities/bugtool/ovs-bugtool.in ++++ b/utilities/bugtool/ovs-bugtool.in +@@ -1,4 +1,4 @@ +-#! @PYTHON@ ++#! /usr/bin/env @PYTHON@ + + # This library is free software; you can redistribute it and/or + # modify it under the terms of version 2.1 of the GNU Lesser General Public +-- +2.7.4 + -- cgit v1.2.3-54-g00ecf