mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Robert Schwebel <r.schwebel@pengutronix.de>
To: ptxdist@pengutronix.de
Cc: Robert Schwebel <r.schwebel@pengutronix.de>
Subject: [ptxdist] [PATCH] python3: add option to include bundled pip
Date: Mon,  6 Jan 2020 16:12:39 +0100	[thread overview]
Message-ID: <20200106151239.3955692-1-r.schwebel@pengutronix.de> (raw)

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

             reply	other threads:[~2020-01-06 15:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-06 15:12 Robert Schwebel [this message]
2020-01-12 20:02 ` Robert Schwebel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200106151239.3955692-1-r.schwebel@pengutronix.de \
    --to=r.schwebel@pengutronix.de \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox