Browse Source

Merge pull request #740 from commodo/python-only-cleanups

Python Cleanups
lilik-openwrt-22.03
Steven Barth 10 years ago
parent
commit
6b9343abca
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      lang/python/files/python-package.mk

+ 11
- 2
lang/python/files/python-package.mk View File

@ -20,8 +20,7 @@ PYTHON:=python$(PYTHON_VERSION)
HOST_PYTHON_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON_VERSION)
HOST_PYTHON_BIN:=$(STAGING_DIR_HOST)/bin/python2
PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)
PYTHONPATH+=:$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
PYTHONPATH:=$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON_PKG_DIR)
define HostPython
( export PYTHONPATH="$(PYTHONPATH)"; \
export PYTHONOPTIMIZE=""; \
@ -39,6 +38,14 @@ ifdef CONFIG_USE_MIPS16
endif
define PyPackage
# Add default PyPackage filespec none defined
ifndef PyPackage/$(1)/filespec
define PyPackage/$(1)/filespec
+|$(PYTHON_PKG_DIR)
endef
endif
$(call shexport,PyPackage/$(1)/filespec)
define Package/$(1)/install
@ -46,6 +53,7 @@ define PyPackage
@echo "$$$$$$$$$$(call shvar,PyPackage/$(1)/filespec)" | ( \
IFS='|'; \
while read fop fspec fperm; do \
fop=`echo "$$$$$$$$fop" | tr -d ' \t\n'`; \
if [ "$$$$$$$$fop" = "+" ]; then \
if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
@ -98,3 +106,4 @@ define Build/Compile/PyMod
)
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef

Loading…
Cancel
Save