Browse Source

python3: suffix vars with 3

lilik-openwrt-22.03
Alexandru Ardelean 10 years ago
parent
commit
72092dabf2
2 changed files with 24 additions and 21 deletions
  1. +6
    -3
      lang/python3/Makefile
  2. +18
    -18
      lang/python3/files/python3-package.mk

+ 6
- 3
lang/python3/Makefile View File

@ -10,6 +10,9 @@ include $(TOPDIR)/rules.mk
# The file included below defines PYTHON_VERSION
include ./files/python3-package.mk
PYTHON_VERSION:=$(PYTHON3_VERSION)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
PKG_RELEASE:=1
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
@ -134,7 +137,7 @@ define Build/InstallDev
$(SED) 's,^#!.*,#!/usr/bin/env python$(PYTHON_VERSION),g' $(2)/bin/python$(PYTHON_VERSION)-config
endef
define PyPackage/python3/filespec
define Py3Package/python3/filespec
+|/usr/bin/python$(PYTHON_VERSION)
+|/usr/lib/python$(PYTHON_VERSION)/encodings
+|/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py
@ -152,7 +155,7 @@ define PyPackage/python3/filespec
+|/usr/lib/python$(PYTHON_VERSION)/stat.py
endef
define PyPackage/python3/install
define Py3Package/python3/install
# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
endef
@ -190,6 +193,6 @@ endef
$(eval $(call HostBuild))
$(eval $(call PyPackage,python3))
$(eval $(call Py3Package,python3))
$(eval $(call BuildPackage,python3))

+ 18
- 18
lang/python3/files/python3-package.mk View File

@ -5,34 +5,34 @@
# See /LICENSE for more information.
#
PYTHON_VERSION:=3.4
PYTHON_VERSION_MICRO:=1
PYTHON3_VERSION:=3.4
PYTHON3_VERSION_MICRO:=1
PYTHON_DIR:=$(STAGING_DIR)/usr
PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
PYTHON3_DIR:=$(STAGING_DIR)/usr
PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
PYTHON3_PKG_DIR:=/usr/lib/python$(PYTHON3_VERSION)/site-packages
PYTHON:=python$(PYTHON_VERSION)
PYTHON3:=python$(PYTHON3_VERSION)
HOST_PYTHON_BIN:=$(STAGING_DIR)/usr/bin/hostpython
HOST_PYTHON3_BIN:=$(STAGING_DIR)/usr/bin/hostpython3
define HostPython
( export PYTHONPATH="$(PYTHON_LIB_DIR):$(STAGING_DIR)/$(PYTHON_PKG_DIR)"; \
define HostPython3
( export PYTHONPATH="$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)"; \
export PYTHONOPTIMIZE=""; \
export PYTHONDONTWRITEBYTECODE=1; \
$(1) \
$(HOST_PYTHON_BIN) $(2); \
$(HOST_PYTHON3_BIN) $(2); \
)
endef
define PyPackage
$(call shexport,PyPackage/$(1)/filespec)
define Py3Package
$(call shexport,Py3Package/$(1)/filespec)
define Package/$(1)/install
@$(SH_FUNC) getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \
@$(SH_FUNC) getvar $$(call shvar,Py3Package/$(1)/filespec) | ( \
IFS='|'; \
while read fop fspec fperm; do \
if [ "$$$$$$$$fop" = "+" ]; then \
@ -57,15 +57,15 @@ define PyPackage
fi; \
done; \
)
$(call PyPackage/$(1)/install,$$(1))
$(call Py3Package/$(1)/install,$$(1))
endef
endef
# $(1) => build subdir
# $(2) => additional arguments to setup.py
# $(3) => additional variables
define Build/Compile/PyMod
$(call HostPython, \
define Build/Compile/Py3Mod
$(call HostPython3, \
cd $(PKG_BUILD_DIR)/$(strip $(1)); \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS)" \


Loading…
Cancel
Save