public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy-bin/files/, dev-python/pypy-bin/
Date: Fri, 27 Nov 2015 19:49:55 +0000 (UTC)	[thread overview]
Message-ID: <1448653769.2d1cc6f35df19bf9f787d5b717fa8879a47e99d7.mgorny@gentoo> (raw)

commit:     2d1cc6f35df19bf9f787d5b717fa8879a47e99d7
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 27 16:29:08 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Nov 27 19:49:29 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d1cc6f3

dev-python/pypy-bin: Apply full Gentoo path set, for Gentoo sys.prefix

Override all default distutils.command.install paths for Gentoo rather
than just scriptdir. However, do that only when install_base equals
the default prefix in which PyPy is installed system-wide.

This fixes both issues resulting from lack of prefix override (like
installing data files in /usr/lib*/pypy), and from overeager prefix
overrides (like virtualenv installing scripts in /usr/bin).

Fixes: https://bugs.gentoo.org/462306
Fixes: https://bugs.gentoo.org/465546

 .../pypy-bin/files/1.9-scripts-location.patch      | 11 -----
 dev-python/pypy-bin/files/4.0.0-gentoo-path.patch  | 50 ++++++++++++++++++++++
 ...in-2.6.0-r1.ebuild => pypy-bin-2.6.0-r2.ebuild} |  6 ++-
 ...y-bin-4.0.0.ebuild => pypy-bin-4.0.0-r1.ebuild} |  6 ++-
 4 files changed, 60 insertions(+), 13 deletions(-)

diff --git a/dev-python/pypy-bin/files/1.9-scripts-location.patch b/dev-python/pypy-bin/files/1.9-scripts-location.patch
deleted file mode 100644
index 5f0190d..0000000
--- a/dev-python/pypy-bin/files/1.9-scripts-location.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
-+++ pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
-@@ -87,7 +87,7 @@
-         'purelib': '$base/site-packages',
-         'platlib': '$base/site-packages',
-         'headers': '$base/include',
--        'scripts': '$base/bin',
-+        'scripts': '/usr/bin',
-         'data'   : '$base',
-         },
-     }

diff --git a/dev-python/pypy-bin/files/4.0.0-gentoo-path.patch b/dev-python/pypy-bin/files/4.0.0-gentoo-path.patch
new file mode 100644
index 0000000..4d394f9
--- /dev/null
+++ b/dev-python/pypy-bin/files/4.0.0-gentoo-path.patch
@@ -0,0 +1,50 @@
+From 165e05bbdc93e54411217c0198d0a5cbb9de4e33 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 27 Nov 2015 17:02:42 +0100
+Subject: [PATCH] Gentoo: override paths for system-wide install based on
+ sys.prefix
+
+Override all default distutils install paths to ones suitable for
+system-wide install when sys.prefix indicates we're running the Gentoo
+system-wide install of PyPy with no prefix overrides (e.g. virtualenv).
+
+Fixes: https://bugs.gentoo.org/462306
+Fixes: https://bugs.gentoo.org/465546
+---
+ lib-python/2.7/distutils/command/install.py | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/lib-python/2.7/distutils/command/install.py b/lib-python/2.7/distutils/command/install.py
+index fc43951..fed5218 100644
+--- a/lib-python/2.7/distutils/command/install.py
++++ b/lib-python/2.7/distutils/command/install.py
+@@ -90,6 +90,13 @@ INSTALL_SCHEMES = {
+         'scripts': '$base/bin',
+         'data'   : '$base',
+         },
++    'gentoo': {
++        'purelib': '$base/site-packages',
++        'platlib': '$base/site-packages',
++        'headers': '$base/include',
++        'scripts': '@EPREFIX@/usr/bin',
++        'data'   : '@EPREFIX@/usr',
++        },
+     }
+ 
+ # The keys to an installation scheme; if any new types of files are to be
+@@ -476,7 +483,11 @@ class install (Command):
+         # it's the caller's problem if they supply a bad name!
+         if (hasattr(sys, 'pypy_version_info') and
+             not name.endswith(('_user', '_home'))):
+-            name = 'pypy'
++            if self.install_base == os.path.normpath('@EPREFIX@/usr/@libdir@/pypy'):
++                # override paths for system-wide install
++                name = 'gentoo'
++            else:
++                name = 'pypy'
+         scheme = INSTALL_SCHEMES[name]
+         for key in SCHEME_KEYS:
+             attrname = 'install_' + key
+-- 
+2.6.3
+

diff --git a/dev-python/pypy-bin/pypy-bin-2.6.0-r1.ebuild b/dev-python/pypy-bin/pypy-bin-2.6.0-r2.ebuild
similarity index 97%
rename from dev-python/pypy-bin/pypy-bin-2.6.0-r1.ebuild
rename to dev-python/pypy-bin/pypy-bin-2.6.0-r2.ebuild
index 5459d26..24c009e 100644
--- a/dev-python/pypy-bin/pypy-bin-2.6.0-r1.ebuild
+++ b/dev-python/pypy-bin/pypy-bin-2.6.0-r2.ebuild
@@ -84,9 +84,13 @@ pkg_setup() {
 }
 
 src_prepare() {
-	epatch "${FILESDIR}/1.9-scripts-location.patch" \
+	epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \
 		"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
 
+	sed -e "s^@EPREFIX@^${EPREFIX}^" \
+		-e "s^@libdir@^$(get_libdir)^" \
+		-i lib-python/2.7/distutils/command/install.py || die
+
 	# apply CPython stdlib patches
 	pushd lib-python/2.7 > /dev/null || die
 	epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch \

diff --git a/dev-python/pypy-bin/pypy-bin-4.0.0.ebuild b/dev-python/pypy-bin/pypy-bin-4.0.0-r1.ebuild
similarity index 97%
rename from dev-python/pypy-bin/pypy-bin-4.0.0.ebuild
rename to dev-python/pypy-bin/pypy-bin-4.0.0-r1.ebuild
index 1b916dd..d5081dd 100644
--- a/dev-python/pypy-bin/pypy-bin-4.0.0.ebuild
+++ b/dev-python/pypy-bin/pypy-bin-4.0.0-r1.ebuild
@@ -84,9 +84,13 @@ pkg_setup() {
 }
 
 src_prepare() {
-	epatch "${FILESDIR}/1.9-scripts-location.patch" \
+	epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \
 		"${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
 
+	sed -e "s^@EPREFIX@^${EPREFIX}^" \
+		-e "s^@libdir@^$(get_libdir)^" \
+		-i lib-python/2.7/distutils/command/install.py || die
+
 	# apply CPython stdlib patches
 	pushd lib-python/2.7 > /dev/null || die
 	epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch \


             reply	other threads:[~2015-11-27 19:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-27 19:49 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-12-30 11:59 [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy-bin/files/, dev-python/pypy-bin/ Michał Górny
2019-05-24 14:21 Michał Górny
2019-02-16 15:08 Michał Górny
2017-04-25 21:49 Michał Górny
2015-11-27 16:11 Michał Górny

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=1448653769.2d1cc6f35df19bf9f787d5b717fa8879a47e99d7.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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