openvswitch: python: rework host and target dependency

Open vSwitch needs to run python on build machine to make build-time
required files.  python-six library is only required by the openvswitch
python library on target machine, not a build dependency.

We override host PYTHONPATH by overriding it in MAKE_VARS.  This way we
can remove 0003-override-pythonpath-via-make-vars.patch

This also fixes shebang wrongly pointing to python on host

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
This commit is contained in:
Yousong Zhou
2018-02-28 13:22:20 +08:00
parent 5b56acae21
commit f53d452bd1
3 changed files with 65 additions and 32 deletions
+6 -6
View File
@@ -22,14 +22,14 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://openvswitch.org/releases/
PKG_HASH:=8d1c439e26d7044f0ec823c7fef1b00b7c6465da0b83a7d0cf3191ed1dc43893
PKG_BUILD_DEPENDS:=python/host python-six/host
PKG_CONFIG_DEPENDS:=CONFIG_PACKAGE_openvswitch-python
PKG_BUILD_DEPENDS:=python/host
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python-host.mk
include ../../lang/python/python-package.mk
define Package/openvswitch/Default
@@ -155,12 +155,12 @@ CONFIGURE_VARS += \
ovs_cv_flake8=no \
ovs_cv_python3=no \
ovs_cv_sphinx=no \
ovs_cv_python=$(PYTHON) \
ovs_cv_python_host=$(HOST_PYTHON_BIN) \
KARCH=$(LINUX_KARCH)
MAKE_FLAGS += \
ARCH="$(LINUX_KARCH)" \
PYTHONPATH="$(HOST_PYTHONPATH)" \
PYTHON="$(HOST_PYTHON_BIN)"
MAKE_VARS += PYTHONPATH="$(HOST_PYTHONPATH)"
MAKE_FLAGS += ARCH="$(LINUX_KARCH)"
define OvsBinUtility
define Package/openvswitch-$(2)