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/5.28/, dev-lang/perl/
Date: Sat, 13 Apr 2019 19:22:14
Message-Id: 1555183321.06a80830f0d333bc4f4af5f8d1960f8e9f014a8a.anarchy@gentoo
1 commit: 06a80830f0d333bc4f4af5f8d1960f8e9f014a8a
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 13 19:22:01 2019 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 13 19:22:01 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=06a80830
7
8 dev-lang/perl: 5.28.1 security bump, musl fixes
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.28/perl-5.28.1-part1.patch | 75 +++
15 dev-lang/perl/files/5.28/perl-5.28.1-part2.patch | 27 +
16 dev-lang/perl/files/5.28/perl-5.28.1-part3.patch | 88 +++
17 dev-lang/perl/files/5.28/perl-5.28.1-part4.patch | 103 ++++
18 dev-lang/perl/files/5.28/perl-5.28.1-part5.patch | 35 ++
19 dev-lang/perl/perl-5.28.1.ebuild | 654 +++++++++++++++++++++++
20 7 files changed, 985 insertions(+)
21
22 diff --git a/dev-lang/perl/Manifest b/dev-lang/perl/Manifest
23 index ad86139..2cf2ef2 100644
24 --- a/dev-lang/perl/Manifest
25 +++ b/dev-lang/perl/Manifest
26 @@ -1,3 +1,6 @@
27 DIST perl-5.26.2-patches-1.tar.xz 17100 BLAKE2B 681239e438945285e006ee1d1e2a9eb888fc9b425e6fbd4822e65e1fe1ced2216de76485b9792d3fee28783a588c09e1d34c294ef43d81055c4566af37fe9b6c SHA512 2a274150d2dba406c6efb67ec236f67032a51ff1788b30ea556e74b2f02fab68f5029ebd4b9d4daeb16b3a63fa7aa1744d323bf637a9d21946f19f33b69da245
28 DIST perl-5.26.3.tar.xz 11957032 BLAKE2B 3cd5332a0bede16608b1626b0b9903d71105784411c7acf2fd8c0e7637a2ab5049e650bdaba574584ed51a70cc21dfbee5557963717d52c4af9c8bd8e8ef80a1 SHA512 1126ead4f9cc313548e875b6dc9cd1f56f6fef4406f3fd1c108c5cad0db92c8cd0f9bde5b82d78d8f2bd67709c438e87dd45f26b98f327ba31b05b39acc3b299
29 +DIST perl-5.28.0-patches-1.tar.xz 17128 BLAKE2B f16843d9ecf27fa7d42dd59e1591d618ba9ad6b14f4e56bab4019af043eb79559cc7dbc4a1b1e580c18b7ba0b5d71c4da3e3f94955889629a655e7028492a066 SHA512 e05a492ba045ac71d20393099815bed8e4f491bed79a352e83537561eb256d4f672e0125c5cca9e45150c01d3ad463a070a49e845b3c17806d9f77a872d0352a
30 +DIST perl-5.28.1.tar.xz 12372080 BLAKE2B cb487edae4707277995ba098e281efe00a38d671db5e5b08161b202c0fe3136a3e92f04ca3a810bbd5fca9fe5b950376716bcbdd5417bd4042a0ef6c6eef57df SHA512 6d18e9684c3a15bea2ccd28f116d1829c3acd5547551ee3539f0060c0d1a75246dfe570dfb9d5f00625a994a0afb0cbd6a5a5f9a407fef75a421e7dbc6491b43
31 DIST perl-cross-1.1.9.tar.gz 102939 BLAKE2B 438ea75a14c4d60fdf3cb2f3671c736d229a83af210ba4fe6e79b989c6c4b45500d0221ec65bc71e1d43d234ec1daa20b3a19be6ceb01e638810900dbe3664a7 SHA512 002441012bd31f1ea71341707d91f89b76266c187c9d28f947ed5eddbcc6e3155e8dfd4b1814331561c3557764fea25bf6a938f08bcd4adfb5895361ad5a269a
32 +DIST perl-cross-1.2.2.tar.gz 106073 BLAKE2B c4eaf5d60dd0ac88a9653cea399f5583a699d35f94a69a36ef9d3cde0017901ff68029f12a3af6e0fd34d46accbb6be009167fadb790da8065f6b85115f1c9b8 SHA512 49dc190018b891daac68a954e2a9bab6294920f02b585c530dcc47af03e8ab51d402455202d45121fa206ee743986ddd50323658c179d2c15cb6af7a2eb0958c
33
34 diff --git a/dev-lang/perl/files/5.28/perl-5.28.1-part1.patch b/dev-lang/perl/files/5.28/perl-5.28.1-part1.patch
35 new file mode 100644
36 index 0000000..5ac0e85
37 --- /dev/null
38 +++ b/dev-lang/perl/files/5.28/perl-5.28.1-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.28/perl-5.28.1-part2.patch b/dev-lang/perl/files/5.28/perl-5.28.1-part2.patch
117 new file mode 100644
118 index 0000000..c2c49b6
119 --- /dev/null
120 +++ b/dev-lang/perl/files/5.28/perl-5.28.1-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.28/perl-5.28.1-part3.patch b/dev-lang/perl/files/5.28/perl-5.28.1-part3.patch
151 new file mode 100644
152 index 0000000..3e31c1d
153 --- /dev/null
154 +++ b/dev-lang/perl/files/5.28/perl-5.28.1-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.28/perl-5.28.1-part4.patch b/dev-lang/perl/files/5.28/perl-5.28.1-part4.patch
246 new file mode 100644
247 index 0000000..17f62ab
248 --- /dev/null
249 +++ b/dev-lang/perl/files/5.28/perl-5.28.1-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 ad17948a2c..b91d1565b1 100755
270 +--- a/Configure
271 ++++ b/Configure
272 +@@ -16177,8 +16177,25 @@ case "$d_memmem_proto" in
273 + esac
274 +
275 + : see if memrchr exists
276 +-set memrchr d_memrchr
277 +-eval $inlibc
278 ++: We need both a prototype in string.h and the symbol in libc.
279 ++echo " "
280 ++d_memrchr_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_memrchr_proto memrchr literal "$xx1" literal "$xx2" literal "$xx3" literal "$xx4" define string.h
286 ++eval $hasproto
287 ++case "$d_memrchr_proto" in
288 ++ define) # see if memrchr exists
289 ++ set memrchr d_memrchr
290 ++ eval $inlibc
291 ++ ;;
292 ++ *) val=$undef
293 ++ set d_memrchr
294 ++ eval $setvar
295 ++ ;;
296 ++esac
297 +
298 + : see if mkdir exists
299 + set mkdir d_mkdir
300 +@@ -18787,12 +18804,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 strnlen exists
350 + set strnlen d_strnlen
351 +--
352 +2.15.1-424-g9478a660812
353 +
354
355 diff --git a/dev-lang/perl/files/5.28/perl-5.28.1-part5.patch b/dev-lang/perl/files/5.28/perl-5.28.1-part5.patch
356 new file mode 100644
357 index 0000000..e9cac65
358 --- /dev/null
359 +++ b/dev-lang/perl/files/5.28/perl-5.28.1-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/perl-5.28.1.ebuild b/dev-lang/perl/perl-5.28.1.ebuild
398 new file mode 100644
399 index 0000000..05c722d
400 --- /dev/null
401 +++ b/dev-lang/perl/perl-5.28.1.ebuild
402 @@ -0,0 +1,654 @@
403 +# Copyright 1999-2019 Gentoo Authors
404 +# Distributed under the terms of the GNU General Public License v2
405 +
406 +EAPI=6
407 +
408 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
409 +
410 +PATCH_VER=1
411 +CROSS_VER=1.2.2
412 +PATCH_BASE="perl-5.28.0-patches-${PATCH_VER}"
413 +
414 +PATCHES=( "${FILESDIR}"/5.28/${PN}-5.28.1-part{1,2,3,4,5}.patch )
415 +
416 +DIST_AUTHOR=XSAWYERX
417 +
418 +# Greatest first, don't include yourself
419 +# Devel point-releases are not ABI-intercompatible, but stable point releases are
420 +# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
421 +PERL_BIN_OLDVERSEN=""
422 +if [[ "${PV##*.}" == "9999" ]]; then
423 + DIST_VERSION=5.28.0
424 +else
425 + DIST_VERSION="${PV/_rc/-RC}"
426 +fi
427 +SHORT_PV="${DIST_VERSION%.*}"
428 +# Even numbered major versions are ABI intercompatible
429 +# Odd numbered major versions are not
430 +if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
431 + SUBSLOT="${DIST_VERSION%-RC*}"
432 +else
433 + SUBSLOT="${DIST_VERSION%.*}"
434 +fi
435 +# Used only in tar paths
436 +MY_P="perl-${DIST_VERSION}"
437 +# Used in library paths
438 +MY_PV="${DIST_VERSION%-RC*}"
439 +
440 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
441 +
442 +SRC_URI="
443 + mirror://cpan/src/5.0/${MY_P}.tar.xz
444 + mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
445 + https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz
446 + mirror://gentoo/${PATCH_BASE}.tar.xz
447 + https://dev.gentoo.org/~kentnl/distfiles/${PATCH_BASE}.tar.xz
448 + https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
449 +"
450 +HOMEPAGE="https://www.perl.org/"
451 +
452 +LICENSE="|| ( Artistic GPL-1+ )"
453 +SLOT="0/${SUBSLOT}"
454 +
455 +if [[ "${PV##*.}" != "9999" ]]; then
456 +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"
457 +fi
458 +
459 +IUSE="berkdb debug doc gdbm ithreads"
460 +
461 +RDEPEND="
462 + berkdb? ( sys-libs/db:= )
463 + gdbm? ( >=sys-libs/gdbm-1.8.3:= )
464 + app-arch/bzip2
465 + sys-libs/zlib
466 +"
467 +DEPEND="${RDEPEND}
468 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
469 +"
470 +PDEPEND="
471 + >=app-admin/perl-cleaner-2.5
472 + >=virtual/perl-File-Temp-0.230.400-r2
473 + >=virtual/perl-Data-Dumper-2.154.0
474 + virtual/perl-Test-Harness
475 +"
476 +# bug 390719, bug 523624
477 +# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
478 +
479 +S="${WORKDIR}/${MY_P}"
480 +
481 +dual_scripts() {
482 + src_remove_dual perl-core/Archive-Tar 2.280.0 ptar ptardiff ptargrep
483 + src_remove_dual perl-core/CPAN 2.200.0 cpan
484 + src_remove_dual perl-core/Digest-SHA 6.10.0 shasum
485 + src_remove_dual perl-core/Encode 2.970.0 enc2xs piconv
486 + src_remove_dual perl-core/ExtUtils-MakeMaker 7.340.0 instmodsh
487 + src_remove_dual perl-core/ExtUtils-ParseXS 3.390.0 xsubpp
488 + src_remove_dual perl-core/IO-Compress 2.74.0 zipdetails
489 + src_remove_dual perl-core/JSON-PP 2.970.10 json_pp
490 + src_remove_dual perl-core/Module-CoreList 5.201.806.220 corelist
491 + src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect
492 + src_remove_dual perl-core/Pod-Perldoc 3.280.100 perldoc
493 + src_remove_dual perl-core/Test-Harness 3.420.0 prove
494 + src_remove_dual perl-core/podlators 4.100.0 pod2man pod2text
495 + src_remove_dual_man perl-core/podlators 4.100.0 /usr/share/man/man1/perlpodstyle.1
496 +}
497 +
498 +check_rebuild() {
499 + # Fresh install
500 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
501 + return 0;
502 + # Major Upgrade
503 + # doesn't matter if there's multiple copies, it still needs a rebuild
504 + # if the string is anything other than "5.CURRENTMAJOR"
505 + elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
506 + echo ""
507 + ewarn "UPDATE THE PERL MODULES:"
508 + ewarn "After updating dev-lang/perl the installed Perl modules"
509 + ewarn "have to be re-installed. In most cases, this is done automatically"
510 + ewarn "by the package manager, but subsequent steps are still recommended"
511 + ewarn "to ensure system consistency."
512 + ewarn
513 + ewarn "You should start with a depclean to remove any unused perl dependencies"
514 + ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
515 + ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
516 + ewarn "Recommended: emerge --depclean -va"
517 + ewarn
518 + ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
519 + ewarn "remaining rebuilds portage may have missed."
520 + ewarn "Use: perl-cleaner --all"
521 + return 0;
522 +
523 + # Reinstall w/ USE Change
524 + elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
525 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
526 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
527 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
528 + echo ""
529 + ewarn "TOGGLED USE-FLAGS WARNING:"
530 + ewarn "You changed one of the use-flags ithreads or debug."
531 + ewarn "You must rebuild all perl-modules installed."
532 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
533 + fi
534 +}
535 +
536 +pkg_setup() {
537 + case ${CHOST} in
538 + *-freebsd*) osname="freebsd" ;;
539 + *-dragonfly*) osname="dragonfly" ;;
540 + *-netbsd*) osname="netbsd" ;;
541 + *-openbsd*) osname="openbsd" ;;
542 + *-darwin*) osname="darwin" ;;
543 + *-solaris*) osname="solaris" ;;
544 + *-interix*) osname="interix" ;;
545 + *-aix*) osname="aix" ;;
546 + *-cygwin*) osname="cygwin" ;;
547 + *) osname="linux" ;;
548 + esac
549 +
550 + myarch="${CHOST%%-*}-${osname}"
551 + if use debug ; then
552 + myarch+="-debug"
553 + fi
554 + if use ithreads ; then
555 + mythreading="-multi"
556 + myarch+="-thread"
557 + fi
558 +
559 + PRIV_BASE="/usr/$(get_libdir)/perl5"
560 + SITE_BASE="/usr/local/$(get_libdir)/perl5"
561 + VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl"
562 +
563 + LIBPERL="libperl$(get_libname ${MY_PV} )"
564 + PRIV_LIB="${PRIV_BASE}/${MY_PV}"
565 + ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}"
566 + SITE_LIB="${SITE_BASE}/${MY_PV}"
567 + SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}"
568 + VENDOR_LIB="${VENDOR_BASE}/${MY_PV}"
569 + VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}"
570 +
571 + dual_scripts
572 +}
573 +
574 +src_remove_dual_file() {
575 + local i pkg ver
576 + pkg="$1"
577 + ver="$2"
578 + shift 2
579 + case "${EBUILD_PHASE:-none}" in
580 + postinst|postrm)
581 + for i in "$@" ; do
582 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
583 + done
584 + ;;
585 + setup)
586 + for i in "$@" ; do
587 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
588 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
589 + break
590 + fi
591 + done
592 + ;;
593 + install)
594 + for i in "$@" ; do
595 + if ! [[ -f "${ED}"${i} ]] ; then
596 + ewarn "${i} does not exist!"
597 + continue
598 + fi
599 + mv "${ED}"${i}{,-${ver}-${P}} || die
600 + done
601 + ;;
602 + esac
603 +}
604 +
605 +src_remove_dual_man() {
606 + local i pkg ver ff
607 + pkg="$1"
608 + ver="$2"
609 + shift 2
610 + case "${EBUILD_PHASE:-none}" in
611 + postinst|postrm)
612 + for i in "$@" ; do
613 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
614 + ff=${ff##*${i#${i%.[0-9]}}}
615 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
616 + done
617 + ;;
618 + install)
619 + for i in "$@" ; do
620 + if ! [[ -f "${ED}"${i} ]] ; then
621 + ewarn "${i} does not exist!"
622 + continue
623 + fi
624 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
625 + done
626 + ;;
627 + esac
628 +}
629 +
630 +src_remove_dual() {
631 + local i pkg ver
632 + pkg="$1"
633 + ver="$2"
634 + shift 2
635 + for i in "$@" ; do
636 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
637 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
638 + done
639 +}
640 +
641 +src_prepare_update_patchlevel_h() {
642 + # Copied and modified from debian:
643 + # Copyright 2011 Niko Tyni
644 + # This program is free software; you can redistribute it and/or modify
645 + # it under the same terms as Perl itself.
646 + local patchdir="${WORKDIR}/patches"
647 + local prefix
648 + local patchoutput="patchlevel-gentoo.h"
649 +
650 + [[ -f ${patchdir}/series ]] || return 0
651 +
652 +while read patch
653 +do
654 + patchname=$(echo $patch | sed 's/\.diff$//')
655 + < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e '
656 +
657 + # massage the patch headers
658 + s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend;
659 + s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend;
660 + s|^Bug-Gentoo: ||; tprepend;
661 + s/^\(Subject\|Description\): //; tappend;
662 + s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend;
663 +
664 + # post-process at the end of input
665 + $ { x;
666 + # include the version number in the patchlevel.h description (if available)
667 + s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/;
668 +
669 + # escape any backslashes and double quotes
670 + s|\\|\\\\|g; s|"|\\"|g;
671 +
672 + # add a prefix
673 + s|^|\t,"'"$prefix$patchname"' - |;
674 + # newlines away
675 + s/\n/ /g; s/ */ /g;
676 + # add a suffix
677 + s/ *$/"/; p
678 + };
679 + # stop all processing
680 + d;
681 + # label: append to the hold space
682 + :append H; d;
683 + # label: prepend to the hold space
684 + :prepend x; H; d;
685 + '
686 +done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}"
687 +echo "${patchoutput}" >> "${S}/MANIFEST"
688 +}
689 +
690 +src_prepare_perlcross() {
691 + cp -a ../perl-cross-${CROSS_VER}/* . || die
692 +
693 + # bug 604072
694 + MAKEOPTS+=" -j1"
695 + export MAKEOPTS
696 +}
697 +src_prepare_dynamic() {
698 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
699 + ln -s ${LIBPERL} libperl$(get_libname ) || die
700 +}
701 +
702 +src_prepare() {
703 + local patch
704 + EPATCH_OPTS+=" -p1"
705 +
706 + if use hppa ; then
707 + epatch "${FILESDIR}/${PN}-5.26.2-hppa.patch" # bug 634162
708 + fi
709 +
710 + if [[ ${CHOST} == *-solaris* ]] ; then
711 + # do NOT mess with nsl, on Solaris this is always necessary,
712 + # when -lsocket is used e.g. to get h_errno
713 + sed -i '/gentoo\/no-nsl\.patch/d' "${WORKDIR}/patches/series" || die
714 + fi
715 +
716 + einfo "Applying patches from ${PATCH_BASE} ..."
717 + while read patch ; do
718 + EPATCH_SINGLE_MSG=" ${patch} ..."
719 + epatch "${WORKDIR}"/patches/${patch}
720 + done < "${WORKDIR}"/patches/series
721 +
722 + src_prepare_update_patchlevel_h
723 +
724 + tc-is-cross-compiler && src_prepare_perlcross
725 +
726 + tc-is-static-only || src_prepare_dynamic
727 +
728 + if use gdbm; then
729 + sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \
730 + ext/NDBM_File/Makefile.PL || die
731 + fi
732 +
733 + # Use errno.h from prefix rather than from host system, bug #645804
734 + if use prefix && [[ -e "${EPREFIX}"/usr/include/errno.h ]] ; then
735 + sed -i "/my..sysroot/s:'':'${EPREFIX}':" ext/Errno/Errno_pm.PL || die
736 + fi
737 +
738 + if [[ ${CHOST} == *-solaris* ]] ; then
739 + # set a soname, fix linking against just built libperl
740 + sed -i -e 's/netbsd\*/netbsd*|solaris*/' Makefile.SH || die
741 + fi
742 +
743 + default
744 +}
745 +
746 +myconf() {
747 + # the myconf array is declared in src_configure
748 + myconf=( "${myconf[@]}" "$@" )
749 +}
750 +
751 +src_configure() {
752 + declare -a myconf
753 +
754 + export LC_ALL="C"
755 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
756 +
757 + # some arches and -O do not mix :)
758 + use ppc && replace-flags -O? -O1
759 +
760 + # Perl has problems compiling with -Os in your flags with glibc
761 + use elibc_uclibc || replace-flags "-Os" "-O2"
762 +
763 + # xlocale.h is going away in glibc-2.26, so it's counterproductive
764 + # if we use it and include it in CORE/perl.h ... Perl builds just
765 + # fine with glibc and locale.h only.
766 + # However, the darwin prefix people have no locale.h ...
767 + use elibc_glibc && myconf -Ui_xlocale
768 +
769 + # This flag makes compiling crash in interesting ways
770 + filter-flags "-malign-double"
771 +
772 + # Fixes bug #97645
773 + use ppc && filter-flags "-mpowerpc-gpopt"
774 +
775 + # Fixes bug #143895 on gcc-4.1.1
776 + filter-flags "-fsched2-use-superblocks"
777 +
778 + # Generic LTO broken since 5.28, triggers EUMM failures
779 + filter-flags "-flto"
780 +
781 + use sparc && myconf -Ud_longdbl
782 +
783 + export BUILD_BZIP2=0
784 + export BZIP2_INCLUDE=${EROOT}/usr/include
785 + export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
786 +
787 + export BUILD_ZLIB=False
788 + export ZLIB_INCLUDE=${EROOT}/usr/include
789 + export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
790 +
791 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
792 + myndbm='U'
793 + mygdbm='U'
794 + mydb='U'
795 + if use gdbm ; then
796 + mygdbm='D'
797 + if use berkdb ; then
798 + myndbm='D'
799 + fi
800 + fi
801 + if use berkdb ; then
802 + mydb='D'
803 + has_version '=sys-libs/db-1*' && myndbm='D'
804 + fi
805 +
806 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
807 +
808 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
809 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
810 + myconf -Ui_db -Ui_ndbm
811 + fi
812 +
813 + use ithreads && myconf -Dusethreads
814 +
815 + if use debug ; then
816 + append-cflags "-g"
817 + myconf -DDEBUGGING
818 + elif [[ ${CFLAGS} == *-g* ]] ; then
819 + myconf -DDEBUGGING=-g
820 + else
821 + myconf -DDEBUGGING=none
822 + fi
823 +
824 + # Autodiscover all old version directories, some of them will even be newer
825 + # if you downgrade
826 + if [[ -z ${PERL_OLDVERSEN} ]]; then
827 + PERL_OLDVERSEN="$(
828 + find "${EROOT%/}${PRIV_BASE}" "${EROOT%/}${SITE_BASE}" "${EROOT%/}${VENDOR_BASE}" \
829 + -maxdepth 1 -mindepth 1 -type d -regex '.*/5[.][0-9]+[.][0-9]+$' \
830 + -printf "%f " 2>/dev/null )"
831 + fi
832 + # Fixup versions, removing self match, fixing order and dupes
833 + PERL_OLDVERSEN="$(
834 + echo "${PERL_OLDVERSEN}" |\
835 + tr " " "\n" |\
836 + grep -vF "${DIST_VERSION%-RC}" |\
837 + sort -u -nr -t'.' -k1,1 -k2,2 -k3,3
838 + )"
839 +
840 + # Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string
841 + if [[ -n "${PERL_OLDVERSEN// }" ]]; then
842 + local inclist="$(
843 + for v in ${PERL_OLDVERSEN}; do
844 + has "${v}" ${PERL_BIN_OLDVERSEN} && echo -n "${v}/${myarch}${mythreading} ";
845 + echo -n "${v} ";
846 + done )"
847 + einfo "This version of perl may partially support modules previously"
848 + einfo "installed in any of the following paths:"
849 + for incpath in ${inclist}; do
850 + [[ -e "${EROOT%/}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${VENDOR_BASE}/${incpath}"
851 + [[ -e "${EROOT%/}${PRIV_BASE}/${incpath}" ]] && einfo " ${EROO%/T}${PRIV_BASE}/${incpath}"
852 + [[ -e "${EROOT%/}${SITE_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${SITE_BASE}/${incpath}"
853 + done
854 + einfo "This is a temporary measure and you should aim to cleanup these paths"
855 + einfo "via world updates and perl-cleaner"
856 + myconf -Dinc_version_list="${inclist}"
857 + fi
858 +
859 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
860 +
861 + # Make sure we can do the final link #523730, need to set deployment
862 + # target to override hardcoded 10.3 which breaks on modern OSX
863 + [[ ${CHOST} == *-darwin* ]] && \
864 + myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
865 +
866 + # Older macOS with non-Apple GCC chokes on inline in system headers
867 + # using c89 mode as injected by cflags.SH
868 + [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
869 + append-cflags -Dinline=__inline__
870 +
871 + # fix unaligned access misdetection
872 + # https://rt.perl.org/Public/Bug/Display.html?id=133495
873 + [[ ${CHOST} == sparc*-solaris* ]] && myconf "-Dd_u32align='define'"
874 +
875 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
876 + # Prefix itself we don't do multilib either, so make sure perl can find
877 + # something compatible.
878 + if use prefix ; then
879 + # Set a hook to check for each detected library whether it actually works.
880 + export libscheck="
881 + ( echo 'main(){}' > '${T}'/conftest.c &&
882 + $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
883 + ) || xxx=/dev/null"
884 +
885 + # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
886 + local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
887 + myconf "-Dlibpth="${EPREFIX}"/$(get_libdir) "${EPREFIX}"/usr/$(get_libdir) ${paths}"
888 + elif [[ $(get_libdir) != "lib" ]] ; then
889 + # We need to use " and not ', as the written config.sh use ' ...
890 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
891 + fi
892 +
893 + # don't try building ODBM, bug #354453
894 + disabled_extensions="ODBM_File"
895 +
896 + if ! use gdbm ; then
897 + # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
898 + disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
899 + fi
900 +
901 + myconf -Dnoextensions="${disabled_extensions}"
902 +
903 + [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
904 +
905 + [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
906 + # allow fiddling via EXTRA_ECONF, bug 558070
907 + eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
908 +
909 + myconf \
910 + -Duseshrplib \
911 + -Darchname="${myarch}" \
912 + -Dcc="$(tc-getCC)" \
913 + -Doptimize="${CFLAGS}" \
914 + -Dldflags="${LDFLAGS}" \
915 + -Dprefix="${EPREFIX}"'/usr' \
916 + -Dsiteprefix="${EPREFIX}"'/usr/local' \
917 + -Dvendorprefix="${EPREFIX}"'/usr' \
918 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
919 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
920 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
921 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
922 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
923 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
924 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
925 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
926 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
927 + -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
928 + -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
929 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
930 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
931 + -Dman1ext='1' \
932 + -Dman3ext='3pm' \
933 + -Dlibperl="${LIBPERL}" \
934 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
935 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
936 + -Duselargefiles \
937 + -Dd_semctl_semun \
938 + -Dcf_by='Gentoo' \
939 + -Dmyhostname='localhost' \
940 + -Dperladmin='root@localhost' \
941 + -Ud_csh \
942 + -Dsh="${EPREFIX}"/bin/sh \
943 + -Dtargetsh="${EPREFIX}"/bin/sh \
944 + -Uusenm \
945 + "${myconf[@]}" \
946 + "${EXTRA_ECONF[@]}"
947 +
948 + if tc-is-cross-compiler; then
949 + ./configure \
950 + --target="${CHOST}" \
951 + --build="${CBUILD}" \
952 + -Dinstallprefix='' \
953 + -Dinstallusrbinperl='undef' \
954 + -Dusevendorprefix='define' \
955 + "${myconf[@]}" \
956 + || die "Unable to configure"
957 + else
958 + sh Configure \
959 + -des \
960 + -Dinstallprefix="${EPREFIX}"'/usr' \
961 + -Dinstallusrbinperl='n' \
962 + "${myconf[@]}" \
963 + || die "Unable to configure"
964 + fi
965 +}
966 +
967 +src_test() {
968 + export NO_GENTOO_NETWORK_TESTS=1;
969 + export GENTOO_ASSUME_SANDBOXED="${GENTOO_ASSUME_SANDBOXED:-1}"
970 + export GENTOO_NO_PORTING_TESTS="${GENTOO_NO_PORTING_TESTS:-1}"
971 + if [[ ${EUID} == 0 ]] ; then
972 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
973 + return 0
974 + fi
975 + use elibc_uclibc && export MAKEOPTS+=" -j1"
976 + TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
977 +}
978 +
979 +src_install() {
980 + local i
981 + local coredir="${ARCH_LIB}/CORE"
982 +
983 + emake DESTDIR="${D}" install
984 +
985 + rm -f "${ED}/usr/bin/perl${MY_PV}"
986 + ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
987 +
988 + if ! tc-is-static-only ; then
989 + dolib.so "${ED}"${coredir}/${LIBPERL}
990 + rm -f "${ED}"${coredir}/${LIBPERL}
991 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
992 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
993 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
994 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
995 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
996 + fi
997 +
998 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
999 +
1000 + # This removes ${D} from Config.pm
1001 + for i in $(find "${D}" -iname "Config.pm" ) ; do
1002 + einfo "Removing ${D} from ${i}..."
1003 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
1004 + done
1005 +
1006 + dodoc Changes* README AUTHORS
1007 +
1008 + if use doc ; then
1009 + # HTML Documentation
1010 + # We expect errors, warnings, and such with the following.
1011 +
1012 + dodir /usr/share/doc/${PF}/html
1013 + LD_LIBRARY_PATH=. ./perl installhtml \
1014 + --podroot='.' \
1015 + --podpath='lib:ext:pod:vms' \
1016 + --recurse \
1017 + --htmldir="${ED}/usr/share/doc/${PF}/html"
1018 + fi
1019 +
1020 + [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
1021 +
1022 + dual_scripts
1023 +}
1024 +
1025 +pkg_preinst() {
1026 + check_rebuild
1027 +}
1028 +
1029 +pkg_postinst() {
1030 + dual_scripts
1031 +
1032 + if [[ "${ROOT}" = "/" ]] ; then
1033 + local INC DIR file
1034 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
1035 + einfo "Removing old .ph files"
1036 + for DIR in ${INC} ; do
1037 + if [[ -d "${DIR}" ]] ; then
1038 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
1039 + rm -f "${file}"
1040 + einfo "<< ${file}"
1041 + done
1042 + fi
1043 + done
1044 + # Silently remove the now empty dirs
1045 + for DIR in ${INC} ; do
1046 + if [[ -d "${DIR}" ]] ; then
1047 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
1048 + fi
1049 + done
1050 +
1051 + fi
1052 +}
1053 +
1054 +pkg_postrm(){
1055 + dual_scripts
1056 +}