Gentoo Archives: gentoo-commits

From: Andrew Savchenko <bircoph@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/prng/files/, sci-mathematics/prng/
Date: Tue, 18 May 2021 22:03:01
Message-Id: 1621375367.fcbf9252166ef3f04d46343fb5886aa7e91a58ea.bircoph@gentoo
1 commit: fcbf9252166ef3f04d46343fb5886aa7e91a58ea
2 Author: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 18 21:58:26 2021 +0000
4 Commit: Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
5 CommitDate: Tue May 18 22:02:47 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fcbf9252
7
8 sci-mathematics/prng: fix unresolved symbols
9
10 Some symbols were unresolved because functions were inlined.
11 This caused build failure of other packages like unurun.
12
13 Bug: https://bugs.gentoo.org/705318
14 Package-Manager: Portage-3.0.18, Repoman-3.0.3
15 Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
16
17 .../prng-3.0.2-fix-all-c99-inline-semantics.patch | 404 +++++++++++++++++++++
18 sci-mathematics/prng/prng-3.0.2-r3.ebuild | 44 +++
19 2 files changed, 448 insertions(+)
20
21 diff --git a/sci-mathematics/prng/files/prng-3.0.2-fix-all-c99-inline-semantics.patch b/sci-mathematics/prng/files/prng-3.0.2-fix-all-c99-inline-semantics.patch
22 new file mode 100644
23 index 00000000000..e6281704376
24 --- /dev/null
25 +++ b/sci-mathematics/prng/files/prng-3.0.2-fix-all-c99-inline-semantics.patch
26 @@ -0,0 +1,404 @@
27 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/anti.c prng-3.0.2/src/anti.c
28 +--- prng-3.0.2.orig/src/anti.c 2001-11-06 22:31:36.000000000 +0300
29 ++++ prng-3.0.2/src/anti.c 2021-05-19 00:41:03.400665843 +0300
30 +@@ -82,7 +82,7 @@
31 + * gen: Pointer to a struct prng.
32 + *
33 + */
34 +-inline double prng_anti_get_next(struct prng *gen)
35 ++double prng_anti_get_next(struct prng *gen)
36 + {
37 + return (1. - prng_get_next(gen->data.anti_data.prng));
38 + }
39 +@@ -114,7 +114,7 @@
40 + *
41 + */
42 + /*
43 +-inline prng_num prng_anti_get_next_int(struct prng *gen)
44 ++prng_num prng_anti_get_next_int(struct prng *gen)
45 + ... undefined !!!
46 + */
47 +
48 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/compound.c prng-3.0.2/src/compound.c
49 +--- prng-3.0.2.orig/src/compound.c 2001-11-06 22:34:51.000000000 +0300
50 ++++ prng-3.0.2/src/compound.c 2021-05-19 00:41:03.395665825 +0300
51 +@@ -105,7 +105,7 @@
52 + * gen: Pointer to a struct prng.
53 + *
54 + */
55 +-inline double prng_compound_get_next(struct prng *gen)
56 ++double prng_compound_get_next(struct prng *gen)
57 + {
58 + int i;
59 + double sum = 0.0;
60 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/cons.c prng-3.0.2/src/cons.c
61 +--- prng-3.0.2.orig/src/cons.c 2001-11-06 22:35:29.000000000 +0300
62 ++++ prng-3.0.2/src/cons.c 2021-05-19 00:41:03.392665813 +0300
63 +@@ -89,7 +89,7 @@
64 + * gen: Pointer to a struct prng.
65 + *
66 + */
67 +-inline double prng_con_get_next(struct prng *gen)
68 ++double prng_con_get_next(struct prng *gen)
69 + {
70 + return(prng_get_next(gen->data.con_data.prng));
71 + }
72 +@@ -119,7 +119,7 @@
73 + * gen: Pointer to a struct prng.
74 + *
75 + */
76 +-inline prng_num prng_con_get_next_int(struct prng *gen)
77 ++prng_num prng_con_get_next_int(struct prng *gen)
78 + {
79 + return(prng_get_next_int(gen->data.con_data.prng));
80 + }
81 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/dicg.c prng-3.0.2/src/dicg.c
82 +--- prng-3.0.2.orig/src/dicg.c 2001-11-06 22:35:50.000000000 +0300
83 ++++ prng-3.0.2/src/dicg.c 2021-05-19 00:41:03.398665836 +0300
84 +@@ -441,7 +441,7 @@
85 + * Algorithm by Karin Schaber and Otmar Lendl.
86 + *
87 + */
88 +-inline prng_num prng_dicg_multiply(int k,prng_num c, prng_num d)
89 ++prng_num prng_dicg_multiply(int k,prng_num c, prng_num d)
90 + {
91 + int i;
92 + struct mtable *t;
93 +@@ -593,7 +593,7 @@
94 + * gen: Pointer to a struct prng.
95 + *
96 + */
97 +-inline prng_num prng_dicg_get_next_int(struct prng *gen) /* DUMMY !!!!*/
98 ++prng_num prng_dicg_get_next_int(struct prng *gen) /* DUMMY !!!!*/
99 + {
100 + s_prng_num inv, current, prod;
101 +
102 +@@ -619,7 +619,7 @@
103 + * gen: Pointer to a struct prng.
104 + *
105 + */
106 +-inline double prng_dicg_get_next(struct prng *gen)
107 ++double prng_dicg_get_next(struct prng *gen)
108 + {
109 + return(prng_dicg_get_next_int(gen) * gen->data.dicg_data.inv_p);
110 + }
111 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/eicg.c prng-3.0.2/src/eicg.c
112 +--- prng-3.0.2.orig/src/eicg.c 2001-11-06 22:36:04.000000000 +0300
113 ++++ prng-3.0.2/src/eicg.c 2021-05-19 00:41:03.405665862 +0300
114 +@@ -120,7 +120,7 @@
115 + * gen: Pointer to a struct prng.
116 + *
117 + */
118 +-inline prng_num prng_eicg_get_next_int(struct prng *gen)
119 ++prng_num prng_eicg_get_next_int(struct prng *gen)
120 + {
121 + prng_num old;
122 +
123 +@@ -138,7 +138,7 @@
124 + * gen: Pointer to a struct prng.
125 + *
126 + */
127 +-inline double prng_eicg_get_next(struct prng *gen)
128 ++double prng_eicg_get_next(struct prng *gen)
129 + {
130 + return(prng_eicg_get_next_int(gen) * gen->data.eicg_data.inv_p);
131 + }
132 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/external.c prng-3.0.2/src/external.c
133 +--- prng-3.0.2.orig/src/external.c 2001-11-06 22:36:35.000000000 +0300
134 ++++ prng-3.0.2/src/external.c 2021-05-19 00:41:03.391665810 +0300
135 +@@ -139,7 +139,7 @@
136 + * gen: Pointer to a struct prng.
137 + *
138 + */
139 +-inline prng_num prng_tt800_get_next_int(struct prng *gen)
140 ++prng_num prng_tt800_get_next_int(struct prng *gen)
141 + {
142 + unsigned int y;
143 + struct tt800_state *g;
144 +@@ -189,7 +189,7 @@
145 + * gen: Pointer to a struct prng.
146 + *
147 + */
148 +-inline double prng_tt800_get_next(struct prng *gen)
149 ++double prng_tt800_get_next(struct prng *gen)
150 + {
151 + return(prng_tt800_get_next_int(gen) * TT800_INV_MOD);
152 + }
153 +@@ -223,7 +223,7 @@
154 + * gen: Pointer to a struct prng.
155 + *
156 + */
157 +-inline prng_num prng_ctg_get_next_int(struct prng *gen)
158 ++prng_num prng_ctg_get_next_int(struct prng *gen)
159 + {
160 + unsigned int b;
161 + struct ctg_state *g;
162 +@@ -247,7 +247,7 @@
163 + * gen: Pointer to a struct prng.
164 + *
165 + */
166 +-inline double prng_ctg_get_next(struct prng *gen)
167 ++double prng_ctg_get_next(struct prng *gen)
168 + {
169 + return(prng_ctg_get_next_int(gen) * 2.3283064365e-10);
170 + }
171 +@@ -285,7 +285,7 @@
172 + * gen: Pointer to a struct prng.
173 + *
174 + */
175 +-inline prng_num prng_mrg_get_next_int(struct prng *gen)
176 ++prng_num prng_mrg_get_next_int(struct prng *gen)
177 + {
178 + int h,p1,p5;
179 + struct mrg_state *g;
180 +@@ -312,7 +312,7 @@
181 + * gen: Pointer to a struct prng.
182 + *
183 + */
184 +-inline double prng_mrg_get_next(struct prng *gen)
185 ++double prng_mrg_get_next(struct prng *gen)
186 + {
187 + return(prng_mrg_get_next_int(gen) * 4.656612873077393e-10);
188 + }
189 +@@ -350,7 +350,7 @@
190 + * gen: Pointer to a struct prng.
191 + *
192 + */
193 +-inline prng_num prng_cmrg_get_next_int(struct prng *gen)
194 ++prng_num prng_cmrg_get_next_int(struct prng *gen)
195 + {
196 + int h, p12, p13, p21, p23;
197 + struct cmrg_state *g;
198 +@@ -385,7 +385,7 @@
199 + * gen: Pointer to a struct prng.
200 + *
201 + */
202 +-inline double prng_cmrg_get_next(struct prng *gen)
203 ++double prng_cmrg_get_next(struct prng *gen)
204 + {
205 + return(prng_cmrg_get_next_int(gen) * 4.656612873077393e-10);
206 + }
207 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/file.c prng-3.0.2/src/file.c
208 +--- prng-3.0.2.orig/src/file.c 2001-11-06 22:36:54.000000000 +0300
209 ++++ prng-3.0.2/src/file.c 2021-05-19 00:41:03.404665858 +0300
210 +@@ -88,7 +88,7 @@
211 + * gen: Pointer to a struct prng.
212 + *
213 + */
214 +-inline double prng_afile_get_next(struct prng *gen)
215 ++double prng_afile_get_next(struct prng *gen)
216 + {
217 + double d;
218 + char line[64];
219 +@@ -135,7 +135,7 @@
220 + * gen: Pointer to a struct prng.
221 + *
222 + */
223 +-inline double prng_bfile_get_next(struct prng *gen)
224 ++double prng_bfile_get_next(struct prng *gen)
225 + {
226 + prng_num n;
227 +
228 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/icg.c prng-3.0.2/src/icg.c
229 +--- prng-3.0.2.orig/src/icg.c 2001-11-06 22:37:07.000000000 +0300
230 ++++ prng-3.0.2/src/icg.c 2021-05-19 00:41:03.407665870 +0300
231 +@@ -110,7 +110,7 @@
232 + * gen: Pointer to a struct prng.
233 + *
234 + */
235 +-inline prng_num prng_icg_get_next_int(struct prng *gen)
236 ++prng_num prng_icg_get_next_int(struct prng *gen)
237 + {
238 + s_prng_num inv, current, prod;
239 +
240 +@@ -135,7 +135,7 @@
241 + * gen: Pointer to a struct prng.
242 + *
243 + */
244 +-inline double prng_icg_get_next(struct prng *gen)
245 ++double prng_icg_get_next(struct prng *gen)
246 + {
247 + return(prng_icg_get_next_int(gen) * gen->data.icg_data.inv_p);
248 + }
249 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/lcg.c prng-3.0.2/src/lcg.c
250 +--- prng-3.0.2.orig/src/lcg.c 2001-11-06 22:37:29.000000000 +0300
251 ++++ prng-3.0.2/src/lcg.c 2021-05-19 00:41:03.394665821 +0300
252 +@@ -111,7 +111,7 @@
253 + * gen: Pointer to a struct prng.
254 + *
255 + */
256 +-inline prng_num prng_lcg_get_next_int(struct prng *gen)
257 ++prng_num prng_lcg_get_next_int(struct prng *gen)
258 + {
259 + s_prng_num ax, current;
260 +
261 +@@ -130,7 +130,7 @@
262 + * gen: Pointer to a struct prng.
263 + *
264 + */
265 +-inline double prng_lcg_get_next(struct prng *gen)
266 ++double prng_lcg_get_next(struct prng *gen)
267 + {
268 + return(prng_lcg_get_next_int(gen) * gen->data.lcg_data.inv_p);
269 + }
270 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/meicg.c prng-3.0.2/src/meicg.c
271 +--- prng-3.0.2.orig/src/meicg.c 2001-11-06 22:37:40.000000000 +0300
272 ++++ prng-3.0.2/src/meicg.c 2021-05-19 00:41:03.396665828 +0300
273 +@@ -106,7 +106,7 @@
274 + * gen: Pointer to a struct prng.
275 + *
276 + */
277 +-inline prng_num prng_meicg_get_next_int(struct prng *gen)
278 ++prng_num prng_meicg_get_next_int(struct prng *gen)
279 + {
280 + s_prng_num an, sum, inv, n;
281 +
282 +@@ -144,7 +144,7 @@
283 + * gen: Pointer to a struct prng.
284 + *
285 + */
286 +-inline double prng_meicg_get_next(struct prng *gen)
287 ++double prng_meicg_get_next(struct prng *gen)
288 + {
289 + return(prng_meicg_get_next_int(gen) * gen->data.meicg_data.inv_p);
290 + }
291 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/mt19937.c prng-3.0.2/src/mt19937.c
292 +--- prng-3.0.2.orig/src/mt19937.c 2001-11-06 22:38:08.000000000 +0300
293 ++++ prng-3.0.2/src/mt19937.c 2021-05-19 00:45:22.720661481 +0300
294 +@@ -137,7 +137,7 @@
295 + * seed: used for initializing array
296 + *
297 + */
298 +-inline void prng_mt19937_seed( struct prng *gen, prng_num seed )
299 ++void prng_mt19937_seed( struct prng *gen, prng_num seed )
300 + {
301 + int i;
302 +
303 +@@ -172,7 +172,7 @@
304 + * gen: Pointer to a struct prng.
305 + *
306 + */
307 +-inline prng_num prng_mt19937_get_next_int(struct prng *gen)
308 ++prng_num prng_mt19937_get_next_int(struct prng *gen)
309 + {
310 + #define MT gen->data.mt19937_data.mt
311 + #define MTI gen->data.mt19937_data.mti
312 +@@ -220,7 +220,7 @@
313 + * gen: Pointer to a struct prng.
314 + *
315 + */
316 +-inline double prng_mt19937_get_next(struct prng *gen)
317 ++double prng_mt19937_get_next(struct prng *gen)
318 + {
319 + /* reals: [0,1)-interval */
320 + /* multiply with 1. / 2^32 */
321 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/prng.h prng-3.0.2/src/prng.h
322 +--- prng-3.0.2.orig/src/prng.h 2001-11-06 23:04:41.000000000 +0300
323 ++++ prng-3.0.2/src/prng.h 2021-05-19 00:40:49.381612020 +0300
324 +@@ -406,7 +406,7 @@
325 + /* INLINE fnk def. for mult_mod, I don't know if this works for non-GCC */
326 +
327 + #ifdef __GNUC__
328 +-extern __inline__ prng_num mult_mod(prng_num s,struct mult_mod_struct *mm)
329 ++static inline prng_num mult_mod(prng_num s,struct mult_mod_struct *mm)
330 + {
331 + s_prng_num s_tmp;
332 +
333 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/qcg.c prng-3.0.2/src/qcg.c
334 +--- prng-3.0.2.orig/src/qcg.c 2001-11-06 22:39:13.000000000 +0300
335 ++++ prng-3.0.2/src/qcg.c 2021-05-19 00:41:03.403665855 +0300
336 +@@ -107,7 +107,7 @@
337 + * gen: Pointer to a struct prng.
338 + *
339 + */
340 +-inline prng_num prng_qcg_get_next_int(struct prng *gen)
341 ++prng_num prng_qcg_get_next_int(struct prng *gen)
342 + {
343 + s_prng_num current, sum, square, q_term, l_term;
344 +
345 +@@ -150,7 +150,7 @@
346 + * gen: Pointer to a struct prng.
347 + *
348 + */
349 +-inline double prng_qcg_get_next(struct prng *gen)
350 ++double prng_qcg_get_next(struct prng *gen)
351 + {
352 + return(prng_qcg_get_next_int(gen) * gen->data.qcg_data.inv_p);
353 + }
354 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/sub.c prng-3.0.2/src/sub.c
355 +--- prng-3.0.2.orig/src/sub.c 2001-11-06 22:39:06.000000000 +0300
356 ++++ prng-3.0.2/src/sub.c 2021-05-19 00:41:03.402665851 +0300
357 +@@ -89,7 +89,7 @@
358 + * gen: Pointer to a struct prng.
359 + *
360 + */
361 +-inline double prng_sub_get_next(struct prng *gen)
362 ++double prng_sub_get_next(struct prng *gen)
363 + {
364 + prng_num j;
365 + double tmp;
366 +@@ -127,7 +127,7 @@
367 + * gen: Pointer to a struct prng.
368 + *
369 + */
370 +-inline prng_num prng_sub_get_next_int(struct prng *gen)
371 ++prng_num prng_sub_get_next_int(struct prng *gen)
372 + {
373 + prng_num j,tmp;
374 +
375 +diff '--color=auto' -Naurd prng-3.0.2.orig/src/support.c prng-3.0.2/src/support.c
376 +--- prng-3.0.2.orig/src/support.c 2001-11-06 23:03:26.000000000 +0300
377 ++++ prng-3.0.2/src/support.c 2021-05-19 00:40:49.381612020 +0300
378 +@@ -449,52 +449,6 @@
379 + }
380 + }
381 +
382 +-#ifndef __cplusplus
383 +-/*
384 +- * Modular Multiplication. Uses the precalculated values from mult_mod_setup.
385 +- *
386 +- *
387 +- * Input:
388 +- * s An prng_num.
389 +- * mm pointer to a struct mult_mod_struct initialized
390 +- * by mult_mod_setup.
391 +- *
392 +- * Output:
393 +- * (mm->a*s) mod mm->p
394 +- *
395 +- */
396 +-prng_num mult_mod(prng_num s,struct mult_mod_struct *mm)
397 +-{
398 +-s_prng_num s_tmp;
399 +-
400 +-switch(mm->algorithm)
401 +- {
402 +- case PRNG_MM_ZERO: return(0);
403 +- break;
404 +- case PRNG_MM_ONE: return(s);
405 +- break;
406 +- case PRNG_MM_SIMPLE: return((s * mm->a) % mm->p );
407 +- break;
408 +- case PRNG_MM_SCHRAGE:
409 +- s_tmp = mm->a * ( s % mm->q ) -
410 +- mm->r * ( s / mm->q );
411 +- if (s_tmp < 0) s_tmp += mm->p;
412 +- return(s_tmp);
413 +- break;
414 +- case PRNG_MM_DECOMP: return(mult_mod_generic(s,mm->a,mm->p));
415 +- break;
416 +-#ifdef HAVE_LONGLONG
417 +- case PRNG_MM_LL: return(mult_mod_ll(s,mm->a,mm->p));
418 +- break;
419 +-#endif
420 +- case PRNG_MM_POW2: return((s*mm->a) & mm->mask);
421 +- break;
422 +- }
423 +-/* not reached */
424 +-return(0);
425 +-}
426 +-#endif
427 +-
428 +
429 + /*
430 + * Modular Multiplication: Decomposition method (from L'Ecuyer & Cote)
431
432 diff --git a/sci-mathematics/prng/prng-3.0.2-r3.ebuild b/sci-mathematics/prng/prng-3.0.2-r3.ebuild
433 new file mode 100644
434 index 00000000000..e4cc42dcc3e
435 --- /dev/null
436 +++ b/sci-mathematics/prng/prng-3.0.2-r3.ebuild
437 @@ -0,0 +1,44 @@
438 +# Copyright 1999-2021 Gentoo Authors
439 +# Distributed under the terms of the GNU General Public License v2
440 +
441 +EAPI=7
442 +
443 +inherit autotools flag-o-matic
444 +
445 +DESCRIPTION="Pseudo-Random Number Generator library"
446 +HOMEPAGE="http://statmath.wu.ac.at/prng/"
447 +SRC_URI="http://statmath.wu.ac.at/prng/${P}.tar.gz"
448 +
449 +LICENSE="GPL-2"
450 +SLOT=0
451 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
452 +IUSE="doc examples static-libs"
453 +
454 +PATCHES=(
455 + "${FILESDIR}"/${PN}-3.0.2-shared.patch
456 + "${FILESDIR}"/${PN}-3.0.2-fix-all-c99-inline-semantics.patch
457 +)
458 +
459 +src_prepare() {
460 + default
461 + eautoreconf
462 +}
463 +
464 +src_configure() {
465 + # bug 705318
466 + append-cflags -fvisibility-inlines-hidden
467 + econf $(use_enable static-libs static)
468 +}
469 +
470 +src_install() {
471 + default
472 + use doc && dodoc doc/${PN}.pdf
473 + if use examples; then
474 + rm examples/Makefile* || die
475 + dodoc -r examples
476 + docompress -x /usr/share/doc/${PF}/examples
477 + fi
478 + if ! use static-libs; then
479 + find "${D}" -name '*.la' -delete || die
480 + fi
481 +}