Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: dev-lang/perl/files/, dev-lang/perl/files/5.26/, dev-lang/perl/
Date: Sat, 13 Apr 2019 18:59:41
Message-Id: 1555181954.2c48ef728b4b3f91dec374f6554a6d426623aacb.anarchy@gentoo
1 commit: 2c48ef728b4b3f91dec374f6554a6d426623aacb
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 13 18:58:56 2019 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 13 18:59:14 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=2c48ef72
7
8 dev-lang/perl: Security bump, musl fixes for 5.26.x branch
9
10 Package-Manager: Portage-2.3.62, Repoman-2.3.12
11 Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
12
13 dev-lang/perl/Manifest | 3 +
14 dev-lang/perl/files/5.26/perl-5.26.3-part1.patch | 75 +++
15 dev-lang/perl/files/5.26/perl-5.26.3-part2.patch | 27 +
16 dev-lang/perl/files/5.26/perl-5.26.3-part3.patch | 88 +++
17 dev-lang/perl/files/5.26/perl-5.26.3-part4.patch | 103 ++++
18 dev-lang/perl/files/5.26/perl-5.26.3-part5.patch | 35 ++
19 dev-lang/perl/files/perl-5.26.2-hppa.patch | 105 ++++
20 dev-lang/perl/metadata.xml | 14 +
21 dev-lang/perl/perl-5.26.3.ebuild | 649 +++++++++++++++++++++++
22 9 files changed, 1099 insertions(+)
23
24 diff --git a/dev-lang/perl/Manifest b/dev-lang/perl/Manifest
25 new file mode 100644
26 index 0000000..ad86139
27 --- /dev/null
28 +++ b/dev-lang/perl/Manifest
29 @@ -0,0 +1,3 @@
30 +DIST perl-5.26.2-patches-1.tar.xz 17100 BLAKE2B 681239e438945285e006ee1d1e2a9eb888fc9b425e6fbd4822e65e1fe1ced2216de76485b9792d3fee28783a588c09e1d34c294ef43d81055c4566af37fe9b6c SHA512 2a274150d2dba406c6efb67ec236f67032a51ff1788b30ea556e74b2f02fab68f5029ebd4b9d4daeb16b3a63fa7aa1744d323bf637a9d21946f19f33b69da245
31 +DIST perl-5.26.3.tar.xz 11957032 BLAKE2B 3cd5332a0bede16608b1626b0b9903d71105784411c7acf2fd8c0e7637a2ab5049e650bdaba574584ed51a70cc21dfbee5557963717d52c4af9c8bd8e8ef80a1 SHA512 1126ead4f9cc313548e875b6dc9cd1f56f6fef4406f3fd1c108c5cad0db92c8cd0f9bde5b82d78d8f2bd67709c438e87dd45f26b98f327ba31b05b39acc3b299
32 +DIST perl-cross-1.1.9.tar.gz 102939 BLAKE2B 438ea75a14c4d60fdf3cb2f3671c736d229a83af210ba4fe6e79b989c6c4b45500d0221ec65bc71e1d43d234ec1daa20b3a19be6ceb01e638810900dbe3664a7 SHA512 002441012bd31f1ea71341707d91f89b76266c187c9d28f947ed5eddbcc6e3155e8dfd4b1814331561c3557764fea25bf6a938f08bcd4adfb5895361ad5a269a
33
34 diff --git a/dev-lang/perl/files/5.26/perl-5.26.3-part1.patch b/dev-lang/perl/files/5.26/perl-5.26.3-part1.patch
35 new file mode 100644
36 index 0000000..5ac0e85
37 --- /dev/null
38 +++ b/dev-lang/perl/files/5.26/perl-5.26.3-part1.patch
39 @@ -0,0 +1,75 @@
40 +From ca152fd8207cf53816b1407d5f54f6ea160a3ef8 Mon Sep 17 00:00:00 2001
41 +From: Andy Dougherty <doughera@×××××××××.edu>
42 +Date: Tue, 22 Jan 2019 14:17:05 -0500
43 +Subject: [PATCH] Improve Configure detection of memmem() [perl #133760].
44 +
45 +Linux systems have memmem, but the header prototype is only visible if
46 +the C library, but didn't check if the correct prototype is available.
47 +This patch compiles & runs a test program that will fail if the prototype
48 +is needed but not available.
49 +
50 +This does not completely close [perl #133760]. The tests for strlcat()
51 +and strlcpy() may also need to be similarly changed. Also, this patch
52 +does not change whether _GNU_SOURCE is defined or not. Presumably that
53 +would be done separately in the linux hints file.
54 +---
55 + Configure | 43 +++++++++++++++++++++++++++++++++++++++++--
56 + 1 file changed, 41 insertions(+), 2 deletions(-)
57 +
58 +diff --git a/Configure b/Configure
59 +index 6041b0bbb0..a83cbdf2f8 100755
60 +--- a/Configure
61 ++++ b/Configure
62 +@@ -16155,8 +16155,47 @@ set mbtowc d_mbtowc
63 + eval $inlibc
64 +
65 + : see if memmem exists
66 +-set memmem d_memmem
67 +-eval $inlibc
68 ++echo " "
69 ++echo "Checking if you have a working memmem()" >&4
70 ++$cat >try.c <<EOCP
71 ++#$d_gnulibc HAS_GNULIBC /**/
72 ++#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
73 ++# define _GNU_SOURCE
74 ++#endif
75 ++#include <stdio.h>
76 ++#include <stdlib.h>
77 ++#include <stddef.h>
78 ++#include <string.h>
79 ++int main(int argc, char **argv)
80 ++{
81 ++ char *big = "abcdefghiabcdefghi";
82 ++ char *little = "def";
83 ++ char *rtn;
84 ++ ptrdiff_t diff;
85 ++ rtn = (char *) memmem(big, strlen(big), little, strlen(little));
86 ++ diff = rtn - big;
87 ++ exit(diff == 3 ? EXIT_SUCCESS : EXIT_FAILURE);
88 ++}
89 ++EOCP
90 ++set try
91 ++if eval $compile; then
92 ++ `$run ./try`
93 ++ rc=$?
94 ++ case "$rc" in
95 ++ 0) echo "Yes, you do." >&4
96 ++ val="$define"
97 ++ ;;
98 ++ *) echo "Well, you have memmem, but it isn't working." >&4
99 ++ val="$undef"
100 ++ ;;
101 ++ esac
102 ++else
103 ++ echo "No, you do not." >&4
104 ++ val="$undef"
105 ++fi
106 ++set d_memmem
107 ++eval $setvar
108 ++$rm_try
109 +
110 + : see if memrchr exists
111 + set memrchr d_memrchr
112 +--
113 +2.15.1-424-g9478a660812
114 +
115
116 diff --git a/dev-lang/perl/files/5.26/perl-5.26.3-part2.patch b/dev-lang/perl/files/5.26/perl-5.26.3-part2.patch
117 new file mode 100644
118 index 0000000..c2c49b6
119 --- /dev/null
120 +++ b/dev-lang/perl/files/5.26/perl-5.26.3-part2.patch
121 @@ -0,0 +1,27 @@
122 +From 63c1fa6a98bc60234a21de83dd191cd581a5d073 Mon Sep 17 00:00:00 2001
123 +From: Andy Dougherty <doughera@×××××××××.edu>
124 +Date: Wed, 23 Jan 2019 21:12:29 -0500
125 +Subject: [PATCH] Add ability to include literal text in the prototype check.
126 +
127 +This is the same technique as in the metaconfig unit Protochk.U.
128 +See that unit for more usage information. It is a bit clunky,
129 +but does work.
130 +---
131 + Configure | 1 +
132 + 1 file changed, 1 insertion(+)
133 +
134 +diff --git a/Configure b/Configure
135 +index a83cbdf2f8..179545727e 100755
136 +--- a/Configure
137 ++++ b/Configure
138 +@@ -10739,6 +10739,7 @@ hasproto='varname=$1; func=$2; shift; shift;
139 + while $test $# -ge 2; do
140 + case "$1" in
141 + $define) echo "#include <$2>";;
142 ++ literal) echo "$2" ;;
143 + esac ;
144 + shift 2;
145 + done > try.c;
146 +--
147 +2.15.1-424-g9478a660812
148 +
149
150 diff --git a/dev-lang/perl/files/5.26/perl-5.26.3-part3.patch b/dev-lang/perl/files/5.26/perl-5.26.3-part3.patch
151 new file mode 100644
152 index 0000000..3e31c1d
153 --- /dev/null
154 +++ b/dev-lang/perl/files/5.26/perl-5.26.3-part3.patch
155 @@ -0,0 +1,88 @@
156 +From f8d82a1010426d0eb49c33cb903413b882c85c3e Mon Sep 17 00:00:00 2001
157 +From: Andy Dougherty <doughera@×××××××××.edu>
158 +Date: Wed, 23 Jan 2019 21:39:39 -0500
159 +Subject: [PATCH] Another attempt to improve Configure detection of memmem()
160 + [perl #133760].
161 +
162 +This updates commit ca152fd8207cf53816b1407d5f54f6ea160a3ef8.
163 +Linux systems have memmem, but the prototype in <string.h> is only
164 +visible if __GNU_SOURCE is defined. This version tests for both the
165 +prototype in <string.h> and the symbol in libc. (Thanks to Tony C. for
166 +the suggestion.) (For BSD systems, no extra define is needed.)
167 +---
168 + Configure | 58 ++++++++++++++++++----------------------------------------
169 + 1 file changed, 18 insertions(+), 40 deletions(-)
170 +
171 +diff --git a/Configure b/Configure
172 +index 179545727e..ad17948a2c 100755
173 +--- a/Configure
174 ++++ b/Configure
175 +@@ -16156,47 +16156,25 @@ set mbtowc d_mbtowc
176 + eval $inlibc
177 +
178 + : see if memmem exists
179 ++: We need both a prototype in string.h and the symbol in libc.
180 + echo " "
181 +-echo "Checking if you have a working memmem()" >&4
182 +-$cat >try.c <<EOCP
183 +-#$d_gnulibc HAS_GNULIBC /**/
184 +-#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)
185 +-# define _GNU_SOURCE
186 +-#endif
187 +-#include <stdio.h>
188 +-#include <stdlib.h>
189 +-#include <stddef.h>
190 +-#include <string.h>
191 +-int main(int argc, char **argv)
192 +-{
193 +- char *big = "abcdefghiabcdefghi";
194 +- char *little = "def";
195 +- char *rtn;
196 +- ptrdiff_t diff;
197 +- rtn = (char *) memmem(big, strlen(big), little, strlen(little));
198 +- diff = rtn - big;
199 +- exit(diff == 3 ? EXIT_SUCCESS : EXIT_FAILURE);
200 +-}
201 +-EOCP
202 +-set try
203 +-if eval $compile; then
204 +- `$run ./try`
205 +- rc=$?
206 +- case "$rc" in
207 +- 0) echo "Yes, you do." >&4
208 +- val="$define"
209 +- ;;
210 +- *) echo "Well, you have memmem, but it isn't working." >&4
211 +- val="$undef"
212 +- ;;
213 +- esac
214 +-else
215 +- echo "No, you do not." >&4
216 +- val="$undef"
217 +-fi
218 +-set d_memmem
219 +-eval $setvar
220 +-$rm_try
221 ++d_memmem_proto=''
222 ++xx1="#$d_gnulibc HAS_GNULIBC"
223 ++xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
224 ++xx3='# define _GNU_SOURCE'
225 ++xx4='#endif'
226 ++set d_memmem_proto memmem literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
227 ++eval $hasproto
228 ++case "$d_memmem_proto" in
229 ++ define) # see if memmem exists
230 ++ set memmem d_memmem
231 ++ eval $inlibc
232 ++ ;;
233 ++ *) val=$undef
234 ++ set d_memmem
235 ++ eval $setvar
236 ++ ;;
237 ++esac
238 +
239 + : see if memrchr exists
240 + set memrchr d_memrchr
241 +--
242 +2.15.1-424-g9478a660812
243 +
244
245 diff --git a/dev-lang/perl/files/5.26/perl-5.26.3-part4.patch b/dev-lang/perl/files/5.26/perl-5.26.3-part4.patch
246 new file mode 100644
247 index 0000000..373d6c5
248 --- /dev/null
249 +++ b/dev-lang/perl/files/5.26/perl-5.26.3-part4.patch
250 @@ -0,0 +1,103 @@
251 +From ba73a4cb8f472480a2d630613d1e9e1172d518d3 Mon Sep 17 00:00:00 2001
252 +From: Andy Dougherty <doughera@×××××××××.edu>
253 +Date: Thu, 31 Jan 2019 13:04:32 -0500
254 +Subject: [PATCH] Improve detection of memrchr, strlcat, and strlcpy.
255 +
256 +This is continuation of commit f8d82a1010 addressing [perl #133760].
257 +Linux systems using the musl C library have memmem, memrchr, strlcat, and
258 +strlcpy, but the prototypes are only visible if _GNU_SOURCE is defined.
259 +This patch makes Configure test both whether the prototype is visible
260 +and whether the C symbol is visible.
261 +
262 +Still to be done is automatically adding _GNU_SOURCE if the musl library
263 +is being used -- probably in hints/linux.sh.
264 +---
265 + Configure | 63 +++++++++++++++++++++++++++++++++++++++++++++++++------
266 + 1 file changed, 57 insertions(+), 6 deletions(-)
267 +
268 +diff --git a/Configure b/Configure
269 +index abbfdf6..427dd9d 100755
270 +--- a/Configure
271 ++++ b/Configure
272 +@@ -16354,8 +16354,25 @@ set mbtowc d_mbtowc
273 + eval $inlibc
274 +
275 + : see if memchr exists
276 +-set memchr d_memchr
277 +-eval $inlibc
278 ++: We need both a prototype in string.h and the symbol in libc.
279 ++echo " "
280 ++d_memchr_proto=''
281 ++xx1="#$d_gnulibc HAS_GNULIBC"
282 ++xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
283 ++xx3='# define _GNU_SOURCE'
284 ++xx4='#endif'
285 ++set d_memchr_proto memchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
286 ++eval $hasproto
287 ++case "$d_memchr_proto" in
288 ++ define) # see if memchr exists
289 ++ set memchr d_memchr
290 ++ eval $inlibc
291 ++ ;;
292 ++ *) val=$undef
293 ++ set d_memchr
294 ++ eval $setvar
295 ++ ;;
296 ++esac
297 +
298 + : see if memcmp exists
299 + set memcmp d_memcmp
300 +@@ -19387,12 +19404,46 @@ set strftime d_strftime
301 + eval $inlibc
302 +
303 + : see if strlcat exists
304 +-set strlcat d_strlcat
305 +-eval $inlibc
306 ++: We need both a prototype in string.h and the symbol in libc.
307 ++echo " "
308 ++d_strlcat_proto=''
309 ++xx1="#$d_gnulibc HAS_GNULIBC"
310 ++xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
311 ++xx3='# define _GNU_SOURCE'
312 ++xx4='#endif'
313 ++set d_strlcat_proto strlcat literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
314 ++eval $hasproto
315 ++case "$d_strlcat_proto" in
316 ++ define) # see if strlcat exists
317 ++ set strlcat d_strlcat
318 ++ eval $inlibc
319 ++ ;;
320 ++ *) val=$undef
321 ++ set d_strlcat
322 ++ eval $setvar
323 ++ ;;
324 ++esac
325 +
326 + : see if strlcpy exists
327 +-set strlcpy d_strlcpy
328 +-eval $inlibc
329 ++: We need both a prototype in string.h and the symbol in libc.
330 ++echo " "
331 ++d_strlcpy_proto=''
332 ++xx1="#$d_gnulibc HAS_GNULIBC"
333 ++xx2='#if defined(HAS_GNULIBC) && !defined(_GNU_SOURCE)'
334 ++xx3='# define _GNU_SOURCE'
335 ++xx4='#endif'
336 ++set d_strlcpy_proto strlcpy literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
337 ++eval $hasproto
338 ++case "$d_strlcpy_proto" in
339 ++ define) # see if strlcpy exists
340 ++ set strlcpy d_strlcpy
341 ++ eval $inlibc
342 ++ ;;
343 ++ *) val=$undef
344 ++ set d_strlcpy
345 ++ eval $setvar
346 ++ ;;
347 ++esac
348 +
349 + : see if strtod exists
350 + set strtod d_strtod
351 +--
352 +2.21.0
353 +
354
355 diff --git a/dev-lang/perl/files/5.26/perl-5.26.3-part5.patch b/dev-lang/perl/files/5.26/perl-5.26.3-part5.patch
356 new file mode 100644
357 index 0000000..e9cac65
358 --- /dev/null
359 +++ b/dev-lang/perl/files/5.26/perl-5.26.3-part5.patch
360 @@ -0,0 +1,35 @@
361 +From 04db542212fdad3a62f13afe741c99028f4bf799 Mon Sep 17 00:00:00 2001
362 +From: Andy Dougherty <doughera@×××××××××.edu>
363 +Date: Thu, 31 Jan 2019 14:05:41 -0500
364 +Subject: [PATCH] Define _GNU_SOURCE if using the musl libc on linux.
365 +
366 +Together with prior commits ba73a4cb8f, f8d82a1010, and 63c1fa6a98,
367 +this should close [perl #133760].
368 +---
369 + hints/linux.sh | 10 ++++++++++
370 + 1 file changed, 10 insertions(+)
371 +
372 +diff --git a/hints/linux.sh b/hints/linux.sh
373 +index 3f38ea07f1..a985a8ee1b 100644
374 +--- a/hints/linux.sh
375 ++++ b/hints/linux.sh
376 +@@ -178,6 +178,16 @@ case "$plibpth" in
377 + ;;
378 + esac
379 +
380 ++# For the musl libc, perl should #define _GNU_SOURCE. Otherwise, some
381 ++# available functions, like memem, won't be used. See the discussion in
382 ++# [perl #133760]. musl doesn't offer an easy way to identify it, but,
383 ++# at least on alpine linux, the ldd --version output contains the
384 ++# string 'musl.'
385 ++case `ldd --version 2>&1` in
386 ++ musl*) ccflags="$ccflags -D_GNU_SOURCE" ;;
387 ++ *) ;;
388 ++esac
389 ++
390 + # libquadmath is sometimes installed as gcc internal library,
391 + # so contrary to our usual policy of *not* looking at gcc internal
392 + # directories we now *do* look at them, in case they contain
393 +--
394 +2.15.1-424-g9478a660812
395 +
396
397 diff --git a/dev-lang/perl/files/perl-5.26.2-hppa.patch b/dev-lang/perl/files/perl-5.26.2-hppa.patch
398 new file mode 100644
399 index 0000000..83ed944
400 --- /dev/null
401 +++ b/dev-lang/perl/files/perl-5.26.2-hppa.patch
402 @@ -0,0 +1,105 @@
403 +https://bugs.gentoo.org/634162
404 +
405 +Source:
406 +https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=869122
407 +
408 +Index: perl-5.26.0/op.c
409 +===================================================================
410 +--- perl-5.26.0.orig/op.c
411 ++++ perl-5.26.0/op.c
412 +@@ -14832,6 +14832,7 @@ Perl_custom_op_get_field(pTHX_ const OP
413 + SV *keysv;
414 + HE *he = NULL;
415 + XOP *xop;
416 ++ XOPRETANY any;
417 +
418 + static const XOP xop_null = { 0, 0, 0, 0, 0 };
419 +
420 +@@ -14874,58 +14875,37 @@ Perl_custom_op_get_field(pTHX_ const OP
421 + else
422 + xop = INT2PTR(XOP *, SvIV(HeVAL(he)));
423 + }
424 +- {
425 +- XOPRETANY any;
426 +- if(field == XOPe_xop_ptr) {
427 +- any.xop_ptr = xop;
428 +- } else {
429 +- const U32 flags = XopFLAGS(xop);
430 +- if(flags & field) {
431 +- switch(field) {
432 +- case XOPe_xop_name:
433 +- any.xop_name = xop->xop_name;
434 +- break;
435 +- case XOPe_xop_desc:
436 +- any.xop_desc = xop->xop_desc;
437 +- break;
438 +- case XOPe_xop_class:
439 +- any.xop_class = xop->xop_class;
440 +- break;
441 +- case XOPe_xop_peep:
442 +- any.xop_peep = xop->xop_peep;
443 +- break;
444 +- default:
445 +- NOT_REACHED; /* NOTREACHED */
446 +- break;
447 +- }
448 +- } else {
449 +- switch(field) {
450 +- case XOPe_xop_name:
451 +- any.xop_name = XOPd_xop_name;
452 +- break;
453 +- case XOPe_xop_desc:
454 +- any.xop_desc = XOPd_xop_desc;
455 +- break;
456 +- case XOPe_xop_class:
457 +- any.xop_class = XOPd_xop_class;
458 +- break;
459 +- case XOPe_xop_peep:
460 +- any.xop_peep = XOPd_xop_peep;
461 +- break;
462 +- default:
463 +- NOT_REACHED; /* NOTREACHED */
464 +- break;
465 +- }
466 +- }
467 ++
468 ++ if(field == XOPe_xop_ptr) {
469 ++ any.xop_ptr = xop;
470 ++ } else {
471 ++ const U32 flags = XopFLAGS(xop);
472 ++ switch(field) {
473 ++ case XOPe_xop_name:
474 ++ any.xop_name = (flags & field) ? xop->xop_name : XOPd_xop_name;
475 ++ break;
476 ++ case XOPe_xop_desc:
477 ++ any.xop_desc = (flags & field) ? xop->xop_desc : XOPd_xop_desc;
478 ++ break;
479 ++ case XOPe_xop_class:
480 ++ any.xop_class = (flags & field) ? xop->xop_class : XOPd_xop_class;
481 ++ break;
482 ++ case XOPe_xop_peep:
483 ++ any.xop_peep = (flags & field) ? xop->xop_peep : XOPd_xop_peep;
484 ++ break;
485 ++ default:
486 ++ NOT_REACHED; /* NOTREACHED */
487 ++ break;
488 + }
489 +- /* On some platforms (HP-UX, IA64) gcc emits a warning for this function:
490 +- * op.c: In function 'Perl_custom_op_get_field':
491 +- * op.c:...: warning: 'any.xop_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
492 +- * This is because on those platforms (with -DEBUGGING) NOT_REACHED
493 +- * expands to assert(0), which expands to ((0) ? (void)0 :
494 +- * __assert(...)), and gcc doesn't know that __assert can never return. */
495 +- return any;
496 + }
497 ++
498 ++ /* On some platforms (HP-UX, IA64) gcc emits a warning for this function:
499 ++ * op.c: In function 'Perl_custom_op_get_field':
500 ++ * op.c:...: warning: 'any.xop_name' may be used uninitialized in this function [-Wmaybe-uninitialized]
501 ++ * This is because on those platforms (with -DEBUGGING) NOT_REACHED
502 ++ * expands to assert(0), which expands to ((0) ? (void)0 :
503 ++ * __assert(...)), and gcc doesn't know that __assert can never return. */
504 ++ return any;
505 + }
506 +
507 + /*
508
509 diff --git a/dev-lang/perl/metadata.xml b/dev-lang/perl/metadata.xml
510 new file mode 100644
511 index 0000000..0edcddc
512 --- /dev/null
513 +++ b/dev-lang/perl/metadata.xml
514 @@ -0,0 +1,14 @@
515 +<?xml version='1.0' encoding='UTF-8'?>
516 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
517 +<pkgmetadata>
518 + <maintainer type="project">
519 + <email>perl@g.o</email>
520 + <name>Gentoo Perl Project</name>
521 + </maintainer>
522 + <use>
523 + <flag name="ithreads">Enable Perl threads, has some compatibility problems</flag>
524 + </use>
525 + <upstream>
526 + <remote-id type="github">arsv/perl-cross</remote-id>
527 + </upstream>
528 +</pkgmetadata>
529
530 diff --git a/dev-lang/perl/perl-5.26.3.ebuild b/dev-lang/perl/perl-5.26.3.ebuild
531 new file mode 100644
532 index 0000000..f7fcedb
533 --- /dev/null
534 +++ b/dev-lang/perl/perl-5.26.3.ebuild
535 @@ -0,0 +1,649 @@
536 +# Copyright 1999-2019 Gentoo Authors
537 +# Distributed under the terms of the GNU General Public License v2
538 +
539 +EAPI=6
540 +
541 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
542 +
543 +PATCH_VER=1
544 +CROSS_VER=1.1.9
545 +PATCH_BASE="perl-5.26.2-patches-${PATCH_VER}"
546 +
547 +DIST_AUTHOR=SHAY
548 +
549 +# Greatest first, don't include yourself
550 +# Devel point-releases are not ABI-intercompatible, but stable point releases are
551 +# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
552 +PERL_BIN_OLDVERSEN="5.26.1 5.26.0"
553 +if [[ "${PV##*.}" == "9999" ]]; then
554 + DIST_VERSION=5.26.2
555 +else
556 + DIST_VERSION="${PV/_rc/-RC}"
557 +fi
558 +SHORT_PV="${DIST_VERSION%.*}"
559 +# Even numbered major versions are ABI intercompatible
560 +# Odd numbered major versions are not
561 +if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
562 + SUBSLOT="${DIST_VERSION%-RC*}"
563 +else
564 + SUBSLOT="${DIST_VERSION%.*}"
565 +fi
566 +# Used only in tar paths
567 +MY_P="perl-${DIST_VERSION}"
568 +# Used in library paths
569 +MY_PV="${DIST_VERSION%-RC*}"
570 +
571 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
572 +
573 +SRC_URI="
574 + mirror://cpan/src/5.0/${MY_P}.tar.xz
575 + mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
576 + https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz
577 + mirror://gentoo/${PATCH_BASE}.tar.xz
578 + https://dev.gentoo.org/~kentnl/distfiles/${PATCH_BASE}.tar.xz
579 + https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
580 +"
581 +HOMEPAGE="https://www.perl.org/"
582 +
583 +LICENSE="|| ( Artistic GPL-1+ )"
584 +SLOT="0/${SUBSLOT}"
585 +
586 +if [[ "${PV##*.}" != "9999" ]]; then
587 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
588 +fi
589 +
590 +IUSE="berkdb debug doc gdbm ithreads"
591 +
592 +RDEPEND="
593 + berkdb? ( sys-libs/db:= )
594 + gdbm? ( >=sys-libs/gdbm-1.8.3:= )
595 + app-arch/bzip2
596 + sys-libs/zlib
597 +"
598 +DEPEND="${RDEPEND}
599 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
600 +"
601 +PDEPEND="
602 + >=app-admin/perl-cleaner-2.5
603 + >=virtual/perl-File-Temp-0.230.400-r2
604 + >=virtual/perl-Data-Dumper-2.154.0
605 + virtual/perl-Test-Harness
606 +"
607 +# bug 390719, bug 523624
608 +# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
609 +
610 +S="${WORKDIR}/${MY_P}"
611 +
612 +dual_scripts() {
613 + src_remove_dual perl-core/Archive-Tar 2.240.0 ptar ptardiff ptargrep
614 + src_remove_dual perl-core/CPAN 2.180.0 cpan
615 + src_remove_dual perl-core/Digest-SHA 5.960.0 shasum
616 + src_remove_dual perl-core/Encode 2.880.0 enc2xs piconv
617 + src_remove_dual perl-core/ExtUtils-MakeMaker 7.240.0 instmodsh
618 + src_remove_dual perl-core/ExtUtils-ParseXS 3.340.0 xsubpp
619 + src_remove_dual perl-core/IO-Compress 2.74.0 zipdetails
620 + src_remove_dual perl-core/JSON-PP 2.274.0.200_rc json_pp
621 + src_remove_dual perl-core/Module-CoreList 5.201.804.142.600_rc corelist
622 + src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect
623 + src_remove_dual perl-core/Pod-Perldoc 3.280.0 perldoc
624 + src_remove_dual perl-core/Test-Harness 3.380.0 prove
625 + src_remove_dual perl-core/podlators 4.90.0 pod2man pod2text
626 + src_remove_dual_man perl-core/podlators 4.90.0 /usr/share/man/man1/perlpodstyle.1
627 +}
628 +
629 +check_rebuild() {
630 + # Fresh install
631 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
632 + return 0;
633 + # Major Upgrade
634 + # doesn't matter if there's multiple copies, it still needs a rebuild
635 + # if the string is anything other than "5.CURRENTMAJOR"
636 + elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
637 + echo ""
638 + ewarn "UPDATE THE PERL MODULES:"
639 + ewarn "After updating dev-lang/perl the installed Perl modules"
640 + ewarn "have to be re-installed. In most cases, this is done automatically"
641 + ewarn "by the package manager, but subsequent steps are still recommended"
642 + ewarn "to ensure system consistency."
643 + ewarn
644 + ewarn "You should start with a depclean to remove any unused perl dependencies"
645 + ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
646 + ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
647 + ewarn "Recommended: emerge --depclean -va"
648 + ewarn
649 + ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
650 + ewarn "remaining rebuilds portage may have missed."
651 + ewarn "Use: perl-cleaner --all"
652 + return 0;
653 +
654 + # Reinstall w/ USE Change
655 + elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
656 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
657 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
658 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
659 + echo ""
660 + ewarn "TOGGLED USE-FLAGS WARNING:"
661 + ewarn "You changed one of the use-flags ithreads or debug."
662 + ewarn "You must rebuild all perl-modules installed."
663 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
664 + fi
665 +}
666 +
667 +pkg_setup() {
668 + case ${CHOST} in
669 + *-freebsd*) osname="freebsd" ;;
670 + *-dragonfly*) osname="dragonfly" ;;
671 + *-netbsd*) osname="netbsd" ;;
672 + *-openbsd*) osname="openbsd" ;;
673 + *-darwin*) osname="darwin" ;;
674 + *-interix*) osname="interix" ;;
675 + *-aix*) osname="aix" ;;
676 + *-cygwin*) osname="cygwin" ;;
677 + *) osname="linux" ;;
678 + esac
679 +
680 + myarch="${CHOST%%-*}-${osname}"
681 + if use debug ; then
682 + myarch+="-debug"
683 + fi
684 + if use ithreads ; then
685 + mythreading="-multi"
686 + myarch+="-thread"
687 + fi
688 +
689 + PRIV_BASE="/usr/$(get_libdir)/perl5"
690 + SITE_BASE="/usr/local/$(get_libdir)/perl5"
691 + VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl"
692 +
693 + LIBPERL="libperl$(get_libname ${MY_PV} )"
694 + PRIV_LIB="${PRIV_BASE}/${MY_PV}"
695 + ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}"
696 + SITE_LIB="${SITE_BASE}/${MY_PV}"
697 + SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}"
698 + VENDOR_LIB="${VENDOR_BASE}/${MY_PV}"
699 + VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}"
700 +
701 + dual_scripts
702 +}
703 +
704 +src_remove_dual_file() {
705 + local i pkg ver
706 + pkg="$1"
707 + ver="$2"
708 + shift 2
709 + case "${EBUILD_PHASE:-none}" in
710 + postinst|postrm)
711 + for i in "$@" ; do
712 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
713 + done
714 + ;;
715 + setup)
716 + for i in "$@" ; do
717 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
718 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
719 + break
720 + fi
721 + done
722 + ;;
723 + install)
724 + for i in "$@" ; do
725 + if ! [[ -f "${ED}"${i} ]] ; then
726 + ewarn "${i} does not exist!"
727 + continue
728 + fi
729 + mv "${ED}"${i}{,-${ver}-${P}} || die
730 + done
731 + ;;
732 + esac
733 +}
734 +
735 +src_remove_dual_man() {
736 + local i pkg ver ff
737 + pkg="$1"
738 + ver="$2"
739 + shift 2
740 + case "${EBUILD_PHASE:-none}" in
741 + postinst|postrm)
742 + for i in "$@" ; do
743 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
744 + ff=${ff##*${i#${i%.[0-9]}}}
745 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
746 + done
747 + ;;
748 + install)
749 + for i in "$@" ; do
750 + if ! [[ -f "${ED}"${i} ]] ; then
751 + ewarn "${i} does not exist!"
752 + continue
753 + fi
754 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
755 + done
756 + ;;
757 + esac
758 +}
759 +
760 +src_remove_dual() {
761 + local i pkg ver
762 + pkg="$1"
763 + ver="$2"
764 + shift 2
765 + for i in "$@" ; do
766 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
767 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
768 + done
769 +}
770 +
771 +src_prepare_update_patchlevel_h() {
772 + # Copied and modified from debian:
773 + # Copyright 2011 Niko Tyni
774 + # This program is free software; you can redistribute it and/or modify
775 + # it under the same terms as Perl itself.
776 + local patchdir="${WORKDIR}/patches"
777 + local prefix
778 + local patchoutput="patchlevel-gentoo.h"
779 +
780 + [[ -f ${patchdir}/series ]] || return 0
781 +
782 +while read patch
783 +do
784 + patchname=$(echo $patch | sed 's/\.diff$//')
785 + < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e '
786 +
787 + # massage the patch headers
788 + s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend;
789 + s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend;
790 + s|^Bug-Gentoo: ||; tprepend;
791 + s/^\(Subject\|Description\): //; tappend;
792 + s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend;
793 +
794 + # post-process at the end of input
795 + $ { x;
796 + # include the version number in the patchlevel.h description (if available)
797 + s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/;
798 +
799 + # escape any backslashes and double quotes
800 + s|\\|\\\\|g; s|"|\\"|g;
801 +
802 + # add a prefix
803 + s|^|\t,"'"$prefix$patchname"' - |;
804 + # newlines away
805 + s/\n/ /g; s/ */ /g;
806 + # add a suffix
807 + s/ *$/"/; p
808 + };
809 + # stop all processing
810 + d;
811 + # label: append to the hold space
812 + :append H; d;
813 + # label: prepend to the hold space
814 + :prepend x; H; d;
815 + '
816 +done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}"
817 +echo "${patchoutput}" >> "${S}/MANIFEST"
818 +}
819 +
820 +src_prepare_perlcross() {
821 + cp -a ../perl-cross-${CROSS_VER}/* . || die
822 +
823 + sed -i \
824 + -e 's/MakeMaker\.pm .*/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1/' \
825 + -e 's/MM_Unix\.pm .*/MM_Unix.pm b0ec308fe2d7dcfcef5732880db0fae1f4ea80fa/' \
826 + cnf/diffs/perl5-${PV}/customized.patch || die
827 +
828 + sed -i \
829 + -e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \
830 + Makefile || die
831 +
832 + # bug 604072
833 + MAKEOPTS+=" -j1"
834 + export MAKEOPTS
835 +}
836 +src_prepare_dynamic() {
837 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
838 + ln -s ${LIBPERL} libperl$(get_libname ) || die
839 +}
840 +
841 +src_prepare() {
842 + local patch
843 + EPATCH_OPTS+=" -p1"
844 +
845 + if use hppa ; then
846 + epatch "${FILESDIR}/${PN}-5.26.2-hppa.patch" # bug 634162
847 + fi
848 +
849 + if [[ ${CHOST} == *-solaris* ]] ; then
850 + # do NOT mess with nsl, on Solaris this is always necessary,
851 + # when -lsocket is used e.g. to get h_errno
852 + sed -i '/gentoo\/no-nsl\.patch/d' "${WORKDIR}/patches/series" || die "Can't exclude libnsl patch"
853 + fi
854 +
855 + einfo "Applying patches from ${PATCH_BASE} ..."
856 + while read patch ; do
857 + EPATCH_SINGLE_MSG=" ${patch} ..."
858 + epatch "${WORKDIR}"/patches/${patch}
859 + done < "${WORKDIR}"/patches/series
860 +
861 + # Fix musl issues
862 + eapply "${FILESDIR}"/5.26/${PN}-5.26.3-part{1,2,3,4,5}.patch
863 +
864 + src_prepare_update_patchlevel_h
865 +
866 + tc-is-cross-compiler && src_prepare_perlcross
867 +
868 + tc-is-static-only || src_prepare_dynamic
869 +
870 + if use gdbm; then
871 + sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \
872 + ext/NDBM_File/Makefile.PL || die
873 + fi
874 +
875 + # Use errno.h from prefix rather than from host system, bug #645804
876 + if use prefix && [[ -e "${EPREFIX}"/usr/include/errno.h ]] ; then
877 + sed -i "/my..sysroot/s:'':'${EPREFIX}':" ext/Errno/Errno_pm.PL || die
878 + fi
879 +
880 + default
881 +}
882 +
883 +myconf() {
884 + # the myconf array is declared in src_configure
885 + myconf=( "${myconf[@]}" "$@" )
886 +}
887 +
888 +src_configure() {
889 + declare -a myconf
890 +
891 + export LC_ALL="C"
892 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
893 +
894 + # some arches and -O do not mix :)
895 + use ppc && replace-flags -O? -O1
896 +
897 + # Perl has problems compiling with -Os in your flags with glibc
898 + use elibc_uclibc || replace-flags "-Os" "-O2"
899 +
900 + # xlocale.h is going away in glibc-2.26, so it's counterproductive
901 + # if we use it and include it in CORE/perl.h ... Perl builds just
902 + # fine with glibc and locale.h only.
903 + # However, the darwin prefix people have no locale.h ...
904 + use elibc_glibc && myconf -Ui_xlocale
905 +
906 + # This flag makes compiling crash in interesting ways
907 + filter-flags "-malign-double"
908 +
909 + # Fixes bug #97645
910 + use ppc && filter-flags "-mpowerpc-gpopt"
911 +
912 + # Fixes bug #143895 on gcc-4.1.1
913 + filter-flags "-fsched2-use-superblocks"
914 +
915 + use sparc && myconf -Ud_longdbl
916 +
917 + export BUILD_BZIP2=0
918 + export BZIP2_INCLUDE=${EROOT}/usr/include
919 + export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
920 +
921 + export BUILD_ZLIB=False
922 + export ZLIB_INCLUDE=${EROOT}/usr/include
923 + export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
924 +
925 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
926 + myndbm='U'
927 + mygdbm='U'
928 + mydb='U'
929 + if use gdbm ; then
930 + mygdbm='D'
931 + if use berkdb ; then
932 + myndbm='D'
933 + fi
934 + fi
935 + if use berkdb ; then
936 + mydb='D'
937 + has_version '=sys-libs/db-1*' && myndbm='D'
938 + fi
939 +
940 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
941 +
942 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
943 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
944 + myconf -Ui_db -Ui_ndbm
945 + fi
946 +
947 + use ithreads && myconf -Dusethreads
948 +
949 + if use debug ; then
950 + append-cflags "-g"
951 + myconf -DDEBUGGING
952 + elif [[ ${CFLAGS} == *-g* ]] ; then
953 + myconf -DDEBUGGING=-g
954 + else
955 + myconf -DDEBUGGING=none
956 + fi
957 +
958 + # Autodiscover all old version directories, some of them will even be newer
959 + # if you downgrade
960 + if [[ -z ${PERL_OLDVERSEN} ]]; then
961 + PERL_OLDVERSEN="$(
962 + find "${EROOT%/}${PRIV_BASE}" "${EROOT%/}${SITE_BASE}" "${EROOT%/}${VENDOR_BASE}" \
963 + -maxdepth 1 -mindepth 1 -type d -regex '.*/5[.][0-9]+[.][0-9]+$' \
964 + -printf "%f " 2>/dev/null )"
965 + fi
966 + # Fixup versions, removing self match, fixing order and dupes
967 + PERL_OLDVERSEN="$(
968 + echo "${PERL_OLDVERSEN}" |\
969 + tr " " "\n" |\
970 + grep -vF "${DIST_VERSION%-RC}" |\
971 + sort -u -nr -t'.' -k1,1 -k2,2 -k3,3
972 + )"
973 +
974 + # Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string
975 + if [[ -n "${PERL_OLDVERSEN// }" ]]; then
976 + local inclist="$(
977 + for v in ${PERL_OLDVERSEN}; do
978 + has "${v}" ${PERL_BIN_OLDVERSEN} && echo -n "${v}/${myarch}${mythreading} ";
979 + echo -n "${v} ";
980 + done )"
981 + einfo "This version of perl may partially support modules previously"
982 + einfo "installed in any of the following paths:"
983 + for incpath in ${inclist}; do
984 + [[ -e "${EROOT%/}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${VENDOR_BASE}/${incpath}"
985 + [[ -e "${EROOT%/}${PRIV_BASE}/${incpath}" ]] && einfo " ${EROO%/T}${PRIV_BASE}/${incpath}"
986 + [[ -e "${EROOT%/}${SITE_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${SITE_BASE}/${incpath}"
987 + done
988 + einfo "This is a temporary measure and you should aim to cleanup these paths"
989 + einfo "via world updates and perl-cleaner"
990 + myconf -Dinc_version_list="${inclist}"
991 + fi
992 +
993 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
994 +
995 + # Make sure we can do the final link #523730, need to set deployment
996 + # target to override hardcoded 10.3 which breaks on modern OSX
997 + [[ ${CHOST} == *-darwin* ]] && \
998 + myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
999 +
1000 + # Older macOS with non-Apple GCC chokes on inline in system headers
1001 + # using c89 mode as injected by cflags.SH
1002 + [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
1003 + append-cflags -Dinline=__inline__
1004 +
1005 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
1006 + # Prefix itself we don't do multilib either, so make sure perl can find
1007 + # something compatible.
1008 + if use prefix ; then
1009 + # Set a hook to check for each detected library whether it actually works.
1010 + export libscheck="
1011 + ( echo 'main(){}' > '${T}'/conftest.c &&
1012 + $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
1013 + ) || xxx=/dev/null"
1014 +
1015 + # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
1016 + local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
1017 + myconf "-Dlibpth="${EPREFIX}"/$(get_libdir) "${EPREFIX}"/usr/$(get_libdir) ${paths}"
1018 + elif [[ $(get_libdir) != "lib" ]] ; then
1019 + # We need to use " and not ', as the written config.sh use ' ...
1020 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
1021 + fi
1022 +
1023 + # don't try building ODBM, bug #354453
1024 + disabled_extensions="ODBM_File"
1025 +
1026 + if ! use gdbm ; then
1027 + # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
1028 + disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
1029 + fi
1030 +
1031 + myconf -Dnoextensions="${disabled_extensions}"
1032 +
1033 + [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
1034 +
1035 + [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
1036 + # allow fiddling via EXTRA_ECONF, bug 558070
1037 + eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
1038 +
1039 + myconf \
1040 + -Duseshrplib \
1041 + -Darchname="${myarch}" \
1042 + -Dcc="$(tc-getCC)" \
1043 + -Doptimize="${CFLAGS}" \
1044 + -Dldflags="${LDFLAGS}" \
1045 + -Dprefix="${EPREFIX}"'/usr' \
1046 + -Dsiteprefix="${EPREFIX}"'/usr/local' \
1047 + -Dvendorprefix="${EPREFIX}"'/usr' \
1048 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
1049 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
1050 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
1051 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
1052 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
1053 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
1054 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
1055 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
1056 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
1057 + -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
1058 + -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
1059 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
1060 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
1061 + -Dman1ext='1' \
1062 + -Dman3ext='3pm' \
1063 + -Dlibperl="${LIBPERL}" \
1064 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
1065 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
1066 + -Duselargefiles \
1067 + -Dd_semctl_semun \
1068 + -Dcf_by='Gentoo' \
1069 + -Dmyhostname='localhost' \
1070 + -Dperladmin='root@localhost' \
1071 + -Ud_csh \
1072 + -Dsh="${EPREFIX}"/bin/sh \
1073 + -Dtargetsh="${EPREFIX}"/bin/sh \
1074 + -Uusenm \
1075 + "${myconf[@]}" \
1076 + "${EXTRA_ECONF[@]}"
1077 +
1078 + if tc-is-cross-compiler; then
1079 + ./configure \
1080 + --target="${CHOST}" \
1081 + --build="${CBUILD}" \
1082 + -Dinstallprefix='' \
1083 + -Dinstallusrbinperl='undef' \
1084 + -Dusevendorprefix='define' \
1085 + "${myconf[@]}" \
1086 + || die "Unable to configure"
1087 + else
1088 + sh Configure \
1089 + -des \
1090 + -Dinstallprefix="${EPREFIX}"'/usr' \
1091 + -Dinstallusrbinperl='n' \
1092 + "${myconf[@]}" \
1093 + || die "Unable to configure"
1094 + fi
1095 +}
1096 +
1097 +src_test() {
1098 + export NO_GENTOO_NETWORK_TESTS=1;
1099 + if [[ ${EUID} == 0 ]] ; then
1100 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
1101 + return 0
1102 + fi
1103 + use elibc_uclibc && export MAKEOPTS+=" -j1"
1104 + TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
1105 +}
1106 +
1107 +src_install() {
1108 + local i
1109 + local coredir="${ARCH_LIB}/CORE"
1110 +
1111 + emake DESTDIR="${D}" install
1112 +
1113 + rm -f "${ED}/usr/bin/perl${MY_PV}"
1114 + ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
1115 +
1116 + if ! tc-is-static-only ; then
1117 + dolib.so "${ED}"${coredir}/${LIBPERL}
1118 + rm -f "${ED}"${coredir}/${LIBPERL}
1119 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
1120 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
1121 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
1122 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
1123 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
1124 + fi
1125 +
1126 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
1127 +
1128 + # This removes ${D} from Config.pm
1129 + for i in $(find "${D}" -iname "Config.pm" ) ; do
1130 + einfo "Removing ${D} from ${i}..."
1131 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
1132 + done
1133 +
1134 + dodoc Changes* README AUTHORS
1135 +
1136 + if use doc ; then
1137 + # HTML Documentation
1138 + # We expect errors, warnings, and such with the following.
1139 +
1140 + dodir /usr/share/doc/${PF}/html
1141 + LD_LIBRARY_PATH=. ./perl installhtml \
1142 + --podroot='.' \
1143 + --podpath='lib:ext:pod:vms' \
1144 + --recurse \
1145 + --htmldir="${ED}/usr/share/doc/${PF}/html"
1146 + fi
1147 +
1148 + [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
1149 +
1150 + dual_scripts
1151 +}
1152 +
1153 +pkg_preinst() {
1154 + check_rebuild
1155 +}
1156 +
1157 +pkg_postinst() {
1158 + dual_scripts
1159 +
1160 + if [[ "${ROOT}" = "/" ]] ; then
1161 + local INC DIR file
1162 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
1163 + einfo "Removing old .ph files"
1164 + for DIR in ${INC} ; do
1165 + if [[ -d "${DIR}" ]] ; then
1166 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
1167 + rm -f "${file}"
1168 + einfo "<< ${file}"
1169 + done
1170 + fi
1171 + done
1172 + # Silently remove the now empty dirs
1173 + for DIR in ${INC} ; do
1174 + if [[ -d "${DIR}" ]] ; then
1175 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
1176 + fi
1177 + done
1178 +
1179 + fi
1180 +}
1181 +
1182 +pkg_postrm(){
1183 + dual_scripts
1184 +}