Gentoo Archives: gentoo-commits

From: Horea Christian <horea.christ@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: dev-python/llvmlite/files/, dev-python/llvmlite/
Date: Tue, 26 Apr 2022 03:34:44
Message-Id: 1650944071.79004b03e341bd74e25e1b3e021d8da672abc630.chymera@gentoo
1 commit: 79004b03e341bd74e25e1b3e021d8da672abc630
2 Author: Horea Christian <chr <AT> chymera <DOT> eu>
3 AuthorDate: Tue Apr 26 03:34:31 2022 +0000
4 Commit: Horea Christian <horea.christ <AT> gmail <DOT> com>
5 CommitDate: Tue Apr 26 03:34:31 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=79004b03
7
8 dev-python/llvmlite: LLVM_MAX_SLOT bump
9
10 Package-Manager: Portage-3.0.30, Repoman-3.0.3
11 Signed-off-by: Horea Christian <chr <AT> chymera.eu>
12
13 .../llvmlite/files/llvmlite-0.37.0-llvm12.patch | 91 +++++++++++++++++++++
14 .../llvmlite/files/llvmlite-0.38.0-llvm12.patch | 92 ++++++++++++++++++++++
15 ...ite-0.38.0.ebuild => llvmlite-0.37.0-r1.ebuild} | 4 +-
16 ...ite-0.37.0.ebuild => llvmlite-0.38.0-r1.ebuild} | 6 +-
17 4 files changed, 190 insertions(+), 3 deletions(-)
18
19 diff --git a/dev-python/llvmlite/files/llvmlite-0.37.0-llvm12.patch b/dev-python/llvmlite/files/llvmlite-0.37.0-llvm12.patch
20 new file mode 100644
21 index 000000000..ed104ab99
22 --- /dev/null
23 +++ b/dev-python/llvmlite/files/llvmlite-0.37.0-llvm12.patch
24 @@ -0,0 +1,91 @@
25 +From 1d928ebcd59b23b5050234a2bf71f9be7f5f6bd1 Mon Sep 17 00:00:00 2001
26 +From: Richard Barnes <rbarnes@×××.edu>
27 +Date: Wed, 1 Dec 2021 10:29:08 -0700
28 +Subject: [PATCH] Enable LLVM-12 and LLVM-13
29 +
30 +---
31 + ffi/build.py | 5 ++---
32 + ffi/targets.cpp | 2 ++
33 + llvmlite/tests/test_binding.py | 19 ++++++++++++++++---
34 + 3 files changed, 20 insertions(+), 6 deletions(-)
35 +
36 +diff --git a/ffi/build.py b/ffi/build.py
37 +index 6408bf5f..95e33c64 100755
38 +--- a/ffi/build.py
39 ++++ b/ffi/build.py
40 +@@ -162,9 +162,8 @@ def main_posix(kind, library_ext):
41 + print(msg)
42 + print(warning + '\n')
43 + else:
44 +-
45 +- if not out.startswith('11'):
46 +- msg = ("Building llvmlite requires LLVM 11.x.x, got "
47 ++ if not (out.startswith('11') or out.startswith('12') or out.startswith('13')):
48 ++ msg = ("Building llvmlite requires LLVM 11-13.x.x, got "
49 + "{!r}. Be sure to set LLVM_CONFIG to the right executable "
50 + "path.\nRead the documentation at "
51 + "http://llvmlite.pydata.org/ for more information about "
52 +diff --git a/ffi/targets.cpp b/ffi/targets.cpp
53 +index 1ce472c2..4ba33e79 100644
54 +--- a/ffi/targets.cpp
55 ++++ b/ffi/targets.cpp
56 +@@ -233,6 +233,8 @@ LLVMPY_CreateTargetMachine(LLVMTargetRef T,
57 + rm = Reloc::DynamicNoPIC;
58 +
59 + TargetOptions opt;
60 ++#if LLVM_VERSION_MAJOR < 12
61 + opt.PrintMachineCode = PrintMC;
62 ++#endif
63 +
64 + bool jit = JIT;
65 +diff --git a/llvmlite/tests/test_binding.py b/llvmlite/tests/test_binding.py
66 +index 80495787..fee2372a 100644
67 +--- a/llvmlite/tests/test_binding.py
68 ++++ b/llvmlite/tests/test_binding.py
69 +@@ -18,6 +18,16 @@
70 + from llvmlite.tests import TestCase
71 +
72 +
73 ++def clean_string_whitespace(x: str) -> str:
74 ++ # Remove trailing whitespace from the end of each line
75 ++ x = re.sub(r"\s+$", "", x, flags=re.MULTILINE)
76 ++ # Remove intermediate blank lines
77 ++ x = re.sub(r"\n\s*\n", r"\n", x, flags=re.MULTILINE)
78 ++ # Remove extraneous whitespace from the beginning and end of the string
79 ++ x = x.strip()
80 ++ return x
81 ++
82 ++
83 + # arvm7l needs extra ABI symbols to link successfully
84 + if platform.machine() == 'armv7l':
85 + llvm.load_library_permanently('libgcc_s.so.1')
86 +@@ -158,7 +168,7 @@ def no_de_locale():
87 + target triple = "unknown-unknown-unknown"
88 + target datalayout = ""
89 +
90 +-define i32 @"foo"()
91 ++define i32 @"foo"()
92 + {
93 + "<>!*''#":
94 + ret i32 12345
95 +@@ -424,7 +434,10 @@ def test_nonalphanum_block_name(self):
96 + bd = ir.IRBuilder(fn.append_basic_block(name="<>!*''#"))
97 + bd.ret(ir.Constant(ir.IntType(32), 12345))
98 + asm = str(mod)
99 +- self.assertEqual(asm, asm_nonalphanum_blocklabel)
100 ++ self.assertEqual(
101 ++ clean_string_whitespace(asm),
102 ++ clean_string_whitespace(asm_nonalphanum_blocklabel)
103 ++ )
104 +
105 + def test_global_context(self):
106 + gcontext1 = llvm.context.get_global_context()
107 +@@ -509,7 +522,7 @@ def test_set_option(self):
108 + def test_version(self):
109 + major, minor, patch = llvm.llvm_version_info
110 + # one of these can be valid
111 +- valid = [(11,)]
112 ++ valid = [(11,), (12,), (13,)]
113 + self.assertIn((major,), valid)
114 + self.assertIn(patch, range(10))
115 +
116
117 diff --git a/dev-python/llvmlite/files/llvmlite-0.38.0-llvm12.patch b/dev-python/llvmlite/files/llvmlite-0.38.0-llvm12.patch
118 new file mode 100644
119 index 000000000..6630652c2
120 --- /dev/null
121 +++ b/dev-python/llvmlite/files/llvmlite-0.38.0-llvm12.patch
122 @@ -0,0 +1,92 @@
123 +From 1d928ebcd59b23b5050234a2bf71f9be7f5f6bd1 Mon Sep 17 00:00:00 2001
124 +From: Richard Barnes <rbarnes@×××.edu>
125 +Date: Wed, 1 Dec 2021 10:29:08 -0700
126 +Subject: [PATCH] Enable LLVM-12 and LLVM-13
127 +
128 +---
129 + ffi/build.py | 5 ++---
130 + ffi/targets.cpp | 2 ++
131 + llvmlite/tests/test_binding.py | 19 ++++++++++++++++---
132 + 3 files changed, 20 insertions(+), 6 deletions(-)
133 +
134 +diff --git a/ffi/build.py b/ffi/build.py
135 +index 6408bf5f..95e33c64 100755
136 +--- a/ffi/build.py
137 ++++ b/ffi/build.py
138 +@@ -162,9 +162,8 @@ def main_posix(kind, library_ext):
139 + print(msg)
140 + print(warning + '\n')
141 + else:
142 +-
143 +- if not out.startswith('11'):
144 +- msg = ("Building llvmlite requires LLVM 11.x.x, got "
145 ++ if not (out.startswith('11') or out.startswith('12') or out.startswith('13')):
146 ++ msg = ("Building llvmlite requires LLVM 11-13.x.x, got "
147 + "{!r}. Be sure to set LLVM_CONFIG to the right executable "
148 + "path.\nRead the documentation at "
149 + "http://llvmlite.pydata.org/ for more information about "
150 +diff --git a/ffi/targets.cpp b/ffi/targets.cpp
151 +index 1ce472c2..4ba33e79 100644
152 +--- a/ffi/targets.cpp
153 ++++ b/ffi/targets.cpp
154 +@@ -233,7 +233,9 @@ LLVMPY_CreateTargetMachine(LLVMTargetRef T,
155 + rm = Reloc::DynamicNoPIC;
156 +
157 + TargetOptions opt;
158 ++#if LLVM_VERSION_MAJOR < 12
159 + opt.PrintMachineCode = PrintMC;
160 ++#endif
161 + opt.MCOptions.ABIName = ABIName;
162 +
163 + bool jit = JIT;
164 +diff --git a/llvmlite/tests/test_binding.py b/llvmlite/tests/test_binding.py
165 +index 80495787..fee2372a 100644
166 +--- a/llvmlite/tests/test_binding.py
167 ++++ b/llvmlite/tests/test_binding.py
168 +@@ -18,6 +18,16 @@
169 + from llvmlite.tests import TestCase
170 +
171 +
172 ++def clean_string_whitespace(x: str) -> str:
173 ++ # Remove trailing whitespace from the end of each line
174 ++ x = re.sub(r"\s+$", "", x, flags=re.MULTILINE)
175 ++ # Remove intermediate blank lines
176 ++ x = re.sub(r"\n\s*\n", r"\n", x, flags=re.MULTILINE)
177 ++ # Remove extraneous whitespace from the beginning and end of the string
178 ++ x = x.strip()
179 ++ return x
180 ++
181 ++
182 + # arvm7l needs extra ABI symbols to link successfully
183 + if platform.machine() == 'armv7l':
184 + llvm.load_library_permanently('libgcc_s.so.1')
185 +@@ -158,7 +168,7 @@ def no_de_locale():
186 + target triple = "unknown-unknown-unknown"
187 + target datalayout = ""
188 +
189 +-define i32 @"foo"()
190 ++define i32 @"foo"()
191 + {
192 + "<>!*''#":
193 + ret i32 12345
194 +@@ -424,7 +434,10 @@ def test_nonalphanum_block_name(self):
195 + bd = ir.IRBuilder(fn.append_basic_block(name="<>!*''#"))
196 + bd.ret(ir.Constant(ir.IntType(32), 12345))
197 + asm = str(mod)
198 +- self.assertEqual(asm, asm_nonalphanum_blocklabel)
199 ++ self.assertEqual(
200 ++ clean_string_whitespace(asm),
201 ++ clean_string_whitespace(asm_nonalphanum_blocklabel)
202 ++ )
203 +
204 + def test_global_context(self):
205 + gcontext1 = llvm.context.get_global_context()
206 +@@ -509,7 +522,7 @@ def test_set_option(self):
207 + def test_version(self):
208 + major, minor, patch = llvm.llvm_version_info
209 + # one of these can be valid
210 +- valid = [(11,)]
211 ++ valid = [(11,), (12,), (13,)]
212 + self.assertIn((major,), valid)
213 + self.assertIn(patch, range(10))
214 +
215
216 diff --git a/dev-python/llvmlite/llvmlite-0.38.0.ebuild b/dev-python/llvmlite/llvmlite-0.37.0-r1.ebuild
217 similarity index 95%
218 rename from dev-python/llvmlite/llvmlite-0.38.0.ebuild
219 rename to dev-python/llvmlite/llvmlite-0.37.0-r1.ebuild
220 index cadbc5407..607c1bb0b 100644
221 --- a/dev-python/llvmlite/llvmlite-0.38.0.ebuild
222 +++ b/dev-python/llvmlite/llvmlite-0.37.0-r1.ebuild
223 @@ -16,7 +16,7 @@ SLOT="0"
224 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
225 IUSE="examples"
226
227 -LLVM_MAX_SLOT=11
228 +LLVM_MAX_SLOT=12
229
230 RDEPEND="
231 sys-devel/llvm:${LLVM_MAX_SLOT}
232 @@ -24,6 +24,8 @@ RDEPEND="
233 "
234 DEPEND="${RDEPEND}"
235
236 +PATCHES=( "${FILESDIR}/${P}-llvm12.patch" )
237 +
238 src_prepare() {
239 sed -i -e '/max_python/s:3\.10:3.11:' setup.py || die
240 distutils-r1_src_prepare
241
242 diff --git a/dev-python/llvmlite/llvmlite-0.37.0.ebuild b/dev-python/llvmlite/llvmlite-0.38.0-r1.ebuild
243 similarity index 93%
244 rename from dev-python/llvmlite/llvmlite-0.37.0.ebuild
245 rename to dev-python/llvmlite/llvmlite-0.38.0-r1.ebuild
246 index d76175444..607c1bb0b 100644
247 --- a/dev-python/llvmlite/llvmlite-0.37.0.ebuild
248 +++ b/dev-python/llvmlite/llvmlite-0.38.0-r1.ebuild
249 @@ -1,4 +1,4 @@
250 -# Copyright 1999-2021 Gentoo Authors
251 +# Copyright 1999-2022 Gentoo Authors
252 # Distributed under the terms of the GNU General Public License v2
253
254 EAPI=7
255 @@ -16,7 +16,7 @@ SLOT="0"
256 KEYWORDS="~amd64 ~arm ~arm64 ~x86"
257 IUSE="examples"
258
259 -LLVM_MAX_SLOT=11
260 +LLVM_MAX_SLOT=12
261
262 RDEPEND="
263 sys-devel/llvm:${LLVM_MAX_SLOT}
264 @@ -24,6 +24,8 @@ RDEPEND="
265 "
266 DEPEND="${RDEPEND}"
267
268 +PATCHES=( "${FILESDIR}/${P}-llvm12.patch" )
269 +
270 src_prepare() {
271 sed -i -e '/max_python/s:3\.10:3.11:' setup.py || die
272 distutils-r1_src_prepare