Gentoo Archives: gentoo-commits

From: Torsten Veller <tove@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/perl-overlay:master commit in: dev-lang/perl/files/, dev-lang/perl/
Date: Sun, 01 Apr 2012 13:31:53
Message-Id: 1333286731.7ac9a460307a4efe370689379f79a54f2edd28fa.tove@gentoo
1 commit: 7ac9a460307a4efe370689379f79a54f2edd28fa
2 Author: Torsten Veller <tove <AT> gentoo <DOT> org>
3 AuthorDate: Sun Apr 1 13:24:49 2012 +0000
4 Commit: Torsten Veller <tove <AT> gentoo <DOT> org>
5 CommitDate: Sun Apr 1 13:25:31 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/perl-overlay.git;a=commit;h=7ac9a460
7
8 [add] dev-lang/perl-5.14.2 from ::gentoo
9
10 (Portage version: 2.2.0_alpha96/git/Linux x86_64, signed Manifest commit with key 0x4E046AEC)
11
12 ---
13 dev-lang/perl/files/perl-5.10.1-hpux.patch | 40 ++
14 dev-lang/perl/files/perl-5.12.3-aix-soname.patch | 70 ++
15 dev-lang/perl/files/perl-5.12.3-interix.patch | 21 +
16 dev-lang/perl/files/perl-5.12.3-mint.patch | 321 +++++++++
17 .../perl/files/perl-5.14.1-cleanup-paths.patch | 100 +++
18 dev-lang/perl/files/perl-5.8.8-darwin-cc-ld.patch | 22 +
19 .../perl/files/perl-5.8.8-solaris-relocation.patch | 21 +
20 dev-lang/perl/files/perl-5.8.8-solaris11.patch | 14 +
21 dev-lang/perl/files/perl-5.8.8-usr-local.patch | 25 +
22 dev-lang/perl/metadata.xml | 12 +
23 dev-lang/perl/perl-5.14.2.ebuild | 715 ++++++++++++++++++++
24 11 files changed, 1361 insertions(+), 0 deletions(-)
25
26 diff --git a/dev-lang/perl/files/perl-5.10.1-hpux.patch b/dev-lang/perl/files/perl-5.10.1-hpux.patch
27 new file mode 100644
28 index 0000000..ca4ee52
29 --- /dev/null
30 +++ b/dev-lang/perl/files/perl-5.10.1-hpux.patch
31 @@ -0,0 +1,40 @@
32 +# do not assume '.' being in PATH on hpux,
33 +# use 'gcc' as linker, link with '-lm'.
34 +
35 +--- hints/hpux.sh
36 ++++ hints/hpux.sh
37 +@@ -190,7 +190,7 @@
38 + $define|true|[Yy])
39 + echo '#include <stdio.h>\nint main(){long l;printf("%d\\n",sizeof(l));}'>try.c
40 + $cc -o try $ccflags $ldflags try.c
41 +- if [ "`try`" = "8" ]; then
42 ++ if [ "`./try`" = "8" ]; then
43 + case "$use64bitall" in
44 + $define|true|[Yy]) ;;
45 + *) cat <<EOM >&4
46 +@@ -338,7 +338,7 @@
47 + } /* main */
48 + EOF
49 + $cc -o try $ccflags $ldflags try.c
50 +- maxdsiz=`try`
51 ++ maxdsiz=`./try`
52 + rm -f try try.c core
53 + if [ $maxdsiz -le 64 ]; then
54 + # 64 Mb is probably not enough to optimize toke.c
55 +@@ -363,11 +363,12 @@
56 + "") optimize="-g -O" ;;
57 + *O[3456789]*) optimize=`echo "$optimize" | sed -e 's/O[3-9]/O2/'` ;;
58 + esac
59 +- #ld="$cc"
60 +- ld=/usr/bin/ld
61 ++ ld="$cc"
62 ++ #ld=/usr/bin/ld
63 + cccdlflags='-fPIC'
64 +- #lddlflags='-shared'
65 +- lddlflags='-b'
66 ++ lddlflags='-shared'
67 ++ #lddlflags='-b'
68 ++ libs='-lm'
69 + case "$optimize" in
70 + *-g*-O*|*-O*-g*)
71 + # gcc without gas will not accept -g
72
73 diff --git a/dev-lang/perl/files/perl-5.12.3-aix-soname.patch b/dev-lang/perl/files/perl-5.12.3-aix-soname.patch
74 new file mode 100644
75 index 0000000..70fe5fa
76 --- /dev/null
77 +++ b/dev-lang/perl/files/perl-5.12.3-aix-soname.patch
78 @@ -0,0 +1,70 @@
79 +1) Match "powerpc-ibm-aix5.3.0.0-gcc" as gcc too.
80 +
81 +2) Creating shared library on aix with full soname support, following
82 +http://lists.gnu.org/archive/html/libtool/2011-01/msg00023.html
83 +http://lists.gnu.org/archive/html/libtool/2011-02/msg00000.html
84 +
85 +Once there is an agreement on that, this patch basically is designed
86 +for upstream perl to be applied when their soname would change anyway.
87 +However, there is 'strip' being used, and I don't know yet what to
88 +use instead in cross-aix setups with recent binutils.
89 +
90 +--- Makefile.SH
91 ++++ Makefile.SH
92 +@@ -92,12 +92,12 @@
93 + ;;
94 + aix*)
95 + case "$cc" in
96 +- gcc*)
97 +- shrpldflags="-shared -Wl,-H512 -Wl,-T512 -Wl,-bhalt:4 -Wl,-bM:SRE -Wl,-bE:perl.exp"
98 ++ *gcc*)
99 ++ shrpldflags="-shared -Wl,-H512 -Wl,-T512 -Wl,-bhalt:4 -Wl,-bE:perl.exp"
100 + case "$osvers" in
101 +- 3*) shrpldflags="$shrpldflags -e _nostart"
102 ++ 3*) shrpldflags="$shrpldflags -Wl,-bM:SRE -e _nostart"
103 + ;;
104 +- *) shrpldflags="$shrpldflags -Wl,-bnoentry"
105 ++ *) shrpldflags="$shrpldflags -Wl,-G -Wl,-bernotok -Wl,-bnoentry"
106 + ;;
107 + esac
108 + shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
109 +@@ -105,11 +105,11 @@
110 + linklibperl_nonshr='-lperl_nonshr'
111 + ;;
112 + *)
113 +- shrpldflags="-H512 -T512 -bhalt:4 -bM:SRE -bE:perl.exp"
114 ++ shrpldflags="-H512 -T512 -bhalt:4 -bE:perl.exp"
115 + case "$osvers" in
116 +- 3*) shrpldflags="$shrpldflags -e _nostart"
117 ++ 3*) shrpldflags="$shrpldflags -bM:SRE -e _nostart"
118 + ;;
119 +- *) shrpldflags="$shrpldflags -b noentry"
120 ++ *) shrpldflags="$shrpldflags -G -bernotok -b noentry"
121 + ;;
122 + esac
123 + shrpldflags="$shrpldflags $ldflags $perllibs $cryptlib"
124 +@@ -763,11 +763,19 @@
125 + !NO!SUBS!
126 + case "$osname" in
127 + aix)
128 +- $spitshell >>$Makefile <<'!NO!SUBS!'
129 +- rm -f libperl$(OBJ_EXT)
130 +- mv $@ libperl$(OBJ_EXT)
131 +- $(AR) qv $(LIBPERL) libperl$(OBJ_EXT)
132 +-!NO!SUBS!
133 ++ bits=32
134 ++ if test X"$use64bitall" = Xdefine; then bits=64; fi
135 ++ $spitshell >>$Makefile <<!GROK!THIS!
136 ++ rm -f shr.imp shr.o
137 ++ mv \$@ shr.o
138 ++ strip -e shr.o
139 ++ ( echo '#! libperl.so.${revision}.${patchlevel}(shr.o)' \\
140 ++ ; echo '# ${bits}' \\
141 ++ ; grep -v '^#!' perl.exp \\
142 ++ ) > shr.imp
143 ++ \$(AR) qv \$@ shr.imp shr.o
144 ++ rm -f shr.imp shr.o
145 ++!GROK!THIS!
146 + ;;
147 + esac
148 + ;;
149
150 diff --git a/dev-lang/perl/files/perl-5.12.3-interix.patch b/dev-lang/perl/files/perl-5.12.3-interix.patch
151 new file mode 100644
152 index 0000000..5e875b2
153 --- /dev/null
154 +++ b/dev-lang/perl/files/perl-5.12.3-interix.patch
155 @@ -0,0 +1,21 @@
156 +reported: http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2011-04/msg01014.html
157 +
158 +diff -ru perl-5.12.3.orig/hints/interix.sh perl-5.12.3/hints/interix.sh
159 +--- perl-5.12.3.orig/hints/interix.sh 2011-04-27 08:34:00 +0200
160 ++++ perl-5.12.3/hints/interix.sh 2011-04-27 08:53:46 +0200
161 +@@ -6,14 +6,13 @@
162 + cc='gcc'
163 + cccdlflags="-DPIC $cccdlflags"
164 + ccdlflags='-Wl,-E'
165 +-ccflags="-D_ALL_SOURCE $ccflags"
166 +-d_poll="$undef"
167 + ld='gcc'
168 + lddlflags="-shared $lddlflags"
169 + rpathflag='-Wl,-R'
170 + sharpbang='#!'
171 + usemymalloc='false'
172 + usenm='false'
173 ++firstmakefile=GNUmakefile
174 +
175 + # This script UU/usethreads.cbu will get 'called-back' by Configure
176 + # after it has prompted the user for whether to use threads.
177
178 diff --git a/dev-lang/perl/files/perl-5.12.3-mint.patch b/dev-lang/perl/files/perl-5.12.3-mint.patch
179 new file mode 100644
180 index 0000000..4c6c108
181 --- /dev/null
182 +++ b/dev-lang/perl/files/perl-5.12.3-mint.patch
183 @@ -0,0 +1,321 @@
184 +http://rt.perl.org/rt3/Ticket/Display.html?id=89502
185 +
186 +--- perl-5.12.3/Configure 2011-02-21 09:18:09.000000000 +0000
187 ++++ perl-5.12.3/Configure 2011-02-21 09:38:49.000000000 +0000
188 +@@ -1275,6 +1275,9 @@
189 + elif test -n "$DJGPP"; then
190 + : DOS DJGPP
191 + _exe=".exe"
192 ++elif test -f "/kern/cookiejar"; then
193 ++: MiNT
194 ++ _exe=""
195 + elif test -d c:/. -o -n "$is_os2" ; then
196 + : OS/2 or cygwin
197 + _exe=".exe"
198 +@@ -1402,7 +1405,7 @@
199 + xcat=/bin/cat
200 + test -f $xcat$_exe || xcat=/usr/bin/cat
201 + if test ! -f $xcat$_exe; then
202 +- for p in `echo $PATH | sed -e "s/$p_/ /g"` $paths; do
203 ++ for p in `echo $PATH | sed -e 's/$p_/ /g'` $paths; do
204 + if test -f $p/cat$_exe; then
205 + xcat=$p/cat
206 + break
207 +--- perl-5.12.3/ext/DynaLoader/dl_dld.xs 2010-11-21 21:40:55.000000000 +0000
208 ++++ perl-5.12.3/ext/DynaLoader/dl_dld.xs 2011-02-21 09:38:51.000000000 +0000
209 +@@ -116,6 +116,18 @@
210 + goto haverror;
211 + }
212 +
213 ++ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dld_link(libm.a)\n"));
214 ++ if (dlderr = dld_link("/usr/lib/libm.a")) {
215 ++ SaveError(aTHX_ "dld_link(libm.a): %s", dld_strerror(dlderr));
216 ++ goto haverror;
217 ++ }
218 ++
219 ++ DLDEBUG(1,PerlIO_printf(Perl_debug_log, "dld_link(libc.a)\n"));
220 ++ if (dlderr = dld_link("/usr/lib/libc.a")) {
221 ++ SaveError(aTHX_ "dld_link(libc.a): %s", dld_strerror(dlderr));
222 ++ goto haverror;
223 ++ }
224 ++
225 + max = AvFILL(dl_resolve_using);
226 + for (x = 0; x <= max; x++) {
227 + char *sym = SvPVX(*av_fetch(dl_resolve_using, x, 0));
228 +--- perl-5.12.3/malloc.c 2011-01-09 20:20:57.000000000 +0000
229 ++++ perl-5.12.3/malloc.c 2011-02-21 09:38:51.000000000 +0000
230 +@@ -264,7 +264,7 @@
231 + #define MIN_BUC_POW2 (sizeof(void*) > 4 ? 3 : 2) /* Allow for 4-byte arena. */
232 + #define MIN_BUCKET (MIN_BUC_POW2 * BUCKETS_PER_POW2)
233 +
234 +-#if !(defined(I286) || defined(atarist))
235 ++#if !defined(I286)
236 + /* take 2k unless the block is bigger than that */
237 + # define LOG_OF_MIN_ARENA 11
238 + #else
239 +@@ -551,8 +551,8 @@
240 + */
241 + #define u_short unsigned short
242 +
243 +-/* 286 and atarist like big chunks, which gives too much overhead. */
244 +-#if (defined(RCHECK) || defined(I286) || defined(atarist)) && defined(PACK_MALLOC)
245 ++/* 286 like big chunks, which gives too much overhead. */
246 ++#if (defined(RCHECK) || defined(I286)) && defined(PACK_MALLOC)
247 + # undef PACK_MALLOC
248 + #endif
249 +
250 +@@ -1734,16 +1734,14 @@
251 + /* Second, check alignment. */
252 + slack = 0;
253 +
254 +-#if !defined(atarist) /* on the atari we dont have to worry about this */
255 +-# ifndef I286 /* The sbrk(0) call on the I286 always returns the next segment */
256 ++#ifndef I286 /* The sbrk(0) call on the I286 always returns the next segment */
257 + /* WANTED_ALIGNMENT may be more than NEEDED_ALIGNMENT, but this may
258 + improve performance of memory access. */
259 + if (PTR2UV(cp) & (WANTED_ALIGNMENT - 1)) { /* Not aligned. */
260 + slack = WANTED_ALIGNMENT - (PTR2UV(cp) & (WANTED_ALIGNMENT - 1));
261 + add += slack;
262 + }
263 +-# endif
264 +-#endif /* !atarist */
265 ++#endif
266 +
267 + if (add) {
268 + DEBUG_m(PerlIO_printf(Perl_debug_log,
269 +--- perl-5.12.3/miniperlmain.c 2011-01-09 20:20:57.000000000 +0000
270 ++++ perl-5.12.3/miniperlmain.c 2011-02-21 09:38:49.000000000 +0000
271 +@@ -45,7 +45,7 @@
272 + #if defined (atarist)
273 + /* The Atari operating system doesn't have a dynamic stack. The
274 + stack size is determined from this value. */
275 +-long _stksize = 64 * 1024;
276 ++long _stksize = 256 * 1024;
277 + #endif
278 +
279 + #if defined(PERL_GLOBAL_STRUCT_PRIVATE)
280 +--- perl-5.12.3/os2/perlrexx.c 2010-11-21 21:40:56.000000000 +0000
281 ++++ perl-5.12.3/os2/perlrexx.c 2011-02-21 09:42:49.000000000 +0000
282 +@@ -38,7 +38,7 @@
283 + #if defined (atarist)
284 + /* The Atari operating system doesn't have a dynamic stack. The
285 + stack size is determined from this value. */
286 +-long _stksize = 64 * 1024;
287 ++long _stksize = 256 * 1024;
288 + #endif
289 +
290 + /* Register any extra external extensions */
291 +--- perl-5.12.3/perl.c 2011-02-21 09:17:19.000000000 +0000
292 ++++ perl-5.12.3/perl.c 2011-02-21 09:38:50.000000000 +0000
293 +@@ -3272,10 +3272,6 @@
294 + "\n\nOS/2 port Copyright (c) 1990, 1991, Raymond Chen, Kai Uwe Rommel\n"
295 + "Version 5 port Copyright (c) 1994-2002, Andreas Kaiser, Ilya Zakharevich\n");
296 + #endif
297 +-#ifdef atarist
298 +- PerlIO_printf(PerlIO_stdout(),
299 +- "atariST series port, ++jrb bammi@×××××××.com\n");
300 +-#endif
301 + #ifdef __BEOS__
302 + PerlIO_printf(PerlIO_stdout(),
303 + "BeOS port Copyright Tom Spindler, 1997-1999\n");
304 +--- perl-5.12.3/perl.h 2011-01-09 20:20:57.000000000 +0000
305 ++++ perl-5.12.3/perl.h 2011-02-21 09:38:50.000000000 +0000
306 +@@ -497,7 +497,7 @@
307 + */
308 +
309 + /* define this once if either system, instead of cluttering up the src */
310 +-#if defined(MSDOS) || defined(atarist) || defined(WIN32) || defined(NETWARE)
311 ++#if defined(MSDOS) || defined(WIN32) || defined(NETWARE)
312 + #define DOSISH 1
313 + #endif
314 +
315 +--- perl-5.12.3/perlio.c 2009-04-14 23:47:25.000000000 +0000
316 ++++ perl-5.12.3/perlio.c 2010-03-23 18:36:15.000000000 +0000
317 +@@ -135,17 +135,6 @@
318 + * This used to be contents of do_binmode in doio.c
319 + */
320 + #ifdef DOSISH
321 +-# if defined(atarist)
322 +- PERL_UNUSED_ARG(iotype);
323 +- if (!fflush(fp)) {
324 +- if (mode & O_BINARY)
325 +- ((FILE *) fp)->_flag |= _IOBIN;
326 +- else
327 +- ((FILE *) fp)->_flag &= ~_IOBIN;
328 +- return 1;
329 +- }
330 +- return 0;
331 +-# else
332 + dTHX;
333 + PERL_UNUSED_ARG(iotype);
334 + #ifdef NETWARE
335 +@@ -153,7 +142,7 @@
336 + #else
337 + if (PerlLIO_setmode(fileno(fp), mode) != -1) {
338 + #endif
339 +-# if defined(WIN32) && defined(__BORLANDC__)
340 ++# if defined(WIN32) && defined(__BORLANDC__)
341 + /*
342 + * The translation mode of the stream is maintained independent
343 + of
344 +@@ -169,12 +158,11 @@
345 + fp->flags |= _F_BIN;
346 + else
347 + fp->flags &= ~_F_BIN;
348 +-# endif
349 ++# endif
350 + return 1;
351 + }
352 + else
353 + return 0;
354 +-# endif
355 + #else
356 + # if defined(USEMYBINMODE)
357 + dTHX;
358 +--- perl-5.12.3/pp_sys.c 2011-01-09 20:20:58.000000000 +0000
359 ++++ perl-5.12.3/pp_sys.c 2011-02-21 09:38:50.000000000 +0000
360 +@@ -3308,14 +3308,6 @@
361 + RETPUSHNO;
362 + }
363 +
364 +-#if defined(atarist) /* this will work with atariST. Configure will
365 +- make guesses for other systems. */
366 +-# define FILE_base(f) ((f)->_base)
367 +-# define FILE_ptr(f) ((f)->_ptr)
368 +-# define FILE_cnt(f) ((f)->_cnt)
369 +-# define FILE_bufsiz(f) ((f)->_cnt + ((f)->_ptr - (f)->_base))
370 +-#endif
371 +-
372 + PP(pp_fttext)
373 + {
374 + dVAR;
375 +@@ -5567,30 +5559,6 @@
376 + case 8:
377 + retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);
378 + break;
379 +-#ifdef atarist
380 +- case 9:
381 +- retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8]);
382 +- break;
383 +- case 10:
384 +- retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9]);
385 +- break;
386 +- case 11:
387 +- retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],
388 +- a[10]);
389 +- break;
390 +- case 12:
391 +- retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],
392 +- a[10],a[11]);
393 +- break;
394 +- case 13:
395 +- retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],
396 +- a[10],a[11],a[12]);
397 +- break;
398 +- case 14:
399 +- retval = syscall(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9],
400 +- a[10],a[11],a[12],a[13]);
401 +- break;
402 +-#endif /* atarist */
403 + }
404 + SP = ORIGMARK;
405 + PUSHi(retval);
406 +--- perl-5.12.3/util.c 2011-01-09 20:20:58.000000000 +0000
407 ++++ perl-5.12.3/util.c 2011-02-21 09:38:51.000000000 +0000
408 +@@ -2545,7 +2545,7 @@
409 + return PerlIO_fdopen(p[This], mode);
410 + }
411 + #else
412 +-#if defined(atarist) || defined(EPOC)
413 ++#if defined(EPOC)
414 + FILE *popen();
415 + PerlIO *
416 + Perl_my_popen(pTHX_ const char *cmd, const char *mode)
417 +@@ -2994,7 +2994,7 @@
418 + }
419 + #endif
420 +
421 +-#if defined(atarist) || defined(OS2) || defined(EPOC)
422 ++#if defined(OS2) || defined(EPOC)
423 + int pclose();
424 + #ifdef HAS_FORK
425 + int /* Cannot prototype with I32
426 +@@ -3111,7 +3111,7 @@
427 + I32 len = 0;
428 + int retval;
429 + char *bufend;
430 +-#if defined(DOSISH) && !defined(OS2) && !defined(atarist)
431 ++#if defined(DOSISH) && !defined(OS2)
432 + # define SEARCH_EXTS ".bat", ".cmd", NULL
433 + # define MAX_EXT_LEN 4
434 + #endif
435 +@@ -3234,28 +3234,25 @@
436 +
437 + bufend = s + strlen(s);
438 + while (s < bufend) {
439 +-#if defined(atarist) || defined(DOSISH)
440 ++#if defined(DOSISH)
441 + for (len = 0; *s
442 +-# ifdef atarist
443 +- && *s != ','
444 +-# endif
445 + && *s != ';'; len++, s++) {
446 + if (len < sizeof tmpbuf)
447 + tmpbuf[len] = *s;
448 + }
449 + if (len < sizeof tmpbuf)
450 + tmpbuf[len] = '\0';
451 +-#else /* ! (atarist || DOSISH) */
452 ++#else /* ! (DOSISH) */
453 + s = delimcpy(tmpbuf, tmpbuf + sizeof tmpbuf, s, bufend,
454 + ':',
455 + &len);
456 +-#endif /* ! (atarist || DOSISH) */
457 ++#endif /* ! (DOSISH) */
458 + if (s < bufend)
459 + s++;
460 + if (len + 1 + strlen(scriptname) + MAX_EXT_LEN >= sizeof tmpbuf)
461 + continue; /* don't search dir with too-long name */
462 + if (len
463 +-# if defined(atarist) || defined(DOSISH)
464 ++# if defined(DOSISH)
465 + && tmpbuf[len - 1] != '/'
466 + && tmpbuf[len - 1] != '\\'
467 + # endif
468 +--- perl-5.12.3/hints/freemint.sh 2011-01-09 20:20:58.000000000 +0000
469 ++++ perl-5.12.3/hints/freemint.sh 2011-02-21 09:38:51.000000000 +0000
470 +@@ -0,0 +1,34 @@
471 ++# hints/freemint.sh
472 ++#
473 ++# talk to guido@××××××××.de if you want to change this file.
474 ++# Please read the README.mint file.
475 ++#
476 ++# misc stuff
477 ++
478 ++archname="m68k-freemint"
479 ++
480 ++cccdlflags=' '; # avoid -fPIC
481 ++ccdlflags="-Wl,-whole-archive -lgcc -lpthread -Wl,-no-whole-archive"
482 ++
483 ++# libs
484 ++libpth="$prefix/lib /usr/local/lib /usr/lib"
485 ++glibpth="$libpth"
486 ++xlibpth="$libpth"
487 ++
488 ++ccflags="$ccflags -D_GNU_SOURCE"
489 ++libswanted='m dld'
490 ++dl_src='dl_dld.xs'
491 ++dlext='o'
492 ++lddlflags='-r'
493 ++ldflags='-static'
494 ++so='none'
495 ++useshrplib='false'
496 ++
497 ++#sbrk() returns -1 (failure) somewhere in lib/unicore/mktables at
498 ++#around 14M, so we need to use system malloc() as our sbrk()
499 ++malloc_cflags='ccflags="-DUSE_PERL_SBRK -DPERL_SBRK_VIA_MALLOC $ccflags"'
500 ++
501 ++# Locales aren't feeling well. We crash if -Ox used.
502 ++locale_cflags='optimize="-O0"'
503 ++LC_ALL=C; export LC_ALL;
504 ++LANG=C; export LANG;
505
506 diff --git a/dev-lang/perl/files/perl-5.14.1-cleanup-paths.patch b/dev-lang/perl/files/perl-5.14.1-cleanup-paths.patch
507 new file mode 100644
508 index 0000000..c199041
509 --- /dev/null
510 +++ b/dev-lang/perl/files/perl-5.14.1-cleanup-paths.patch
511 @@ -0,0 +1,100 @@
512 +cut the crap of inventing paths, or adding search paths that we don't use
513 +
514 +--- Configure
515 ++++ Configure
516 +@@ -105,28 +105,6 @@
517 + fi
518 + fi
519 +
520 +-: Proper PATH setting
521 +-paths='/bin /usr/bin /usr/local/bin /usr/ucb /usr/local /usr/lbin'
522 +-paths="$paths /opt/bin /opt/local/bin /opt/local /opt/lbin"
523 +-paths="$paths /usr/5bin /etc /usr/gnu/bin /usr/new /usr/new/bin /usr/nbin"
524 +-paths="$paths /opt/gnu/bin /opt/new /opt/new/bin /opt/nbin"
525 +-paths="$paths /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/ucb"
526 +-paths="$paths /bsd4.3/usr/bin /usr/bsd /bsd43/bin /opt/ansic/bin /usr/ccs/bin"
527 +-paths="$paths /etc /usr/lib /usr/ucblib /lib /usr/ccs/lib"
528 +-paths="$paths /sbin /usr/sbin /usr/libexec"
529 +-paths="$paths /system/gnu_library/bin"
530 +-
531 +-for p in $paths
532 +-do
533 +- case "$p_$PATH$p_" in
534 +- *$p_$p$p_*) ;;
535 +- *) test -d $p && PATH=$PATH$p_$p ;;
536 +- esac
537 +-done
538 +-
539 +-PATH=.$p_$PATH
540 +-export PATH
541 +-
542 + : shall we be using ksh?
543 + inksh=''
544 + needksh=''
545 +@@ -8287,66 +8265,6 @@
546 + ;;
547 + esac
548 +
549 +-# How will the perl executable find the installed shared $libperl?
550 +-# Add $xxx to ccdlflags.
551 +-# If we can't figure out a command-line option, use $shrpenv to
552 +-# set env LD_RUN_PATH. The main perl makefile uses this.
553 +-shrpdir=$archlibexp/CORE
554 +-xxx=''
555 +-tmp_shrpenv=''
556 +-if "$useshrplib"; then
557 +- case "$osname" in
558 +- aix)
559 +- # We'll set it in Makefile.SH...
560 +- ;;
561 +- solaris)
562 +- xxx="-R $shrpdir"
563 +- ;;
564 +- freebsd|mirbsd|netbsd|openbsd|interix|dragonfly)
565 +- xxx="-Wl,-R$shrpdir"
566 +- ;;
567 +- bsdos|linux|irix*|dec_osf|gnu*)
568 +- xxx="-Wl,-rpath,$shrpdir"
569 +- ;;
570 +- next)
571 +- # next doesn't like the default...
572 +- ;;
573 +- beos)
574 +- # beos doesn't like the default, either.
575 +- ;;
576 +- haiku)
577 +- # Haiku doesn't like the default, either.
578 +- ;;
579 +- hpux*)
580 +- # hpux doesn't like the default, either.
581 +- tmp_shrpenv="env LDOPTS=\"+s +b${shrpdir}\""
582 +- ;;
583 +- cygwin)
584 +- # cygwin needs only ldlibpth
585 +- ;;
586 +- *)
587 +- tmp_shrpenv="env LD_RUN_PATH=$shrpdir"
588 +- ;;
589 +- esac
590 +- case "$xxx" in
591 +- '') ;;
592 +- *)
593 +- # Only add $xxx if it isn't already in ccdlflags.
594 +- case " $ccdlflags " in
595 +- *" $xxx "*) ;;
596 +- *) ccdlflags="$ccdlflags $xxx"
597 +- cat <<EOM >&4
598 +-
599 +-Adding $xxx to the flags
600 +-passed to $ld so that the perl executable will find the
601 +-installed shared $libperl.
602 +-
603 +-EOM
604 +- ;;
605 +- esac
606 +- ;;
607 +- esac
608 +-fi
609 + # Fix ccdlflags in AIX for building external extensions.
610 + # (For building Perl itself bare -bE:perl.exp is needed,
611 + # Makefile.SH takes care of this.)
612
613 diff --git a/dev-lang/perl/files/perl-5.8.8-darwin-cc-ld.patch b/dev-lang/perl/files/perl-5.8.8-darwin-cc-ld.patch
614 new file mode 100644
615 index 0000000..b96eea8
616 --- /dev/null
617 +++ b/dev-lang/perl/files/perl-5.8.8-darwin-cc-ld.patch
618 @@ -0,0 +1,22 @@
619 +Use $CC to link (and check for broken compilers), such that we don't get
620 +linked modules of a different bitness.
621 +http://bugs.gentoo.org/show_bug.cgi?id=297751
622 +
623 +--- hints/darwin.sh
624 ++++ hints/darwin.sh
625 +@@ -128,13 +128,13 @@
626 + ccflags="${ccflags} ${cppflags}"
627 +
628 + # Known optimizer problems.
629 +-case "`cc -v 2>&1`" in
630 ++case "`${cc:-gcc} -v 2>&1`" in
631 + *"3.1 20020105"*) toke_cflags='optimize=""' ;;
632 + esac
633 +
634 + # Shared library extension is .dylib.
635 + # Bundle extension is .bundle.
636 +-ld='cc';
637 ++ld="${cc:-gcc}";
638 + so='dylib';
639 + dlext='bundle';
640 + usedl='define';
641
642 diff --git a/dev-lang/perl/files/perl-5.8.8-solaris-relocation.patch b/dev-lang/perl/files/perl-5.8.8-solaris-relocation.patch
643 new file mode 100644
644 index 0000000..f2df825
645 --- /dev/null
646 +++ b/dev-lang/perl/files/perl-5.8.8-solaris-relocation.patch
647 @@ -0,0 +1,21 @@
648 +http://sourceware.org/ml/binutils/2005-12/msg00008.html
649 +--- hints/solaris_2.sh
650 ++++ hints/solaris_2.sh
651 +@@ -289,7 +289,7 @@
652 +
653 + END
654 + ccdlflags="$ccdlflags -Wl,-E"
655 +- lddlflags="$lddlflags -Wl,-E -G"
656 ++ lddlflags="$lddlflags -shared"
657 + fi
658 + fi
659 +
660 +@@ -555,7 +555,7 @@
661 + : #ccflags="$ccflags -Wa,`getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
662 + fi
663 + ldflags="$ldflags -m64"
664 +- lddlflags="$lddlflags -G -m64"
665 ++ lddlflags="$lddlflags -m64"
666 + ;;
667 + *)
668 + ccflags="$ccflags `getconf XBS5_LP64_OFF64_CFLAGS 2>/dev/null`"
669
670 diff --git a/dev-lang/perl/files/perl-5.8.8-solaris11.patch b/dev-lang/perl/files/perl-5.8.8-solaris11.patch
671 new file mode 100644
672 index 0000000..6ba72e0
673 --- /dev/null
674 +++ b/dev-lang/perl/files/perl-5.8.8-solaris11.patch
675 @@ -0,0 +1,14 @@
676 +Thanks to the nice OpenSolaris guys, I finally figured out that on
677 +OpenSolaris 11, the header dependencies have changed.
678 +
679 +--- perl.h
680 ++++ perl.h
681 +@@ -1192,6 +1192,8 @@
682 + */
683 +
684 + #if defined(I_SYSMODE) && !defined(PERL_MICRO)
685 ++#include <sys/stat.h>
686 ++#include <sys/vnode.h>
687 + #include <sys/mode.h>
688 + #endif
689 +
690
691 diff --git a/dev-lang/perl/files/perl-5.8.8-usr-local.patch b/dev-lang/perl/files/perl-5.8.8-usr-local.patch
692 new file mode 100644
693 index 0000000..c44b786
694 --- /dev/null
695 +++ b/dev-lang/perl/files/perl-5.8.8-usr-local.patch
696 @@ -0,0 +1,25 @@
697 +# remove /usr/local paths from all stuff thats used
698 +# in Configure script, locincpth, loclibpth and glibpth are sedded
699 +# afterwards not to conflict with the lib32 and lib64 patches
700 +
701 +diff -rubB perl-5.8.8.orig/Configure perl-5.8.8/Configure
702 +--- perl-5.8.8.orig/Configure Tue Jan 15 10:41:29 2008
703 ++++ perl-5.8.8/Configure Tue Jan 15 10:44:59 2008
704 +@@ -4424,7 +4422,7 @@
705 + : Set private lib path
706 + case "$plibpth" in
707 + '') if ./mips; then
708 +- plibpth="$incpath/usr/lib /usr/local/lib /usr/ccs/lib"
709 ++ plibpth="$incpath/usr/lib /usr/ccs/lib"
710 + fi;;
711 + esac
712 + case "$libpth" in
713 +@@ -19144,7 +19142,7 @@
714 + case "$ranlib" in
715 + :) ranlib='';;
716 + '')
717 +- ranlib=`./loc ranlib X /usr/bin /bin /usr/local/bin`
718 ++ ranlib=`./loc ranlib X /usr/bin /bin`
719 + $test -f $ranlib || ranlib=''
720 + ;;
721 + esac
722
723 diff --git a/dev-lang/perl/metadata.xml b/dev-lang/perl/metadata.xml
724 new file mode 100644
725 index 0000000..a6186e4
726 --- /dev/null
727 +++ b/dev-lang/perl/metadata.xml
728 @@ -0,0 +1,12 @@
729 +<?xml version="1.0" encoding="UTF-8"?>
730 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
731 +<pkgmetadata>
732 + <herd>perl</herd>
733 + <maintainer>
734 + <email>perl@g.o</email>
735 + <description>Primary Maintainer</description>
736 + </maintainer>
737 + <use>
738 + <flag name='ithreads'>Enable Perl threads, has some compatibility problems</flag>
739 + </use>
740 +</pkgmetadata>
741
742 diff --git a/dev-lang/perl/perl-5.14.2.ebuild b/dev-lang/perl/perl-5.14.2.ebuild
743 new file mode 100644
744 index 0000000..a325acb
745 --- /dev/null
746 +++ b/dev-lang/perl/perl-5.14.2.ebuild
747 @@ -0,0 +1,715 @@
748 +# Copyright 1999-2012 Gentoo Foundation
749 +# Distributed under the terms of the GNU General Public License v2
750 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/perl/perl-5.14.2.ebuild,v 1.4 2012/03/03 12:29:38 grobian Exp $
751 +
752 +EAPI=4
753 +
754 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib
755 +
756 +PATCH_VER=1
757 +
758 +PERL_OLDVERSEN="5.14.0 5.14.1"
759 +MODULE_AUTHOR=FLORA
760 +
761 +SHORT_PV="${PV%.*}"
762 +MY_P="perl-${PV/_rc/-RC}"
763 +MY_PV="${PV%_rc*}"
764 +
765 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
766 +
767 +SRC_URI="
768 + mirror://cpan/src/${MY_P}.tar.bz2
769 + mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MY_P}.tar.bz2
770 + mirror://gentoo/${MY_P}-${PATCH_VER}.tar.bz2
771 + http://dev.gentoo.org/~tove/distfiles/${CATEGORY}/${PN}/${MY_P}-${PATCH_VER}.tar.bz2"
772 +# mirror://cpan/src/${MY_P}.tar.bz2
773 +# mirror://gentoo/${MY_P}-${PATCH_VER}.tar.bz2
774 +HOMEPAGE="http://www.perl.org/"
775 +
776 +LICENSE="|| ( Artistic GPL-1 GPL-2 GPL-3 )"
777 +SLOT="0"
778 +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd ~ppc-aix ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
779 +IUSE="berkdb build debug doc gdbm ithreads"
780 +
781 +COMMON_DEPEND="
782 + berkdb? ( sys-libs/db )
783 + gdbm? ( >=sys-libs/gdbm-1.8.3 )
784 + app-arch/bzip2
785 + sys-libs/zlib
786 +"
787 +DEPEND="${COMMON_DEPEND}
788 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
789 +"
790 +RDEPEND="${COMMON_DEPEND}
791 +"
792 +PDEPEND=">=app-admin/perl-cleaner-2.5"
793 +
794 +S="${WORKDIR}/${MY_P}"
795 +
796 +dual_scripts() {
797 + src_remove_dual perl-core/Archive-Tar 1.760.0 ptar ptardiff ptargrep
798 + src_remove_dual perl-core/Digest-SHA 5.610.0 shasum
799 + src_remove_dual perl-core/CPAN 1.960.1_rc cpan
800 + src_remove_dual perl-core/CPANPLUS 0.910.300 cpanp cpan2dist
801 + src_remove_dual_file perl-core/CPANPLUS 0.910.300 /usr/bin/cpanp-run-perl
802 + src_remove_dual perl-core/Encode 2.420.100_rc enc2xs piconv
803 + src_remove_dual perl-core/ExtUtils-MakeMaker 6.570.500_rc instmodsh
804 + src_remove_dual perl-core/ExtUtils-ParseXS 2.221.0 xsubpp
805 + src_remove_dual perl-core/JSON-PP 2.271.50 json_pp
806 + src_remove_dual perl-core/Module-Build 0.380.0 config_data
807 + src_remove_dual perl-core/Module-CoreList 2.490.200_rc corelist
808 + src_remove_dual perl-core/PodParser 1.370.0 pod2usage podchecker podselect
809 + src_remove_dual perl-core/Test-Harness 3.230.0 prove
810 + src_remove_dual perl-core/podlators 2.4.0 pod2man pod2text
811 + src_remove_dual_man perl-core/podlators 2.4.0 /usr/share/man/man1/perlpodstyle.1
812 +}
813 +
814 +pkg_pretend() {
815 + check_rebuild
816 +}
817 +
818 +pkg_setup() {
819 + case ${CHOST} in
820 + *-freebsd*) osname="freebsd" ;;
821 + *-dragonfly*) osname="dragonfly" ;;
822 + *-netbsd*) osname="netbsd" ;;
823 + *-openbsd*) osname="openbsd" ;;
824 + *-darwin*) osname="darwin" ;;
825 + *-interix*) osname="interix" ;;
826 + *) osname="linux" ;;
827 + esac
828 +
829 + if use ithreads ; then
830 + mythreading="-multi"
831 + myarch="${CHOST%%-*}-${osname}-thread"
832 + else
833 + myarch="${CHOST%%-*}-${osname}"
834 + fi
835 + if use debug ; then
836 + myarch="${myarch}-debug"
837 + fi
838 +
839 + LIBPERL="libperl$(get_libname ${MY_PV} )"
840 + PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}"
841 + ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
842 + SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}"
843 + SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
844 + VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}"
845 + VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}"
846 +
847 + if use ithreads ; then
848 + echo ""
849 + ewarn "THREADS WARNING:"
850 + ewarn "PLEASE NOTE: You are compiling ${MY_P} with"
851 + ewarn "interpreter-level threading enabled."
852 + ewarn "Threading is not supported by all applications "
853 + ewarn "that compile against perl. You use threading at "
854 + ewarn "your own discretion. "
855 + fi
856 + check_rebuild
857 + dual_scripts
858 +}
859 +
860 +check_rebuild() {
861 + if has_version "<dev-lang/perl-${SHORT_PV}" ; then
862 + echo ""
863 + ewarn "UPDATE THE PERL MODULES:"
864 + ewarn "After updating dev-lang/perl you must reinstall"
865 + ewarn "the installed perl modules."
866 + ewarn "Use: perl-cleaner --all"
867 + elif has_version dev-lang/perl ; then
868 + # doesnot work
869 + #if ! has_version dev-lang/perl[ithreads=,debug=] ; then
870 + #if ! has_version dev-lang/perl[ithreads=] || ! has_version dev-lang/perl[debug=] ; then
871 + if ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
872 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
873 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
874 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
875 + echo ""
876 + ewarn "TOGGLED USE-FLAGS WARNING:"
877 + ewarn "You changed one of the use-flags ithreads or debug."
878 + ewarn "You must rebuild all perl-modules installed."
879 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
880 + fi
881 + fi
882 +}
883 +
884 +src_prepare_update_patchlevel_h() {
885 + [[ -f ${WORKDIR}/perl-patch/series ]] || return 0
886 +
887 + while read patch level ; do
888 + sed -i -e "s/^\t,NULL$/ ,\"${patch//__/_}\"\n&/" "${S}"/patchlevel.h || die
889 + done < "${WORKDIR}"/perl-patch/series
890 +}
891 +
892 +src_prepare() {
893 + EPATCH_SOURCE="${WORKDIR}/perl-patch" \
894 + EPATCH_SUFFIX="diff" \
895 + EPATCH_FORCE="yes" \
896 + EPATCH_OPTS="-p1" \
897 + epatch
898 +
899 + src_prepare_update_patchlevel_h
900 +
901 + # pod/perltoc.pod fails
902 + # lib/ExtUtils/t/Embed.t fails
903 + if ! tc-is-static-only ; then
904 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
905 + ln -s ${LIBPERL} libperl$(get_libname ) || die
906 + fi
907 +
908 + epatch "${FILESDIR}"/${PN}-5.12.3-aix-soname.patch
909 + epatch "${FILESDIR}"/${PN}-5.8.8-solaris-relocation.patch
910 + epatch "${FILESDIR}"/${PN}-5.8.8-solaris11.patch
911 + epatch "${FILESDIR}"/${PN}-5.14.1-cleanup-paths.patch
912 + epatch "${FILESDIR}"/${PN}-5.8.8-usr-local.patch
913 + epatch "${FILESDIR}"/${PN}-5.10.1-hpux.patch
914 + epatch "${FILESDIR}"/${PN}-5.8.8-darwin-cc-ld.patch
915 + epatch "${FILESDIR}"/${PN}-5.12.3-mint.patch
916 + epatch "${FILESDIR}"/${PN}-5.12.3-interix.patch
917 +
918 + # rest of usr-local patch
919 + sed -i \
920 + -e '/^locincpth=/c\locincpth=""' \
921 + -e '/^loclibpth=/c\loclibpth=""' \
922 + -e '/^glibpth=.*\/local\//s: /usr/local/lib.*":":' \
923 + Configure || die
924 +}
925 +
926 +myconf() {
927 + # the myconf array is declared in src_configure
928 + myconf=( "${myconf[@]}" "$@" )
929 +}
930 +
931 +src_configure() {
932 + declare -a myconf
933 +
934 + export LC_ALL="C"
935 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
936 +
937 + # some arches and -O do not mix :)
938 + use ppc && replace-flags -O? -O1
939 + # Perl has problems compiling with -Os in your flags with glibc
940 + use elibc_uclibc || replace-flags "-Os" "-O2"
941 + # This flag makes compiling crash in interesting ways
942 + filter-flags "-malign-double"
943 + # Fixes bug #97645
944 + use ppc && filter-flags "-mpowerpc-gpopt"
945 + # Fixes bug #143895 on gcc-4.1.1
946 + filter-flags "-fsched2-use-superblocks"
947 +
948 + use sparc && myconf -Ud_longdbl
949 +
950 + # 266337
951 + export BUILD_BZIP2=0
952 + export BZIP2_INCLUDE=${EPREFIX}/usr/include
953 + export BZIP2_LIB=${EPREFIX}/usr/$(get_libdir)
954 + cat <<-EOF > "${S}/cpan/Compress-Raw-Zlib/config.in"
955 + BUILD_ZLIB = False
956 + INCLUDE = ${EPREFIX}/usr/include
957 + LIB = ${EPREFIX}/usr/$(get_libdir)
958 +
959 + OLD_ZLIB = False
960 + GZIP_OS_CODE = AUTO_DETECT
961 + EOF
962 +
963 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
964 +
965 + myndbm='U'
966 + mygdbm='U'
967 + mydb='U'
968 +
969 + if use gdbm ; then
970 + mygdbm='D'
971 + myndbm='D'
972 + fi
973 + if use berkdb ; then
974 + mydb='D'
975 + has_version '=sys-libs/db-1*' && myndbm='D'
976 + fi
977 +
978 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
979 +
980 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
981 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
982 + myconf -Ui_db -Ui_ndbm
983 + fi
984 +
985 + use ithreads && myconf -Dusethreads
986 +
987 + if use debug ; then
988 + append-cflags "-g"
989 + myconf -DDEBUGGING
990 + elif [[ ${CFLAGS} == *-g* ]] ; then
991 + myconf -DDEBUGGING=-g
992 + else
993 + myconf -DDEBUGGING=none
994 + fi
995 +
996 + if [[ -n ${PERL_OLDVERSEN} ]] ; then
997 + local inclist=$(for v in ${PERL_OLDVERSEN}; do echo -n "${v}/${myarch}${mythreading} ${v} "; done )
998 + myconf -Dinc_version_list="${inclist}"
999 + fi
1000 +
1001 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
1002 +
1003 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
1004 + # Prefix itself we don't do multilib either, so make sure perl can find
1005 + # something compatible.
1006 + if use prefix ; then
1007 + local ldir
1008 + local llib
1009 + local paths=""
1010 + echo "int main() {}" > "${T}"/t.c
1011 + # need to ensure dirs contain compatible libs, bug #358875
1012 + for ldir in /lib /usr/lib /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 ; do
1013 + [[ -d ${ldir} ]] || continue
1014 + # find a random lib from here
1015 + llib=( ${ldir}/*$(get_libname) )
1016 + [[ -e ${llib[0]} ]] || continue
1017 + $(tc-getCC) -o "${T}"/t "${T}"/t.c ${llib[0]} >& /dev/null \
1018 + && paths="${paths} ${ldir}"
1019 + done
1020 + myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
1021 + elif [[ $(get_libdir) != "lib" ]] ; then
1022 + # We need to use " and not ', as the written config.sh use ' ...
1023 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
1024 + fi
1025 +
1026 + # don't try building ODBM, bug #354453
1027 + myconf -Dnoextensions=ODBM_File
1028 +
1029 + sh Configure \
1030 + -des \
1031 + -Duseshrplib \
1032 + -Darchname="${myarch}" \
1033 + -Dcc="$(tc-getCC)" \
1034 + -Doptimize="${CFLAGS}" \
1035 + -Dldflags="${LDFLAGS}" \
1036 + -Dprefix="${EPREFIX}"'/usr' \
1037 + -Dinstallprefix="${EPREFIX}"'/usr' \
1038 + -Dsiteprefix="${EPREFIX}"'/usr' \
1039 + -Dvendorprefix="${EPREFIX}"'/usr' \
1040 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
1041 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
1042 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
1043 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
1044 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
1045 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
1046 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
1047 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
1048 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
1049 + -Dsiteman1dir="${EPREFIX}"/usr/share/man/man1 \
1050 + -Dsiteman3dir="${EPREFIX}"/usr/share/man/man3 \
1051 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
1052 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
1053 + -Dman1ext='1' \
1054 + -Dman3ext='3pm' \
1055 + -Dlibperl="${LIBPERL}" \
1056 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
1057 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
1058 + -Duselargefiles \
1059 + -Dd_semctl_semun \
1060 + -Dcf_by='Gentoo' \
1061 + -Dmyhostname='localhost' \
1062 + -Dperladmin='root@localhost' \
1063 + -Dinstallusrbinperl='n' \
1064 + -Ud_csh \
1065 + -Uusenm \
1066 + "${myconf[@]}" || die "Unable to configure"
1067 +}
1068 +
1069 +src_test() {
1070 + if [[ ${EUID} == 0 ]] ; then
1071 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
1072 + return 0
1073 + fi
1074 + use elibc_uclibc && export MAKEOPTS+=" -j1"
1075 + TEST_JOBS=$(echo -j1 ${MAKEOPTS} | sed -r 's/.*(-j[[:space:]]*|--jobs=)([[:digit:]]+).*/\2/' ) \
1076 + make test_harness || die "test failed"
1077 +}
1078 +
1079 +src_install() {
1080 + local i
1081 + local coredir="${ARCH_LIB}/CORE"
1082 +
1083 + local installtarget=install
1084 + if use build ; then
1085 + installtarget=install.perl
1086 + fi
1087 + emake DESTDIR="${D}" ${installtarget}
1088 +
1089 + rm -f "${ED}"/usr/bin/perl
1090 + ln -s perl${MY_PV} "${ED}"/usr/bin/perl || die
1091 +
1092 + if ! tc-is-static-only ; then
1093 + dolib.so "${ED}"${coredir}/${LIBPERL}
1094 + rm -f "${ED}"${coredir}/${LIBPERL}
1095 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
1096 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
1097 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
1098 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
1099 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
1100 + fi
1101 +
1102 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
1103 +
1104 +# # A poor fix for the miniperl issues
1105 +# dosed 's:./miniperl:/usr/bin/perl:' /usr/$(get_libdir)/perl5/${MY_PV}/ExtUtils/xsubpp
1106 +# fperms 0444 /usr/$(get_libdir)/perl5/${MY_PV}/ExtUtils/xsubpp
1107 +# dosed 's:./miniperl:/usr/bin/perl:' /usr/bin/xsubpp
1108 +# fperms 0755 /usr/bin/xsubpp
1109 +
1110 + # This removes ${D} from Config.pm
1111 + for i in $(find "${D}" -iname "Config.pm" ) ; do
1112 + einfo "Removing ${D} from ${i}..."
1113 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
1114 + done
1115 +
1116 + find "${ED}" -type f -name .packlist -delete || die
1117 +
1118 + # Note: find out from psm why we would need/want this.
1119 + # ( use berkdb && has_version '=sys-libs/db-1*' ) ||
1120 + # find "${ED}" -name "*NDBM*" | xargs rm -f
1121 +
1122 + dodoc Changes* README AUTHORS
1123 +
1124 + if use doc ; then
1125 + # HTML Documentation
1126 + # We expect errors, warnings, and such with the following.
1127 +
1128 + dodir /usr/share/doc/${PF}/html
1129 + LD_LIBRARY_PATH=. ./perl installhtml \
1130 + --podroot='.' \
1131 + --podpath='lib:ext:pod:vms' \
1132 + --recurse \
1133 + --htmldir="${ED}/usr/share/doc/${PF}/html" \
1134 + --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
1135 + fi
1136 +
1137 + if use build ; then
1138 + src_remove_extra_files
1139 + fi
1140 +
1141 + dual_scripts
1142 +}
1143 +
1144 +pkg_postinst() {
1145 + dual_scripts
1146 +
1147 + if [[ "${ROOT}" = "/" ]] ; then
1148 + local INC DIR file
1149 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
1150 + einfo "Removing old .ph files"
1151 + for DIR in ${INC} ; do
1152 + if [[ -d "${DIR}" ]] ; then
1153 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
1154 + rm -f "${file}"
1155 + einfo "<< ${file}"
1156 + done
1157 + fi
1158 + done
1159 + # Silently remove the now empty dirs
1160 + for DIR in ${INC} ; do
1161 + if [[ -d "${DIR}" ]] ; then
1162 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
1163 + fi
1164 + done
1165 +# if ! use build ; then
1166 +# ebegin "Generating ConfigLocal.pm (ignore any error)"
1167 +# enc2xs -C
1168 +# fi
1169 +
1170 + einfo "Converting C header files to the corresponding Perl format (ignore any error)"
1171 + # Prefix note: unprefixed as this is all kernel/libc stuff that we never provide
1172 + pushd /usr/include >/dev/null
1173 + h2ph -Q -a -d "${EPREFIX}"${ARCH_LIB} \
1174 + asm/termios.h syscall.h syslimits.h syslog.h sys/ioctl.h \
1175 + sys/socket.h sys/time.h wait.h sysexits.h
1176 + popd >/dev/null
1177 +
1178 +# This has been moved into a function because rumor has it that a future release
1179 +# of portage will allow us to check what version was just removed - which means
1180 +# we will be able to invoke this only as needed :)
1181 + # Tried doing this via -z, but $INC is too big...
1182 + #if [[ "${INC}x" != "x" ]]; then
1183 + # cleaner_msg
1184 + #fi
1185 + fi
1186 +}
1187 +
1188 +pkg_postrm(){
1189 + dual_scripts
1190 +
1191 +# if [[ -e ${ARCH_LIB}/Encode/ConfigLocal.pm ]] ; then
1192 +# ebegin "Removing ConfigLocal.pm"
1193 +# rm "${ARCH_LIB}/Encode/ConfigLocal.pm"
1194 +# fi
1195 +}
1196 +
1197 +cleaner_msg() {
1198 + eerror "You have had multiple versions of perl. It is recommended"
1199 + eerror "that you run perl-cleaner now. perl-cleaner will"
1200 + eerror "assist with this transition. This script is capable"
1201 + eerror "of cleaning out old .ph files, rebuilding modules for "
1202 + eerror "your new version of perl, as well as re-emerging"
1203 + eerror "applications that compiled against your old libperl$(get_libname)"
1204 + eerror
1205 + eerror "PLEASE DO NOT INTERRUPT THE RUNNING OF THIS SCRIPT."
1206 + eerror "Part of the rebuilding of applications compiled against "
1207 + eerror "your old libperl involves temporarily unmerging"
1208 + eerror "them - interruptions could leave you with unmerged"
1209 + eerror "packages before they can be remerged."
1210 + eerror ""
1211 + eerror "If you have run perl-cleaner and a package still gives"
1212 + eerror "you trouble, and re-emerging it fails to correct"
1213 + eerror "the problem, please check http://bugs.gentoo.org/"
1214 + eerror "for more information or to report a bug."
1215 + eerror ""
1216 +}
1217 +
1218 +src_remove_dual_file() {
1219 + local i pkg ver
1220 + pkg="$1"
1221 + ver="$2"
1222 + shift 2
1223 + case "${EBUILD_PHASE:-none}" in
1224 + postinst|postrm)
1225 + for i in "$@" ; do
1226 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
1227 + done
1228 + ;;
1229 + setup)
1230 + for i in "$@" ; do
1231 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
1232 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
1233 + break
1234 + fi
1235 + done
1236 + ;;
1237 + install)
1238 + for i in "$@" ; do
1239 + if ! [[ -f "${ED}"${i} ]] ; then
1240 + use build || ewarn "${i} does not exist!"
1241 + continue
1242 + fi
1243 + mv "${ED}"${i}{,-${ver}-${P}} || die
1244 + done
1245 + ;;
1246 + esac
1247 +}
1248 +
1249 +src_remove_dual_man() {
1250 + local i pkg ver ff
1251 + pkg="$1"
1252 + ver="$2"
1253 + shift 2
1254 + case "${EBUILD_PHASE:-none}" in
1255 + postinst|postrm)
1256 + for i in "$@" ; do
1257 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
1258 + ff=${ff##*${i#${i%.[0-9]}}}
1259 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
1260 + done
1261 + ;;
1262 + install)
1263 + for i in "$@" ; do
1264 + if ! [[ -f "${ED}"${i} ]] ; then
1265 + use build || ewarn "${i} does not exist!"
1266 + continue
1267 + fi
1268 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
1269 + done
1270 + ;;
1271 + esac
1272 +}
1273 +
1274 +src_remove_dual() {
1275 + local i pkg ver
1276 + pkg="$1"
1277 + ver="$2"
1278 + shift 2
1279 + for i in "$@" ; do
1280 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
1281 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
1282 + done
1283 +}
1284 +
1285 +src_remove_extra_files() {
1286 + local prefix="./usr" # ./ is important
1287 + local bindir="${prefix}/bin"
1288 + local libdir="${prefix}/$(get_libdir)"
1289 +
1290 + # I made this list from the Mandr*, Debian and ex-Connectiva perl-base list
1291 + # Then, I added several files to get GNU autotools running
1292 + # FIXME: should this be in a separated file to be sourced?
1293 + local MINIMAL_PERL_INSTALL="
1294 + ${bindir}/h2ph
1295 + ${bindir}/perl
1296 + ${bindir}/perl${MY_PV}
1297 + ${bindir}/pod2man
1298 + ${libdir}/${LIBPERL}
1299 + ${libdir}/libperl$(get_libname)
1300 + ${libdir}/libperl$(get_libname ${SHORT_PV})
1301 + .${PRIV_LIB}/AutoLoader.pm
1302 + .${PRIV_LIB}/B/Deparse.pm
1303 + .${PRIV_LIB}/Carp.pm
1304 + .${PRIV_LIB}/Carp/Heavy.pm
1305 + .${PRIV_LIB}/Class/Struct.pm
1306 + .${PRIV_LIB}/DirHandle.pm
1307 + .${PRIV_LIB}/Exporter.pm
1308 + .${PRIV_LIB}/Exporter/Heavy.pm
1309 + .${PRIV_LIB}/ExtUtils/Command.pm
1310 + .${PRIV_LIB}/ExtUtils/Command/MM.pm
1311 + .${PRIV_LIB}/ExtUtils/Constant.pm
1312 + .${PRIV_LIB}/ExtUtils/Constant/Base.pm
1313 + .${PRIV_LIB}/ExtUtils/Constant/Utils.pm
1314 + .${PRIV_LIB}/ExtUtils/Constant/XS.pm
1315 + .${PRIV_LIB}/ExtUtils/Embed.pm
1316 + .${PRIV_LIB}/ExtUtils/Install.pm
1317 + .${PRIV_LIB}/ExtUtils/Installed.pm
1318 + .${PRIV_LIB}/ExtUtils/Liblist.pm
1319 + .${PRIV_LIB}/ExtUtils/Liblist/Kid.pm
1320 + .${PRIV_LIB}/ExtUtils/MM.pm
1321 + .${PRIV_LIB}/ExtUtils/MM_Any.pm
1322 + .${PRIV_LIB}/ExtUtils/MM_MacOS.pm
1323 + .${PRIV_LIB}/ExtUtils/MM_Unix.pm
1324 + .${PRIV_LIB}/ExtUtils/MY.pm
1325 + .${PRIV_LIB}/ExtUtils/MakeMaker.pm
1326 + .${PRIV_LIB}/ExtUtils/MakeMaker/Config.pm
1327 + .${PRIV_LIB}/ExtUtils/Manifest.pm
1328 + .${PRIV_LIB}/ExtUtils/Miniperl.pm
1329 + .${PRIV_LIB}/ExtUtils/Mkbootstrap.pm
1330 + .${PRIV_LIB}/ExtUtils/Mksymlists.pm
1331 + .${PRIV_LIB}/ExtUtils/Packlist.pm
1332 + .${PRIV_LIB}/ExtUtils/testlib.pm
1333 + .${PRIV_LIB}/File/Basename.pm
1334 + .${PRIV_LIB}/File/Compare.pm
1335 + .${PRIV_LIB}/File/Copy.pm
1336 + .${PRIV_LIB}/File/Find.pm
1337 + .${PRIV_LIB}/File/Path.pm
1338 + .${PRIV_LIB}/File/stat.pm
1339 + .${PRIV_LIB}/FileHandle.pm
1340 + .${PRIV_LIB}/Getopt/Long.pm
1341 + .${PRIV_LIB}/Getopt/Std.pm
1342 + .${PRIV_LIB}/IPC/Open2.pm
1343 + .${PRIV_LIB}/IPC/Open3.pm
1344 + .${PRIV_LIB}/PerlIO.pm
1345 + .${PRIV_LIB}/Pod/InputObjects.pm
1346 + .${PRIV_LIB}/Pod/Man.pm
1347 + .${PRIV_LIB}/Pod/ParseLink.pm
1348 + .${PRIV_LIB}/Pod/Parser.pm
1349 + .${PRIV_LIB}/Pod/Select.pm
1350 + .${PRIV_LIB}/Pod/Text.pm
1351 + .${PRIV_LIB}/Pod/Usage.pm
1352 + .${PRIV_LIB}/SelectSaver.pm
1353 + .${PRIV_LIB}/Symbol.pm
1354 + .${PRIV_LIB}/Text/ParseWords.pm
1355 + .${PRIV_LIB}/Text/Tabs.pm
1356 + .${PRIV_LIB}/Text/Wrap.pm
1357 + .${PRIV_LIB}/Tie/Hash.pm
1358 + .${PRIV_LIB}/Time/Local.pm
1359 + .${PRIV_LIB}/XSLoader.pm
1360 + .${PRIV_LIB}/autouse.pm
1361 + .${PRIV_LIB}/base.pm
1362 + .${PRIV_LIB}/bigint.pm
1363 + .${PRIV_LIB}/bignum.pm
1364 + .${PRIV_LIB}/bigrat.pm
1365 + .${PRIV_LIB}/blib.pm
1366 + .${PRIV_LIB}/bytes.pm
1367 + .${PRIV_LIB}/bytes_heavy.pl
1368 + .${PRIV_LIB}/charnames.pm
1369 + .${PRIV_LIB}/constant.pm
1370 + .${PRIV_LIB}/diagnostics.pm
1371 + .${PRIV_LIB}/fields.pm
1372 + .${PRIV_LIB}/filetest.pm
1373 + .${PRIV_LIB}/if.pm
1374 + .${PRIV_LIB}/integer.pm
1375 + .${PRIV_LIB}/less.pm
1376 + .${PRIV_LIB}/locale.pm
1377 + .${PRIV_LIB}/open.pm
1378 + .${PRIV_LIB}/overload.pm
1379 + .${PRIV_LIB}/sigtrap.pm
1380 + .${PRIV_LIB}/sort.pm
1381 + .${PRIV_LIB}/stat.pl
1382 + .${PRIV_LIB}/strict.pm
1383 + .${PRIV_LIB}/subs.pm
1384 + .${PRIV_LIB}/unicore/To/Fold.pl
1385 + .${PRIV_LIB}/unicore/To/Lower.pl
1386 + .${PRIV_LIB}/unicore/To/Upper.pl
1387 + .${PRIV_LIB}/utf8.pm
1388 + .${PRIV_LIB}/utf8_heavy.pl
1389 + .${PRIV_LIB}/vars.pm
1390 + .${PRIV_LIB}/vmsish.pm
1391 + .${PRIV_LIB}/warnings
1392 + .${PRIV_LIB}/warnings.pm
1393 + .${PRIV_LIB}/warnings/register.pm
1394 + .${ARCH_LIB}/B.pm
1395 + .${ARCH_LIB}/CORE/libperl$(get_libname)
1396 + .${ARCH_LIB}/Config.pm
1397 + .${ARCH_LIB}/Config_heavy.pl
1398 + .${ARCH_LIB}/Cwd.pm
1399 + .${ARCH_LIB}/Data/Dumper.pm
1400 + .${ARCH_LIB}/DynaLoader.pm
1401 + .${ARCH_LIB}/Errno.pm
1402 + .${ARCH_LIB}/Fcntl.pm
1403 + .${ARCH_LIB}/File/Glob.pm
1404 + .${ARCH_LIB}/File/Spec.pm
1405 + .${ARCH_LIB}/File/Spec/Unix.pm
1406 + .${ARCH_LIB}/IO.pm
1407 + .${ARCH_LIB}/IO/File.pm
1408 + .${ARCH_LIB}/IO/Handle.pm
1409 + .${ARCH_LIB}/IO/Pipe.pm
1410 + .${ARCH_LIB}/IO/Seekable.pm
1411 + .${ARCH_LIB}/IO/Select.pm
1412 + .${ARCH_LIB}/IO/Socket.pm
1413 + .${ARCH_LIB}/IO/Socket/INET.pm
1414 + .${ARCH_LIB}/IO/Socket/UNIX.pm
1415 + .${ARCH_LIB}/List/Util.pm
1416 + .${ARCH_LIB}/NDBM_File.pm
1417 + .${ARCH_LIB}/POSIX.pm
1418 + .${ARCH_LIB}/Scalar/Util.pm
1419 + .${ARCH_LIB}/Socket.pm
1420 + .${ARCH_LIB}/Storable.pm
1421 + .${ARCH_LIB}/attributes.pm
1422 + .${ARCH_LIB}/auto/Cwd/Cwd$(get_libname)
1423 + .${ARCH_LIB}/auto/Data/Dumper/Dumper$(get_libname)
1424 + .${ARCH_LIB}/auto/DynaLoader/dl_findfile.al
1425 + .${ARCH_LIB}/auto/Fcntl/Fcntl$(get_libname)
1426 + .${ARCH_LIB}/auto/File/Glob/Glob$(get_libname)
1427 + .${ARCH_LIB}/auto/IO/IO$(get_libname)
1428 + .${ARCH_LIB}/auto/POSIX/POSIX$(get_libname)
1429 + .${ARCH_LIB}/auto/POSIX/autosplit.ix
1430 + .${ARCH_LIB}/auto/POSIX/fstat.al
1431 + .${ARCH_LIB}/auto/POSIX/load_imports.al
1432 + .${ARCH_LIB}/auto/POSIX/stat.al
1433 + .${ARCH_LIB}/auto/POSIX/tmpfile.al
1434 + .${ARCH_LIB}/auto/Socket/Socket$(get_libname)
1435 + .${ARCH_LIB}/auto/Storable/Storable$(get_libname)
1436 + .${ARCH_LIB}/auto/Storable/_retrieve.al
1437 + .${ARCH_LIB}/auto/Storable/_store.al
1438 + .${ARCH_LIB}/auto/Storable/autosplit.ix
1439 + .${ARCH_LIB}/auto/Storable/retrieve.al
1440 + .${ARCH_LIB}/auto/Storable/store.al
1441 + .${ARCH_LIB}/auto/re/re$(get_libname)
1442 + .${ARCH_LIB}/encoding.pm
1443 + .${ARCH_LIB}/lib.pm
1444 + .${ARCH_LIB}/ops.pm
1445 + .${ARCH_LIB}/re.pm
1446 + .${ARCH_LIB}/threads.pm
1447 +"
1448 +
1449 + pushd "${ED}" > /dev/null
1450 + # Remove cruft
1451 + einfo "Removing files that are not in the minimal install"
1452 + echo "${MINIMAL_PERL_INSTALL}"
1453 + for f in $(find . -type f ) ; do
1454 + has "${f}" ${MINIMAL_PERL_INSTALL} || rm -f "${f}"
1455 + done
1456 + # Remove empty directories
1457 + find . -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
1458 + #for f in ${MINIMAL_PERL_INSTALL} ; do
1459 + # [[ -e ${f} ]] || ewarn "${f} unused in MINIMAL_PERL_INSTALL"
1460 + #done
1461 + popd > /dev/null
1462 +}