Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pypy-bin/files/, dev-python/pypy-bin/
Date: Fri, 27 Nov 2015 19:50:03
Message-Id: 1448653769.2d1cc6f35df19bf9f787d5b717fa8879a47e99d7.mgorny@gentoo
1 commit: 2d1cc6f35df19bf9f787d5b717fa8879a47e99d7
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 27 16:29:08 2015 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri Nov 27 19:49:29 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2d1cc6f3
7
8 dev-python/pypy-bin: Apply full Gentoo path set, for Gentoo sys.prefix
9
10 Override all default distutils.command.install paths for Gentoo rather
11 than just scriptdir. However, do that only when install_base equals
12 the default prefix in which PyPy is installed system-wide.
13
14 This fixes both issues resulting from lack of prefix override (like
15 installing data files in /usr/lib*/pypy), and from overeager prefix
16 overrides (like virtualenv installing scripts in /usr/bin).
17
18 Fixes: https://bugs.gentoo.org/462306
19 Fixes: https://bugs.gentoo.org/465546
20
21 .../pypy-bin/files/1.9-scripts-location.patch | 11 -----
22 dev-python/pypy-bin/files/4.0.0-gentoo-path.patch | 50 ++++++++++++++++++++++
23 ...in-2.6.0-r1.ebuild => pypy-bin-2.6.0-r2.ebuild} | 6 ++-
24 ...y-bin-4.0.0.ebuild => pypy-bin-4.0.0-r1.ebuild} | 6 ++-
25 4 files changed, 60 insertions(+), 13 deletions(-)
26
27 diff --git a/dev-python/pypy-bin/files/1.9-scripts-location.patch b/dev-python/pypy-bin/files/1.9-scripts-location.patch
28 deleted file mode 100644
29 index 5f0190d..0000000
30 --- a/dev-python/pypy-bin/files/1.9-scripts-location.patch
31 +++ /dev/null
32 @@ -1,11 +0,0 @@
33 ---- pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
34 -+++ pypy-pypy-release-1.7/lib-python/2.7/distutils/command/install.py
35 -@@ -87,7 +87,7 @@
36 - 'purelib': '$base/site-packages',
37 - 'platlib': '$base/site-packages',
38 - 'headers': '$base/include',
39 -- 'scripts': '$base/bin',
40 -+ 'scripts': '/usr/bin',
41 - 'data' : '$base',
42 - },
43 - }
44
45 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
46 new file mode 100644
47 index 0000000..4d394f9
48 --- /dev/null
49 +++ b/dev-python/pypy-bin/files/4.0.0-gentoo-path.patch
50 @@ -0,0 +1,50 @@
51 +From 165e05bbdc93e54411217c0198d0a5cbb9de4e33 Mon Sep 17 00:00:00 2001
52 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
53 +Date: Fri, 27 Nov 2015 17:02:42 +0100
54 +Subject: [PATCH] Gentoo: override paths for system-wide install based on
55 + sys.prefix
56 +
57 +Override all default distutils install paths to ones suitable for
58 +system-wide install when sys.prefix indicates we're running the Gentoo
59 +system-wide install of PyPy with no prefix overrides (e.g. virtualenv).
60 +
61 +Fixes: https://bugs.gentoo.org/462306
62 +Fixes: https://bugs.gentoo.org/465546
63 +---
64 + lib-python/2.7/distutils/command/install.py | 13 ++++++++++++-
65 + 1 file changed, 12 insertions(+), 1 deletion(-)
66 +
67 +diff --git a/lib-python/2.7/distutils/command/install.py b/lib-python/2.7/distutils/command/install.py
68 +index fc43951..fed5218 100644
69 +--- a/lib-python/2.7/distutils/command/install.py
70 ++++ b/lib-python/2.7/distutils/command/install.py
71 +@@ -90,6 +90,13 @@ INSTALL_SCHEMES = {
72 + 'scripts': '$base/bin',
73 + 'data' : '$base',
74 + },
75 ++ 'gentoo': {
76 ++ 'purelib': '$base/site-packages',
77 ++ 'platlib': '$base/site-packages',
78 ++ 'headers': '$base/include',
79 ++ 'scripts': '@EPREFIX@/usr/bin',
80 ++ 'data' : '@EPREFIX@/usr',
81 ++ },
82 + }
83 +
84 + # The keys to an installation scheme; if any new types of files are to be
85 +@@ -476,7 +483,11 @@ class install (Command):
86 + # it's the caller's problem if they supply a bad name!
87 + if (hasattr(sys, 'pypy_version_info') and
88 + not name.endswith(('_user', '_home'))):
89 +- name = 'pypy'
90 ++ if self.install_base == os.path.normpath('@EPREFIX@/usr/@libdir@/pypy'):
91 ++ # override paths for system-wide install
92 ++ name = 'gentoo'
93 ++ else:
94 ++ name = 'pypy'
95 + scheme = INSTALL_SCHEMES[name]
96 + for key in SCHEME_KEYS:
97 + attrname = 'install_' + key
98 +--
99 +2.6.3
100 +
101
102 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
103 similarity index 97%
104 rename from dev-python/pypy-bin/pypy-bin-2.6.0-r1.ebuild
105 rename to dev-python/pypy-bin/pypy-bin-2.6.0-r2.ebuild
106 index 5459d26..24c009e 100644
107 --- a/dev-python/pypy-bin/pypy-bin-2.6.0-r1.ebuild
108 +++ b/dev-python/pypy-bin/pypy-bin-2.6.0-r2.ebuild
109 @@ -84,9 +84,13 @@ pkg_setup() {
110 }
111
112 src_prepare() {
113 - epatch "${FILESDIR}/1.9-scripts-location.patch" \
114 + epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \
115 "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
116
117 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
118 + -e "s^@libdir@^$(get_libdir)^" \
119 + -i lib-python/2.7/distutils/command/install.py || die
120 +
121 # apply CPython stdlib patches
122 pushd lib-python/2.7 > /dev/null || die
123 epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch \
124
125 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
126 similarity index 97%
127 rename from dev-python/pypy-bin/pypy-bin-4.0.0.ebuild
128 rename to dev-python/pypy-bin/pypy-bin-4.0.0-r1.ebuild
129 index 1b916dd..d5081dd 100644
130 --- a/dev-python/pypy-bin/pypy-bin-4.0.0.ebuild
131 +++ b/dev-python/pypy-bin/pypy-bin-4.0.0-r1.ebuild
132 @@ -84,9 +84,13 @@ pkg_setup() {
133 }
134
135 src_prepare() {
136 - epatch "${FILESDIR}/1.9-scripts-location.patch" \
137 + epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \
138 "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
139
140 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
141 + -e "s^@libdir@^$(get_libdir)^" \
142 + -i lib-python/2.7/distutils/command/install.py || die
143 +
144 # apply CPython stdlib patches
145 pushd lib-python/2.7 > /dev/null || die
146 epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch \