Browse Source

Merge pull request #3433 from jow-/python-use-staging-dir-hostpkg

python, python3: use STAGING_DIR_HOSTPKG
lilik-openwrt-22.03
Jo-Philipp Wich 8 years ago
committed by GitHub
parent
commit
c212c4aaee
2 changed files with 15 additions and 9 deletions
  1. +8
    -5
      lang/python/files/python-host.mk
  2. +7
    -4
      lang/python3/files/python3-package.mk

+ 8
- 5
lang/python/files/python-host.mk View File

@ -5,10 +5,13 @@
# 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
HOST_PYTHON_DIR:=$(HOST_BUILD_PREFIX)
HOST_PYTHON_DIR:=$(STAGING_DIR_HOSTPKG)
HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION) HOST_PYTHON_INC_DIR:=$(HOST_PYTHON_DIR)/include/python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION) HOST_PYTHON_LIB_DIR:=$(HOST_PYTHON_DIR)/lib/python$(PYTHON_VERSION)
@ -16,7 +19,7 @@ HOST_PYTHON_PKG_DIR:=/lib/python$(PYTHON_VERSION)/site-packages
HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION) HOST_PYTHON_BIN:=$(HOST_PYTHON_DIR)/bin/python$(PYTHON_VERSION)
HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(HOST_BUILD_PREFIX)/$(HOST_PYTHON_PKG_DIR)
HOST_PYTHONPATH:=$(HOST_PYTHON_LIB_DIR):$(STAGING_DIR_HOSTPKG)/$(HOST_PYTHON_PKG_DIR)
define HostPython define HostPython
if [ "$(strip $(3))" == "HOST" ]; then \ if [ "$(strip $(3))" == "HOST" ]; then \
@ -47,7 +50,7 @@ define Build/Compile/HostPyRunHost
LDSHARED="$(HOSTCC) -shared" \ LDSHARED="$(HOSTCC) -shared" \
CFLAGS="$(HOST_CFLAGS)" \ CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \ CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON_INC_DIR)" \
LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(HOST_BUILD_PREFIX)/lib" \
LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
_PYTHON_HOST_PLATFORM=linux2 \ _PYTHON_HOST_PLATFORM=linux2 \
$(3) \ $(3) \
, \ , \


+ 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