|
@@ -103,6 +103,47 @@ HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS = \
|
|
|
--root=/ \
|
|
|
--single-version-externally-managed
|
|
|
|
|
|
+# Target pep517-based packages
|
|
|
+PKG_PYTHON_PEP517_ENV = \
|
|
|
+ _PYTHON_SYSCONFIGDATA_NAME="$(PKG_PYTHON_SYSCONFIGDATA_NAME)" \
|
|
|
+ PATH=$(BR_PATH) \
|
|
|
+ $(TARGET_CONFIGURE_OPTS) \
|
|
|
+ PYTHONPATH="$(PYTHON3_PATH)" \
|
|
|
+ PYTHONNOUSERSITE=1 \
|
|
|
+ _python_sysroot=$(STAGING_DIR) \
|
|
|
+ _python_prefix=/usr \
|
|
|
+ _python_exec_prefix=/usr
|
|
|
+
|
|
|
+PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS = \
|
|
|
+ --interpreter=/usr/bin/python \
|
|
|
+ --script-kind=posix \
|
|
|
+ --purelib=$(TARGET_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
|
|
|
+ --headers=$(TARGET_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \
|
|
|
+ --scripts=$(TARGET_DIR)/usr/bin \
|
|
|
+ --data=$(TARGET_DIR)/usr
|
|
|
+
|
|
|
+PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS = \
|
|
|
+ --interpreter=/usr/bin/python \
|
|
|
+ --script-kind=posix \
|
|
|
+ --purelib=$(STAGING_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
|
|
|
+ --headers=$(STAGING_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \
|
|
|
+ --scripts=$(STAGING_DIR)/usr/bin \
|
|
|
+ --data=$(STAGING_DIR)/usr
|
|
|
+
|
|
|
+# Host pep517-based packages
|
|
|
+HOST_PKG_PYTHON_PEP517_ENV = \
|
|
|
+ PATH=$(BR_PATH) \
|
|
|
+ PYTHONNOUSERSITE=1 \
|
|
|
+ $(HOST_CONFIGURE_OPTS)
|
|
|
+
|
|
|
+HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \
|
|
|
+ --interpreter=/usr/bin/python \
|
|
|
+ --script-kind=posix \
|
|
|
+ --purelib=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages \
|
|
|
+ --headers=$(HOST_DIR)/usr/include/python$(PYTHON3_VERSION_MAJOR) \
|
|
|
+ --scripts=$(HOST_DIR)/usr/bin \
|
|
|
+ --data=$(HOST_DIR)/usr
|
|
|
+
|
|
|
################################################################################
|
|
|
# inner-python-package -- defines how the configuration, compilation
|
|
|
# and installation of a Python package should be done, implements a
|
|
@@ -152,8 +193,19 @@ $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV)
|
|
|
$(2)_BASE_BUILD_CMD = setup.py build
|
|
|
$(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS)
|
|
|
endif
|
|
|
+else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
|
|
|
+ifeq ($(4),target)
|
|
|
+$(2)_BASE_ENV = $$(PKG_PYTHON_PEP517_ENV)
|
|
|
+$(2)_BASE_BUILD_CMD = -m build -n -w
|
|
|
+$(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_TARGET_OPTS)
|
|
|
+$(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS)
|
|
|
+else
|
|
|
+$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_PEP517_ENV)
|
|
|
+$(2)_BASE_BUILD_CMD = -m build -n -w
|
|
|
+$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS)
|
|
|
+endif
|
|
|
else
|
|
|
-$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils' or 'setuptools'")
|
|
|
+$$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.")
|
|
|
endif
|
|
|
|
|
|
# Target packages need both the python interpreter on the target (for
|
|
@@ -172,6 +224,11 @@ endif # ($(4),target)
|
|
|
#
|
|
|
ifeq ($$($(2)_SETUP_TYPE),setuptools)
|
|
|
$(2)_DEPENDENCIES += $$(if $$(filter host-python-setuptools,$(1)),,host-python-setuptools)
|
|
|
+else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),)
|
|
|
+$(2)_DEPENDENCIES += host-python-pypa-build host-python-installer
|
|
|
+ifeq ($$($(2)_SETUP_TYPE),flit)
|
|
|
+$(2)_DEPENDENCIES += host-python-flit-core
|
|
|
+endif
|
|
|
endif # SETUP_TYPE
|
|
|
|
|
|
# Python interpreter to use for building the package.
|