exist in the Python infrastructure: +PYTHON_FOO_VERSION+,
+PYTHON_FOO_SOURCE+, +PYTHON_FOO_PATCH+, +PYTHON_FOO_SITE+,
+PYTHON_FOO_SUBDIR+, +PYTHON_FOO_DEPENDENCIES+, +PYTHON_FOO_LICENSE+,
-+PYTHON_FOO_LICENSE_FILES+, etc.
++PYTHON_FOO_LICENSE_FILES+, +PYTHON_FOO_INSTALL_STAGING+, etc.
Note that:
- * Setting +PYTHON_FOO_INSTALL_STAGING+ to +YES+ has no effect (unless
- a +PYTHON_FOO_INSTALL_STAGING_CMDS+ variable is defined), since
- Python modules generally don't need to be installed to the
- +staging+ directory.
-
* It is not necessary to add +python+ or +host-python+ in the
+PYTHON_FOO_DEPENDENCIES+ variable of a package, since these basic
dependencies are automatically added as needed by the Python
packages, the +PKG_PYTHON_DISTUTILS_BUILD_OPT+ options are already
passed automatically by the infrastructure.
-* +PYTHON_FOO_INSTALL_OPT+, to specify additional options to pass to
- the Python +setup.py+ script during the installation step. Note that
- the infrastructure is automatically passing some options, defined in
- +PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for target distutils packages),
- +HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for host distutils
- packages), +PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+ (for target
- setuptools packages) and +HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+
- (for host setuptools packages).
+* +PYTHON_FOO_INSTALL_TARGET_OPT+, +PYTHON_FOO_INSTALL_STAGING_OPT+,
+ +HOST_PYTHON_FOO_INSTALL_OPT+ to specify additional options to pass
+ to the Python +setup.py+ script during the target installation step,
+ the staging installation step or the host installation,
+ respectively. Note that the infrastructure is automatically passing
+ some options, defined in +PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPT+
+ or +PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPT+ (for target distutils
+ packages), +HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for host
+ distutils packages), +PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPT+ or
+ +PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPT+ (for target setuptools
+ packages) and +HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+ (for host
+ setuptools packages).
* +HOST_PYTHON_FOO_NEEDS_HOST_PYTHON+, to define the host python
interpreter. The usage of this variable is limited to host
PKG_PYTHON_DISTUTILS_BUILD_OPT = \
--executable=/usr/bin/python
-PKG_PYTHON_DISTUTILS_INSTALL_OPT = \
+PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPT = \
--prefix=$(TARGET_DIR)/usr
+PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPT = \
+ --prefix=$(STAGING_DIR)/usr
+
# Host distutils-based packages
HOST_PKG_PYTHON_DISTUTILS_ENV = \
PATH=$(BR_PATH)
_python_prefix=/usr \
_python_exec_prefix=/usr
-PKG_PYTHON_SETUPTOOLS_INSTALL_OPT = \
+PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPT = \
--prefix=$(TARGET_DIR)/usr \
--executable=/usr/bin/python \
--single-version-externally-managed \
--root=/
+PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPT = \
+ --prefix=$(STAGING_DIR)/usr \
+ --executable=/usr/bin/python \
+ --single-version-externally-managed \
+ --root=/
+
# Host setuptools-based packages
HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
PATH=$(BR_PATH)
$(2)_BASE_ENV = $$(PKG_PYTHON_DISTUTILS_ENV)
$(2)_BASE_BUILD_TGT = build
$(2)_BASE_BUILD_OPT = $$(PKG_PYTHON_DISTUTILS_BUILD_OPT)
-$(2)_BASE_INSTALL_OPT = $$(PKG_PYTHON_DISTUTILS_INSTALL_OPT)
+$(2)_BASE_INSTALL_TARGET_OPT = $$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPT)
+$(2)_BASE_INSTALL_STAGING_OPT = $$(PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPT)
else
$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_DISTUTILS_ENV)
$(2)_BASE_BUILD_TGT = build
$(2)_BASE_ENV = $$(PKG_PYTHON_SETUPTOOLS_ENV)
$(2)_BASE_BUILD_TGT = build
$(2)_BASE_BUILD_OPT =
-$(2)_BASE_INSTALL_OPT = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_OPT)
+$(2)_BASE_INSTALL_TARGET_OPT = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPT)
+$(2)_BASE_INSTALL_STAGING_OPT = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPT)
else
$(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV)
$(2)_BASE_BUILD_TGT = build
(cd $$($$(PKG)_BUILDDIR)/; \
$$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \
$$($(2)_PYTHON_INTERPRETER) setup.py install \
- $$($$(PKG)_BASE_INSTALL_OPT) $$($$(PKG)_INSTALL_OPT))
+ $$($$(PKG)_BASE_INSTALL_TARGET_OPT) \
+ $$($$(PKG)_INSTALL_TARGET_OPT))
+endef
+endif
+
+#
+# Staging installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_STAGING_CMDS
+define $(2)_INSTALL_STAGING_CMDS
+ (cd $$($$(PKG)_BUILDDIR)/; \
+ $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \
+ $$($(2)_PYTHON_INTERPRETER) setup.py install \
+ $$($$(PKG)_BASE_INSTALL_STAGING_OPT) \
+ $$($$(PKG)_INSTALL_STAGING_OPT))
endef
endif