From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Robert Schwebel Date: Mon, 6 Jan 2020 16:12:39 +0100 Message-Id: <20200106151239.3955692-1-r.schwebel@pengutronix.de> MIME-Version: 1.0 Subject: [ptxdist] [PATCH] python3: add option to include bundled pip List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ptxdist-bounces@pengutronix.de Sender: "ptxdist" To: ptxdist@pengutronix.de Cc: Robert Schwebel Python can be configured --with-ensurepip, which bundles an included pip installer. If the option is enabled, the build process also generates two wheel files for pip and setuptools: Lib/ensurepip/_bundled/pip-19.0.3-py2.py3-none-any.whl Lib/ensurepip/_bundled/setuptools-40.8.0-py2.py3-none-any.whl which need to be installed on targetinstall. Now that 'python3 -m venv env' works, it turns out that the 'activate' script was not installed, which is fixed in this patch as well. Signed-off-by: Robert Schwebel --- rules/python3.in | 4 ++++ rules/python3.make | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/rules/python3.in b/rules/python3.in index cf4314cb6..72b8115c4 100644 --- a/rules/python3.in +++ b/rules/python3.in @@ -63,6 +63,10 @@ config PYTHON3_DISTUTILS bool prompt "Include distutils packages" +config PYTHON3_ENSUREPIP + bool + prompt "Include bundled pip" + endif menu "python3 Extra Modules " diff --git a/rules/python3.make b/rules/python3.make index 1b3ed7b7d..bbda265c2 100644 --- a/rules/python3.make +++ b/rules/python3.make @@ -75,7 +75,7 @@ PYTHON3_CONF_OPT := \ --without-valgrind \ --without-dtrace \ --with-computed-gotos \ - --without-ensurepip \ + --$(call ptx/wwo, PTXCONF_PYTHON3_ENSUREPIP)-ensurepip \ --with-openssl=$(SYSROOT)/usr # Keep dictionary order in .pyc files stable @@ -162,12 +162,14 @@ $(STATEDIR)/python3.targetinstall: @$(call install_fixup, python3,DESCRIPTION,missing) @$(call install_glob, python3, 0, 0, -, /usr/lib/python$(PYTHON3_MAJORMINOR), \ - *.so *.pyc, */test */tests */__pycache__ $(PYTHON3_SKIP-y)) + *.so *.pyc *.whl, */test */tests */__pycache__ $(PYTHON3_SKIP-y)) @$(call install_copy, python3, 0, 0, 755, -, /usr/bin/python$(PYTHON3_MAJORMINOR)) @$(call install_link, python3, python$(PYTHON3_MAJORMINOR), /usr/bin/python3) @$(call install_lib, python3, 0, 0, 644, libpython$(PYTHON3_MAJORMINOR)m) + @$(call install_copy, python3, 0, 0, 644, -, /usr/lib/python$(PYTHON3_MAJORMINOR)/venv/scripts/common/activate) + ifdef PTXCONF_PYTHON3_SYMLINK @$(call install_link, python3, python$(PYTHON3_MAJORMINOR), /usr/bin/python) endif -- 2.24.1 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de