mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] python3: add option to include bundled pip
@ 2020-01-06 15:12 Robert Schwebel
  2020-01-12 20:02 ` Robert Schwebel
  0 siblings, 1 reply; 2+ messages in thread
From: Robert Schwebel @ 2020-01-06 15:12 UTC (permalink / raw)
  To: ptxdist; +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 <r.schwebel@pengutronix.de>
---
 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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-12 20:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-06 15:12 [ptxdist] [PATCH] python3: add option to include bundled pip Robert Schwebel
2020-01-12 20:02 ` Robert Schwebel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox