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/files/, dev-python/pypy/
Date: Fri, 27 Nov 2015 19:50:07
Message-Id: 1448653769.ac802704f1c23ef89035b5a817ae4314ea1b5c0c.mgorny@gentoo
1 commit: ac802704f1c23ef89035b5a817ae4314ea1b5c0c
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri Nov 27 16:13:31 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=ac802704
7
8 dev-python/pypy: Apply full Gentoo path set, only 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 dev-python/pypy/files/1.9-scripts-location.patch | 11 -----
22 dev-python/pypy/files/4.0.0-gentoo-path.patch | 50 ++++++++++++++++++++++
23 .../{pypy-2.6.0.ebuild => pypy-2.6.0-r1.ebuild} | 6 ++-
24 .../{pypy-4.0.0.ebuild => pypy-4.0.0-r1.ebuild} | 6 ++-
25 4 files changed, 60 insertions(+), 13 deletions(-)
26
27 diff --git a/dev-python/pypy/files/1.9-scripts-location.patch b/dev-python/pypy/files/1.9-scripts-location.patch
28 deleted file mode 100644
29 index 7453908..0000000
30 --- a/dev-python/pypy/files/1.9-scripts-location.patch
31 +++ /dev/null
32 @@ -1,11 +0,0 @@
33 ---- a/lib-python/2.7/distutils/command/install.py
34 -+++ b/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/files/4.0.0-gentoo-path.patch b/dev-python/pypy/files/4.0.0-gentoo-path.patch
46 new file mode 100644
47 index 0000000..4d394f9
48 --- /dev/null
49 +++ b/dev-python/pypy/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/pypy-2.6.0.ebuild b/dev-python/pypy/pypy-2.6.0-r1.ebuild
103 similarity index 97%
104 rename from dev-python/pypy/pypy-2.6.0.ebuild
105 rename to dev-python/pypy/pypy-2.6.0-r1.ebuild
106 index 779b81c..4058bf0 100644
107 --- a/dev-python/pypy/pypy-2.6.0.ebuild
108 +++ b/dev-python/pypy/pypy-2.6.0-r1.ebuild
109 @@ -85,10 +85,14 @@ 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 "${FILESDIR}"/2.5.0-shared-lib.patch # 517002
117
118 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
119 + -e "s^@libdir@^$(get_libdir)^" \
120 + -i lib-python/2.7/distutils/command/install.py || die
121 +
122 # apply CPython stdlib patches
123 pushd lib-python/2.7 > /dev/null || die
124 epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch \
125
126 diff --git a/dev-python/pypy/pypy-4.0.0.ebuild b/dev-python/pypy/pypy-4.0.0-r1.ebuild
127 similarity index 97%
128 rename from dev-python/pypy/pypy-4.0.0.ebuild
129 rename to dev-python/pypy/pypy-4.0.0-r1.ebuild
130 index 0bf61ef..19988bf 100644
131 --- a/dev-python/pypy/pypy-4.0.0.ebuild
132 +++ b/dev-python/pypy/pypy-4.0.0-r1.ebuild
133 @@ -85,10 +85,14 @@ pkg_setup() {
134 }
135
136 src_prepare() {
137 - epatch "${FILESDIR}/1.9-scripts-location.patch" \
138 + epatch "${FILESDIR}/4.0.0-gentoo-path.patch" \
139 "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \
140 "${FILESDIR}"/2.5.0-shared-lib.patch # 517002
141
142 + sed -e "s^@EPREFIX@^${EPREFIX}^" \
143 + -e "s^@libdir@^$(get_libdir)^" \
144 + -i lib-python/2.7/distutils/command/install.py || die
145 +
146 # apply CPython stdlib patches
147 pushd lib-python/2.7 > /dev/null || die
148 epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch \