| | |
| | | |
| | | %include-2% |
| | | # Since we cannot use the 'build' package to build itself we need to bootstrap. |
| | | # To do so we will use pyproject_installer to get PEP 376 compliant |
| | | # installation. The other possible way to bootstrap the 'build' package is |
| | | # setup.py, but its results are not PEP 376 compliant. |
| | | PYTHON_BOOTSTRAP = yes |
| | | |
| | | # Disable tests because required packages are not available during bootstrap |
| | | TEST_STYLE = none |
| | | %include-3% |
| | | # Use pyproject_installer to build this project |
| | | # |
| | | # Since pyproject_installer requires Python >= 3.8 we need to defer to default |
| | | # setup.py build style for Python 3.7, so we will use pyproject_installer for |
| | | # Python 3.9 only. Once we obsolete Python 3.7 we should set |
| | | # COMPONENT_BUILD_CMD and COMPONENT_BUILD_ARGS unconditionally below. |
| | | $(BUILD_DIR)/%-3.9/.built: COMPONENT_BUILD_CMD = $(PYTHON.3.9) -m pyproject_installer build |
| | | $(BUILD_DIR)/%-3.9/.built: COMPONENT_BUILD_ARGS = |
| | | |
| | | # Use pyproject_installer to install this project |
| | | # |
| | | # Since pyproject_installer requires Python >= 3.8 we need to defer to default |
| | | # setup.py build style for Python 3.7, so we will use pyproject_installer for |
| | | # Python 3.9 only. Once we obsolete Python 3.7 we should set |
| | | # COMPONENT_INSTALL_CMD and COMPONENT_INSTALL_ARGS unconditionally below. |
| | | $(BUILD_DIR)/%-3.9/.installed: COMPONENT_INSTALL_CMD = $(PYTHON.3.9) -m pyproject_installer install |
| | | $(BUILD_DIR)/%-3.9/.installed: COMPONENT_INSTALL_ARGS = |
| | | $(BUILD_DIR)/%-3.9/.installed: COMPONENT_INSTALL_ARGS += --destdir $(PROTO_DIR) |
| | | |
| | | # pyproject_installer does not bytecompile after the install. Since we need |
| | | # pyc files we need to force that. |
| | | # |
| | | # Since pyproject_installer requires Python >= 3.8 we need to defer to default |
| | | # setup.py build style for Python 3.7, and so we do not need to compile for |
| | | # Python 3.7. Once we obsolete Python 3.7 we should set |
| | | # COMPONENT_POST_INSTALL_ACTION unconditionally below. |
| | | $(BUILD_DIR)/%-3.9/.installed: COMPONENT_POST_INSTALL_ACTION += $(PYTHON) -m compileall $(PROTO_DIR)/$(PYTHON_LIB) ; |
| | | |
| | | # We need pyproject_installer |
| | | # Once we obsolete Python 3.7 this should be changed to |
| | | # PYTHON_USERLAND_REQUIRED_PACKAGES and '-39' suffix should be removed |
| | | USERLAND_REQUIRED_PACKAGES += library/python/pyproject_installer-39 |
| | | %hook-manifest% |
| | | # drop dist-info for Python 3.7 and egg-info for Python 3.9 |
| | | printf '<transform file path=usr/lib/python3\\.7/vendor-packages/build-.*\\.dist-info -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m" |
| | | printf '<transform file path=usr/lib/python3\\.9/vendor-packages/build-.*-py3\\.9\\.egg-info -> drop >\n' >> "$DISTRIBUTION-PYVER.p5m" |
| | | # usr/bin/pyproject-build-3.7 does not use importlib.metadata. It uses importlib_metadata instead. |
| | | printf '<transform file path=usr/bin/pyproject-build-3\\.7$ -> add pkg.depend.bypass-generate .*/importlib/(64/)?metadata.* >\n' >> "$DISTRIBUTION-PYVER.p5m" |