Browse Source

python3: avoid use of HOST_BUILD_PREFIX

Currently, the python3-package.mk framework relies on HOST_BUILD_PREFIX to
refer to the $(STAGING_DIR)/host directory but using the HOST_BUILD_PREFIX
variable requires the use of include/host-build.mk which in turn includes
python3-package.mk, leading to target redefinition errors.

In order to provide a global, uniform way to refer to the host staging
directory, LEDE introduced a new variable STAGING_DIR_HOSTPKG which points
to $(STAGING_DIR)/host for now with the purpose of eventually being able to
relocate that directory in the future.

This commit changes python3-package.mk to ...
 - stop including include/host-build.mk (revert of #3423)
 - replace usages of $(HOST_BUILD_PREFIX) with $(STAGING_DIR_HOSTPKG)
 - warn and fallback to $(STAGING_DIR)/host if STAGING_DIR_HOSTPKG is
   unavailable

The fallback code will ensure that the python host build infrastructure
continues to work properly on older OpenWrt and LEDE versions until the
STAGING_DIR_HOSTPKG is fully settled in and can be removed some time
in the future.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
lilik-openwrt-22.03
Jo-Philipp Wich 8 years ago
parent
commit
4a083de4a9
1 changed files with 7 additions and 4 deletions
  1. +7
    -4
      lang/python3/files/python3-package.mk

+ 7
- 4
lang/python3/files/python3-package.mk View File

@ -5,8 +5,11 @@
# See /LICENSE for more information. # See /LICENSE for more information.
# #
# For HOST_BUILD_PREFIX
include $(INCLUDE_DIR)/host-build.mk
# Compatibility fallback for older OpenWrt and LEDE versions
ifeq ($(STAGING_DIR_HOSTPKG),)
$(warning STAGING_DIR_HOSTPKG is unset - falling back to $$(STAGING_DIR)/host)
STAGING_DIR_HOSTPKG := $(STAGING_DIR)/host
endif
PYTHON3_VERSION_MAJOR:=3 PYTHON3_VERSION_MAJOR:=3
PYTHON3_VERSION_MINOR:=5 PYTHON3_VERSION_MINOR:=5
@ -23,8 +26,8 @@ PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
PYTHON3:=python$(PYTHON3_VERSION) PYTHON3:=python$(PYTHON3_VERSION)
HOST_PYTHON3_LIB_DIR:=$(HOST_BUILD_PREFIX)/lib/python$(PYTHON3_VERSION)
HOST_PYTHON3_BIN:=$(HOST_BUILD_PREFIX)/bin/python3
HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR_HOSTPKG)/lib/python$(PYTHON3_VERSION)
HOST_PYTHON3_BIN:=$(STAGING_DIR_HOSTPKG)/bin/python3
PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR) PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
define HostPython3 define HostPython3


Loading…
Cancel
Save