1 |
commit: d8b0e7c0e5c4d7c2a26f70492c959d2b910eb3b7 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 31 09:33:12 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 31 09:44:08 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d8b0e7c0 |
7 |
|
8 |
sys-devel/distcc: Port to py38&39 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
sys-devel/distcc/distcc-3.3.3-r1.ebuild | 4 +- |
13 |
sys-devel/distcc/files/distcc-3.3.3-py38.patch | 53 ++++++++++++++++++++++++++ |
14 |
2 files changed, 56 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/sys-devel/distcc/distcc-3.3.3-r1.ebuild b/sys-devel/distcc/distcc-3.3.3-r1.ebuild |
17 |
index d7992e1b301..3ab5ecab6d3 100644 |
18 |
--- a/sys-devel/distcc/distcc-3.3.3-r1.ebuild |
19 |
+++ b/sys-devel/distcc/distcc-3.3.3-r1.ebuild |
20 |
@@ -3,7 +3,7 @@ |
21 |
|
22 |
EAPI=6 |
23 |
|
24 |
-PYTHON_COMPAT=( python3_{6,7} ) |
25 |
+PYTHON_COMPAT=( python3_{6,7,8,9} ) |
26 |
|
27 |
inherit autotools flag-o-matic python-single-r1 systemd \ |
28 |
toolchain-funcs user xdg-utils prefix |
29 |
@@ -53,6 +53,8 @@ src_prepare() { |
30 |
eapply "${FILESDIR}/${PN}-3.3.2-freedesktop.patch" |
31 |
# SOCKSv5 support needed for Portage, bug #537616 |
32 |
eapply "${FILESDIR}/${PN}-3.2_rc1-socks5.patch" |
33 |
+ # backport py3.8 fixes |
34 |
+ eapply "${FILESDIR}/${P}-py38.patch" |
35 |
eapply_user |
36 |
|
37 |
# Bugs #120001, #167844 and probably more. See patch for description. |
38 |
|
39 |
diff --git a/sys-devel/distcc/files/distcc-3.3.3-py38.patch b/sys-devel/distcc/files/distcc-3.3.3-py38.patch |
40 |
new file mode 100644 |
41 |
index 00000000000..1ba5fee7d87 |
42 |
--- /dev/null |
43 |
+++ b/sys-devel/distcc/files/distcc-3.3.3-py38.patch |
44 |
@@ -0,0 +1,53 @@ |
45 |
+From c52a023b8a17e4346c66a8fddee69b40b327eae7 Mon Sep 17 00:00:00 2001 |
46 |
+From: MartB <mart.b@×××××××.de> |
47 |
+Date: Thu, 28 Nov 2019 21:00:59 +0100 |
48 |
+Subject: [PATCH] Replace time.clock() with time.perf_counter() |
49 |
+ |
50 |
+.clock() got removed in python 3.8 and was marked as deprecated since 3.3 |
51 |
+(https://github.com/python/cpython/pull/13270) |
52 |
+--- |
53 |
+ include_server/parse_file.py | 4 ++-- |
54 |
+ include_server/statistics.py | 4 ++-- |
55 |
+ 2 files changed, 4 insertions(+), 4 deletions(-) |
56 |
+ |
57 |
+diff --git a/include_server/parse_file.py b/include_server/parse_file.py |
58 |
+index d1dcc74..f5d78b7 100755 |
59 |
+--- a/include_server/parse_file.py |
60 |
++++ b/include_server/parse_file.py |
61 |
+@@ -272,7 +272,7 @@ def Parse(self, filepath, symbol_table): |
62 |
+ |
63 |
+ assert isinstance(filepath, str) |
64 |
+ self.filepath = filepath |
65 |
+- parse_file_start_time = time.clock() |
66 |
++ parse_file_start_time = time.perf_counter() |
67 |
+ statistics.parse_file_counter += 1 |
68 |
+ |
69 |
+ includepath_map_index = self.includepath_map.Index |
70 |
+@@ -338,6 +338,6 @@ def Parse(self, filepath, symbol_table): |
71 |
+ expr_includes, next_includes) |
72 |
+ |
73 |
+ |
74 |
+- statistics.parse_file_total_time += time.clock() - parse_file_start_time |
75 |
++ statistics.parse_file_total_time += time.perf_counter() - parse_file_start_time |
76 |
+ |
77 |
+ return (quote_includes, angle_includes, expr_includes, next_includes) |
78 |
+diff --git a/include_server/statistics.py b/include_server/statistics.py |
79 |
+index 9677af3..7bc9cb8 100755 |
80 |
+--- a/include_server/statistics.py |
81 |
++++ b/include_server/statistics.py |
82 |
+@@ -62,13 +62,13 @@ def StartTiming(): |
83 |
+ global start_time, translation_unit_counter |
84 |
+ """Mark the start of a request to find an include closure.""" |
85 |
+ translation_unit_counter += 1 |
86 |
+- start_time = time.clock() |
87 |
++ start_time = time.perf_counter() |
88 |
+ |
89 |
+ |
90 |
+ def EndTiming(): |
91 |
+ """Mark the end of an include closure calculation.""" |
92 |
+ global translation_unit_time, min_time, max_time, total_time |
93 |
+- translation_unit_time = time.clock() - start_time |
94 |
++ translation_unit_time = time.perf_counter() - start_time |
95 |
+ min_time = min(translation_unit_time, min_time) |
96 |
+ max_time = max(translation_unit_time, max_time) |
97 |
+ total_time += translation_unit_time |