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/pypy3/, dev-python/pypy3/files/
Date: Sun, 30 Apr 2017 19:22:11
Message-Id: 1493580124.aaa4898d90218cac82b60a5a33df716e06a3976b.mgorny@gentoo
1 commit: aaa4898d90218cac82b60a5a33df716e06a3976b
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 30 16:21:43 2017 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 30 19:22:04 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aaa4898d
7
8 dev-python/pypy3: Port -OO builds patch from python3.5
9
10 .../files/python-3.5-distutils-OO-build.patch | 80 ++++++++++++++++++++++
11 .../{pypy3-5.7.1.ebuild => pypy3-5.7.1-r1.ebuild} | 1 +
12 2 files changed, 81 insertions(+)
13
14 diff --git a/dev-python/pypy3/files/python-3.5-distutils-OO-build.patch b/dev-python/pypy3/files/python-3.5-distutils-OO-build.patch
15 new file mode 100644
16 index 00000000000..ff4446662a9
17 --- /dev/null
18 +++ b/dev-python/pypy3/files/python-3.5-distutils-OO-build.patch
19 @@ -0,0 +1,80 @@
20 +From 90507018442f9adabb586fd3d0a0206b9c2f2f50 Mon Sep 17 00:00:00 2001
21 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
22 +Date: Sun, 5 Jun 2016 08:18:01 +0200
23 +Subject: [PATCH] distutils: make -OO enable both opt-1 and opt-2 optimization
24 +
25 +Bug: http://bugs.python.org/issue27226
26 +Bug: https://bugs.gentoo.org/585060
27 +---
28 + distutils/command/build_py.py | 8 ++++----
29 + distutils/command/install_lib.py | 12 ++++++------
30 + 2 files changed, 10 insertions(+), 10 deletions(-)
31 +
32 +diff --git a/distutils/command/build_py.py b/distutils/command/build_py.py
33 +index cf0ca57..838d4e4 100644
34 +--- a/distutils/command/build_py.py
35 ++++ b/distutils/command/build_py.py
36 +@@ -315,9 +315,9 @@ class build_py (Command):
37 + if self.compile:
38 + outputs.append(importlib.util.cache_from_source(
39 + filename, optimization=''))
40 +- if self.optimize > 0:
41 ++ for opt in range(1, self.optimize + 1):
42 + outputs.append(importlib.util.cache_from_source(
43 +- filename, optimization=self.optimize))
44 ++ filename, optimization=opt))
45 +
46 + outputs += [
47 + os.path.join(build_dir, filename)
48 +@@ -387,8 +387,8 @@ class build_py (Command):
49 + if self.compile:
50 + byte_compile(files, optimize=0,
51 + force=self.force, prefix=prefix, dry_run=self.dry_run)
52 +- if self.optimize > 0:
53 +- byte_compile(files, optimize=self.optimize,
54 ++ for opt in range(1, self.optimize + 1):
55 ++ byte_compile(files, optimize=opt,
56 + force=self.force, prefix=prefix, dry_run=self.dry_run)
57 +
58 + class build_py_2to3(build_py, Mixin2to3):
59 +diff --git a/distutils/command/install_lib.py b/distutils/command/install_lib.py
60 +index 6154cf0..049b662 100644
61 +--- a/distutils/command/install_lib.py
62 ++++ b/distutils/command/install_lib.py
63 +@@ -24,8 +24,8 @@ class install_lib(Command):
64 + # 2) compile .pyc only (--compile --no-optimize; default)
65 + # 3) compile .pyc and "opt-1" .pyc (--compile --optimize)
66 + # 4) compile "opt-1" .pyc only (--no-compile --optimize)
67 +- # 5) compile .pyc and "opt-2" .pyc (--compile --optimize-more)
68 +- # 6) compile "opt-2" .pyc only (--no-compile --optimize-more)
69 ++ # 5) compile .pyc, "opt-1" and "opt-2" .pyc (--compile --optimize-more)
70 ++ # 6) compile "opt-1" and "opt-2" .pyc (--no-compile --optimize-more)
71 + #
72 + # The UI for this is two options, 'compile' and 'optimize'.
73 + # 'compile' is strictly boolean, and only decides whether to
74 +@@ -132,8 +132,8 @@ class install_lib(Command):
75 + byte_compile(files, optimize=0,
76 + force=self.force, prefix=install_root,
77 + dry_run=self.dry_run)
78 +- if self.optimize > 0:
79 +- byte_compile(files, optimize=self.optimize,
80 ++ for opt in range(1, self.optimize + 1):
81 ++ byte_compile(files, optimize=opt,
82 + force=self.force, prefix=install_root,
83 + verbose=self.verbose, dry_run=self.dry_run)
84 +
85 +@@ -167,9 +167,9 @@ class install_lib(Command):
86 + if self.compile:
87 + bytecode_files.append(importlib.util.cache_from_source(
88 + py_file, optimization=''))
89 +- if self.optimize > 0:
90 ++ for opt in range(1, self.optimize + 1):
91 + bytecode_files.append(importlib.util.cache_from_source(
92 +- py_file, optimization=self.optimize))
93 ++ py_file, optimization=opt))
94 +
95 + return bytecode_files
96 +
97 +--
98 +2.8.3
99 +
100
101 diff --git a/dev-python/pypy3/pypy3-5.7.1.ebuild b/dev-python/pypy3/pypy3-5.7.1-r1.ebuild
102 similarity index 99%
103 rename from dev-python/pypy3/pypy3-5.7.1.ebuild
104 rename to dev-python/pypy3/pypy3-5.7.1-r1.ebuild
105 index 9a1165e12a1..7633d4b3dcc 100644
106 --- a/dev-python/pypy3/pypy3-5.7.1.ebuild
107 +++ b/dev-python/pypy3/pypy3-5.7.1-r1.ebuild
108 @@ -88,6 +88,7 @@ src_prepare() {
109 # apply CPython stdlib patches
110 pushd lib-python/3 > /dev/null || die
111 eapply "${FILESDIR}"/5.7.1_all_distutils_cxx.patch
112 + eapply "${FILESDIR}"/python-3.5-distutils-OO-build.patch
113 popd > /dev/null || die
114
115 eapply_user