Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/perl/
Date: Mon, 01 Jun 2020 20:14:37
Message-Id: 1591042453.c3274b1455b180a8d4078545cebb3c3008de2f2f.dilfridge@gentoo
1 commit: c3274b1455b180a8d4078545cebb3c3008de2f2f
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 1 20:08:20 2020 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 1 20:14:13 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c3274b14
7
8 dev-lang/perl: Version bump
9
10 Bug: https://bugs.gentoo.org/723792
11 Package-Manager: Portage-2.3.99, Repoman-2.3.22
12 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
13
14 dev-lang/perl/Manifest | 1 +
15 dev-lang/perl/perl-5.30.3.ebuild | 653 +++++++++++++++++++++++++++++++++++++++
16 2 files changed, 654 insertions(+)
17
18 diff --git a/dev-lang/perl/Manifest b/dev-lang/perl/Manifest
19 index 6fa2875152b..688fead09a8 100644
20 --- a/dev-lang/perl/Manifest
21 +++ b/dev-lang/perl/Manifest
22 @@ -1,5 +1,6 @@
23 DIST perl-5.30.0-patches-1.tar.xz 17352 BLAKE2B 67eb1c4ce6ada27e05962d06fa9c5675ca1d22623b5fd172ce8ceaa17f2e51d61f9451955f9f6acf6d97ea7d71c72b583be1378ccbf9174c88580baec2049a48 SHA512 4fe1f2de5e72e56890858148d20b772df63dce34cb3977ec47d8ed5323c4843929130f660f1558c282c97e65efa1c6d2fdacf9e2dcc0ef1d487a0b69dbb5bbb4
24 DIST perl-5.30.1.tar.xz 12367844 BLAKE2B 7e5dafb218a993301b986d198c02179d2d93d7418b910f813c7e5bc44ca4d22f004d4d768273ab5d4b6f16103d8a1896237ee14e195d2644fc4c05f5ade5404b SHA512 8f3339efdcd1bb58fa58a90042181bef86bb09e4598c737e446ed43b56d2ab23d67eced5e36fb08fc61e076acfdb572a12e46a1277f5299a3f412054df0b88bf
25 DIST perl-5.30.2.tar.xz 12373480 BLAKE2B b34344221409fad8aad5c24a9851a95521720bfd85ff150fec02a70d78188cd3a4d6327931b955323c86eab6b16979128dd323f78b797cf3244518df840f70b0 SHA512 b945c95f44a58b9cc920c926e23017c4270c0dc8daf0bf8169cd7c8f6b8f980f1780bee4fbd525df518edc50f08364ba65988cb17e72a1667f50226459b65087
26 +DIST perl-5.30.3.tar.xz 12375128 BLAKE2B ff0668c896e46ea35a1b8bd4a7d800c8668d6995185cd8c43fca332da2fa63965bb5276b2d5cf9738c0b7fb735140f6e33f1b4582899017903f86753065f417b SHA512 0ea62cf17532ee99217a218c39aa530472857c7a1982494f3a01693683062b4cdebe383a79f7b64452c713337b554ed5e0fd6eda018ea29e83c3538a13c24f3c
27 DIST perl-cross-1.3.1.tar.gz 106723 BLAKE2B 473d90dbfe5d69e17d088664c365190982db400b0617d951fb7a4ccb84dd269fd9e861a6255c0469fbf288125db67ed9fc692251f14c31181f6e9dd1dba447bb SHA512 4715c1f65e39a7d0c605558b345a0a037e61afa992b3f723d66277d5ff7f1c7368ff1dfdb726895d75c4afdb6f710743708fdd9e79569a7d14a2d7002cc9f3b2
28 DIST perl-cross-1.3.2.tar.gz 108350 BLAKE2B ddb352fdbec66a04de62425f5cae1aaa3bc7251b9d6f4837b66a0bd79c53c60212fad3997dad4c38055774a2769d45b5b83927bf48b0fb00a130fee429eba702 SHA512 d61d25066a8d87c34aeacc5b9bd86fab964b33c4c65e84a89e4077fe1d8011c0bdf810a304631af44fae32edcffd6c99fc17b0c584ea83d1ce5ce492aaedfea5
29
30 diff --git a/dev-lang/perl/perl-5.30.3.ebuild b/dev-lang/perl/perl-5.30.3.ebuild
31 new file mode 100644
32 index 00000000000..04bde1a07ee
33 --- /dev/null
34 +++ b/dev-lang/perl/perl-5.30.3.ebuild
35 @@ -0,0 +1,653 @@
36 +# Copyright 1999-2020 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +
41 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
42 +
43 +PATCH_VER=1
44 +CROSS_VER=1.3.2
45 +PATCH_BASE="perl-5.30.0-patches-${PATCH_VER}"
46 +PATCH_DEV=dilfridge
47 +
48 +DIST_AUTHOR=XSAWYERX
49 +
50 +# Greatest first, don't include yourself
51 +# Devel point-releases are not ABI-intercompatible, but stable point releases are
52 +# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
53 +PERL_BIN_OLDVERSEN="5.30.0 5.30.1 5.30.2"
54 +
55 +if [[ "${PV##*.}" == "9999" ]]; then
56 + DIST_VERSION=5.30.0
57 +else
58 + DIST_VERSION="${PV/_rc/-RC}"
59 +fi
60 +SHORT_PV="${DIST_VERSION%.*}"
61 +# Even numbered major versions are ABI intercompatible
62 +# Odd numbered major versions are not
63 +if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
64 + SUBSLOT="${DIST_VERSION%-RC*}"
65 +else
66 + SUBSLOT="${DIST_VERSION%.*}"
67 +fi
68 +# Used only in tar paths
69 +MY_P="perl-${DIST_VERSION}"
70 +# Used in library paths
71 +MY_PV="${DIST_VERSION%-RC*}"
72 +
73 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
74 +
75 +SRC_URI="
76 + mirror://cpan/src/5.0/${MY_P}.tar.xz
77 + mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
78 + https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz
79 + mirror://gentoo/${PATCH_BASE}.tar.xz
80 + https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${PATCH_BASE}.tar.xz
81 + https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
82 +"
83 +HOMEPAGE="https://www.perl.org/"
84 +
85 +LICENSE="|| ( Artistic GPL-1+ )"
86 +SLOT="0/${SUBSLOT}"
87 +
88 +if [[ "${PV##*.}" != "9999" ]] && [[ "${PV/rc//}" == "${PV}" ]] ; then
89 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
90 +fi
91 +
92 +IUSE="berkdb debug doc gdbm ithreads"
93 +
94 +RDEPEND="
95 + berkdb? ( sys-libs/db:= )
96 + gdbm? ( >=sys-libs/gdbm-1.8.3:= )
97 + app-arch/bzip2
98 + sys-libs/zlib
99 +"
100 +DEPEND="${RDEPEND}"
101 +PDEPEND="
102 + >=app-admin/perl-cleaner-2.5
103 + >=virtual/perl-File-Temp-0.230.400-r2
104 + >=virtual/perl-Data-Dumper-2.154.0
105 + virtual/perl-Test-Harness
106 +"
107 +# bug 390719, bug 523624
108 +# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
109 +
110 +S="${WORKDIR}/${MY_P}"
111 +
112 +dual_scripts() {
113 + src_remove_dual perl-core/Archive-Tar 2.320.0 ptar ptardiff ptargrep
114 + src_remove_dual perl-core/CPAN 2.220.0 cpan
115 + src_remove_dual perl-core/Digest-SHA 6.20.0 shasum
116 + src_remove_dual perl-core/Encode 3.10.0 enc2xs piconv
117 + src_remove_dual perl-core/ExtUtils-MakeMaker 7.340.0 instmodsh
118 + src_remove_dual perl-core/ExtUtils-ParseXS 3.400.0 xsubpp
119 + src_remove_dual perl-core/IO-Compress 2.84.0 zipdetails
120 + src_remove_dual perl-core/JSON-PP 4.20.0 json_pp
121 + src_remove_dual perl-core/Module-CoreList 5.202.6.13.0_rc corelist
122 + src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect
123 + src_remove_dual perl-core/Pod-Perldoc 3.280.100 perldoc
124 + src_remove_dual perl-core/Test-Harness 3.420.0 prove
125 + src_remove_dual perl-core/podlators 4.110.0 pod2man pod2text
126 + src_remove_dual_man perl-core/podlators 4.110.0 /usr/share/man/man1/perlpodstyle.1
127 +}
128 +
129 +check_rebuild() {
130 + # Fresh install
131 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
132 + return 0;
133 + # Major Upgrade
134 + # doesn't matter if there's multiple copies, it still needs a rebuild
135 + # if the string is anything other than "5.CURRENTMAJOR"
136 + elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
137 + echo ""
138 + ewarn "UPDATE THE PERL MODULES:"
139 + ewarn "After updating dev-lang/perl the installed Perl modules"
140 + ewarn "have to be re-installed. In most cases, this is done automatically"
141 + ewarn "by the package manager, but subsequent steps are still recommended"
142 + ewarn "to ensure system consistency."
143 + ewarn
144 + ewarn "You should start with a depclean to remove any unused perl dependencies"
145 + ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
146 + ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
147 + ewarn "Recommended: emerge --depclean -va"
148 + ewarn
149 + ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
150 + ewarn "remaining rebuilds portage may have missed."
151 + ewarn "Use: perl-cleaner --all"
152 + return 0;
153 +
154 + # Reinstall w/ USE Change
155 + elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
156 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
157 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
158 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
159 + echo ""
160 + ewarn "TOGGLED USE-FLAGS WARNING:"
161 + ewarn "You changed one of the use-flags ithreads or debug."
162 + ewarn "You must rebuild all perl-modules installed."
163 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
164 + fi
165 +}
166 +
167 +pkg_setup() {
168 + case ${CHOST} in
169 + *-freebsd*) osname="freebsd" ;;
170 + *-dragonfly*) osname="dragonfly" ;;
171 + *-netbsd*) osname="netbsd" ;;
172 + *-openbsd*) osname="openbsd" ;;
173 + *-darwin*) osname="darwin" ;;
174 + *-solaris*) osname="solaris" ;;
175 + *-interix*) osname="interix" ;;
176 + *-aix*) osname="aix" ;;
177 + *-cygwin*) osname="cygwin" ;;
178 + *) osname="linux" ;;
179 + esac
180 +
181 + myarch="${CHOST%%-*}-${osname}"
182 + if use debug ; then
183 + myarch+="-debug"
184 + fi
185 + if use ithreads ; then
186 + mythreading="-multi"
187 + myarch+="-thread"
188 + fi
189 +
190 + PRIV_BASE="/usr/$(get_libdir)/perl5"
191 + SITE_BASE="/usr/local/$(get_libdir)/perl5"
192 + VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl"
193 +
194 + LIBPERL="libperl$(get_libname ${MY_PV} )"
195 + PRIV_LIB="${PRIV_BASE}/${MY_PV}"
196 + ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}"
197 + SITE_LIB="${SITE_BASE}/${MY_PV}"
198 + SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}"
199 + VENDOR_LIB="${VENDOR_BASE}/${MY_PV}"
200 + VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}"
201 +
202 + dual_scripts
203 +}
204 +
205 +src_remove_dual_file() {
206 + local i pkg ver
207 + pkg="$1"
208 + ver="$2"
209 + shift 2
210 + case "${EBUILD_PHASE:-none}" in
211 + postinst|postrm)
212 + for i in "$@" ; do
213 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
214 + done
215 + ;;
216 + setup)
217 + for i in "$@" ; do
218 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
219 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
220 + break
221 + fi
222 + done
223 + ;;
224 + install)
225 + for i in "$@" ; do
226 + if ! [[ -f "${ED}"${i} ]] ; then
227 + ewarn "${i} does not exist!"
228 + continue
229 + fi
230 + mv "${ED}"${i}{,-${ver}-${P}} || die
231 + done
232 + ;;
233 + esac
234 +}
235 +
236 +src_remove_dual_man() {
237 + local i pkg ver ff
238 + pkg="$1"
239 + ver="$2"
240 + shift 2
241 + case "${EBUILD_PHASE:-none}" in
242 + postinst|postrm)
243 + for i in "$@" ; do
244 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
245 + ff=${ff##*${i#${i%.[0-9]}}}
246 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
247 + done
248 + ;;
249 + install)
250 + for i in "$@" ; do
251 + if ! [[ -f "${ED}"${i} ]] ; then
252 + ewarn "${i} does not exist!"
253 + continue
254 + fi
255 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
256 + done
257 + ;;
258 + esac
259 +}
260 +
261 +src_remove_dual() {
262 + local i pkg ver
263 + pkg="$1"
264 + ver="$2"
265 + shift 2
266 + for i in "$@" ; do
267 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
268 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
269 + done
270 +}
271 +
272 +src_prepare_update_patchlevel_h() {
273 + # Copied and modified from debian:
274 + # Copyright 2011 Niko Tyni
275 + # This program is free software; you can redistribute it and/or modify
276 + # it under the same terms as Perl itself.
277 + local patchdir="${WORKDIR}/patches"
278 + local prefix
279 + local patchoutput="patchlevel-gentoo.h"
280 +
281 + [[ -f ${patchdir}/series ]] || return 0
282 +
283 +while read patch
284 +do
285 + patchname=$(echo $patch | sed 's/\.diff$//')
286 + < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e '
287 +
288 + # massage the patch headers
289 + s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend;
290 + s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend;
291 + s|^Bug-Gentoo: ||; tprepend;
292 + s/^\(Subject\|Description\): //; tappend;
293 + s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend;
294 +
295 + # post-process at the end of input
296 + $ { x;
297 + # include the version number in the patchlevel.h description (if available)
298 + s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/;
299 +
300 + # escape any backslashes and double quotes
301 + s|\\|\\\\|g; s|"|\\"|g;
302 +
303 + # add a prefix
304 + s|^|\t,"'"$prefix$patchname"' - |;
305 + # newlines away
306 + s/\n/ /g; s/ */ /g;
307 + # add a suffix
308 + s/ *$/"/; p
309 + };
310 + # stop all processing
311 + d;
312 + # label: append to the hold space
313 + :append H; d;
314 + # label: prepend to the hold space
315 + :prepend x; H; d;
316 + '
317 +done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}"
318 +echo "${patchoutput}" >> "${S}/MANIFEST"
319 +}
320 +
321 +src_prepare_perlcross() {
322 + cp -a ../perl-cross-${CROSS_VER}/* . || die
323 +
324 + # bug 604072
325 + MAKEOPTS+=" -j1"
326 + export MAKEOPTS
327 +}
328 +src_prepare_dynamic() {
329 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
330 + ln -s ${LIBPERL} libperl$(get_libname ) || die
331 +}
332 +
333 +src_prepare() {
334 + local patch
335 + EPATCH_OPTS+=" -p1"
336 +
337 + if use hppa ; then
338 + epatch "${FILESDIR}/${PN}-5.26.2-hppa.patch" # bug 634162
339 + fi
340 +
341 + if [[ ${CHOST} == *-solaris* ]] ; then
342 + # do NOT mess with nsl, on Solaris this is always necessary,
343 + # when -lsocket is used e.g. to get h_errno
344 + sed -i '/gentoo\/no-nsl-cl\.patch/d' "${WORKDIR}/patches/series" || die
345 + fi
346 +
347 + einfo "Applying patches from ${PATCH_BASE} ..."
348 + while read patch ; do
349 + EPATCH_SINGLE_MSG=" ${patch} ..."
350 + epatch "${WORKDIR}"/patches/${patch}
351 + done < "${WORKDIR}"/patches/series
352 +
353 + src_prepare_update_patchlevel_h
354 +
355 + tc-is-cross-compiler && src_prepare_perlcross
356 +
357 + tc-is-static-only || src_prepare_dynamic
358 +
359 + if use gdbm; then
360 + sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \
361 + ext/NDBM_File/Makefile.PL || die
362 + fi
363 +
364 + # Use errno.h from prefix rather than from host system, bug #645804
365 + if use prefix && [[ -e "${EPREFIX}"/usr/include/errno.h ]] ; then
366 + sed -i "/my..sysroot/s:'':'${EPREFIX}':" ext/Errno/Errno_pm.PL || die
367 + fi
368 +
369 + if [[ ${CHOST} == *-solaris* ]] ; then
370 + # set a soname, fix linking against just built libperl
371 + sed -i -e 's/netbsd\*/netbsd*|solaris*/' Makefile.SH || die
372 + fi
373 +
374 + if [[ ${CHOST} == *-darwin* ]] ; then
375 + # fix install_name (soname) not to reference $D
376 + sed -i -e '/install_name `pwd/s/`pwd`/\\$(shrpdir)/' Makefile.SH || die
377 + fi
378 +
379 + default
380 +}
381 +
382 +myconf() {
383 + # the myconf array is declared in src_configure
384 + myconf=( "${myconf[@]}" "$@" )
385 +}
386 +
387 +src_configure() {
388 + declare -a myconf
389 +
390 + export LC_ALL="C"
391 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
392 +
393 + # Perl has problems compiling with -Os in your flags with glibc
394 + use elibc_uclibc || replace-flags "-Os" "-O2"
395 +
396 + # xlocale.h is going away in glibc-2.26, so it's counterproductive
397 + # if we use it and include it in CORE/perl.h ... Perl builds just
398 + # fine with glibc and locale.h only.
399 + # However, the darwin prefix people have no locale.h ...
400 + use elibc_glibc && myconf -Ui_xlocale
401 +
402 + # This flag makes compiling crash in interesting ways
403 + filter-flags "-malign-double"
404 +
405 + # Generic LTO broken since 5.28, triggers EUMM failures
406 + filter-flags "-flto"
407 +
408 + use sparc && myconf -Ud_longdbl
409 +
410 + export BUILD_BZIP2=0
411 + export BZIP2_INCLUDE=${EROOT}/usr/include
412 + export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
413 +
414 + export BUILD_ZLIB=False
415 + export ZLIB_INCLUDE=${EROOT}/usr/include
416 + export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
417 +
418 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
419 + myndbm='U'
420 + mygdbm='U'
421 + mydb='U'
422 + if use gdbm ; then
423 + mygdbm='D'
424 + if use berkdb ; then
425 + myndbm='D'
426 + fi
427 + fi
428 + if use berkdb ; then
429 + mydb='D'
430 + has_version '=sys-libs/db-1*' && myndbm='D'
431 + fi
432 +
433 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
434 +
435 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
436 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
437 + myconf -Ui_db -Ui_ndbm
438 + fi
439 +
440 + use ithreads && myconf -Dusethreads
441 +
442 + if use debug ; then
443 + append-cflags "-g"
444 + myconf -DDEBUGGING
445 + elif [[ ${CFLAGS} == *-g* ]] ; then
446 + myconf -DDEBUGGING=-g
447 + else
448 + myconf -DDEBUGGING=none
449 + fi
450 +
451 + # Autodiscover all old version directories, some of them will even be newer
452 + # if you downgrade
453 + if [[ -z ${PERL_OLDVERSEN} ]]; then
454 + PERL_OLDVERSEN="$(
455 + find "${EROOT%/}${PRIV_BASE}" "${EROOT%/}${SITE_BASE}" "${EROOT%/}${VENDOR_BASE}" \
456 + -maxdepth 1 -mindepth 1 -type d -regex '.*/5[.][0-9]+[.][0-9]+$' \
457 + -printf "%f " 2>/dev/null )"
458 + fi
459 + # Fixup versions, removing self match, fixing order and dupes
460 + PERL_OLDVERSEN="$(
461 + echo "${PERL_OLDVERSEN}" |\
462 + tr " " "\n" |\
463 + grep -vF "${DIST_VERSION%-RC}" |\
464 + sort -u -nr -t'.' -k1,1 -k2,2 -k3,3
465 + )"
466 +
467 + # Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string
468 + if [[ -n "${PERL_OLDVERSEN// }" ]]; then
469 + local inclist="$(
470 + for v in ${PERL_OLDVERSEN}; do
471 + has "${v}" ${PERL_BIN_OLDVERSEN} && echo -n "${v}/${myarch}${mythreading} ";
472 + echo -n "${v} ";
473 + done )"
474 + einfo "This version of perl may partially support modules previously"
475 + einfo "installed in any of the following paths:"
476 + for incpath in ${inclist}; do
477 + [[ -e "${EROOT%/}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${VENDOR_BASE}/${incpath}"
478 + [[ -e "${EROOT%/}${PRIV_BASE}/${incpath}" ]] && einfo " ${EROO%/T}${PRIV_BASE}/${incpath}"
479 + [[ -e "${EROOT%/}${SITE_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${SITE_BASE}/${incpath}"
480 + done
481 + einfo "This is a temporary measure and you should aim to cleanup these paths"
482 + einfo "via world updates and perl-cleaner"
483 + myconf -Dinc_version_list="${inclist}"
484 + fi
485 +
486 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
487 +
488 + # Make sure we can do the final link #523730, need to set deployment
489 + # target to override hardcoded 10.3 which breaks on modern OSX
490 + [[ ${CHOST} == *-darwin* ]] && \
491 + myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
492 +
493 + # Older macOS with non-Apple GCC chokes on inline in system headers
494 + # using c89 mode as injected by cflags.SH
495 + [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
496 + append-cflags -Dinline=__inline__
497 +
498 + # fix unaligned access misdetection
499 + # https://rt.perl.org/Public/Bug/Display.html?id=133495
500 + # https://rt.perl.org/Public/Bug/Display.html?id=133803
501 + # bug #676062, bug #688432
502 + use hppa || use sparc || [[ ${CHOST} == sparc*-solaris* ]] || \
503 + [[ ${CHOST} == armv5tel* ]] \
504 + && myconf "-Dd_u32align='define'"
505 +
506 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
507 + # Prefix itself we don't do multilib either, so make sure perl can find
508 + # something compatible.
509 + if use prefix ; then
510 + # Set a hook to check for each detected library whether it actually works.
511 + export libscheck="
512 + ( echo 'main(){}' > '${T}'/conftest.c &&
513 + $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
514 + ) || xxx=/dev/null"
515 +
516 + # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
517 + local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
518 + myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
519 + elif [[ $(get_libdir) != "lib" ]] ; then
520 + # We need to use " and not ', as the written config.sh use ' ...
521 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
522 + fi
523 +
524 + # don't try building ODBM, bug #354453
525 + disabled_extensions="ODBM_File"
526 +
527 + if ! use gdbm ; then
528 + # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
529 + disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
530 + fi
531 +
532 + myconf -Dnoextensions="${disabled_extensions}"
533 +
534 + [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
535 +
536 + [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
537 + # allow fiddling via EXTRA_ECONF, bug 558070
538 + eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
539 +
540 + myconf \
541 + -Duseshrplib \
542 + -Darchname="${myarch}" \
543 + -Dcc="$(tc-getCC)" \
544 + -Doptimize="${CFLAGS}" \
545 + -Dldflags="${LDFLAGS}" \
546 + -Dprefix="${EPREFIX}"'/usr' \
547 + -Dsiteprefix="${EPREFIX}"'/usr/local' \
548 + -Dvendorprefix="${EPREFIX}"'/usr' \
549 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
550 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
551 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
552 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
553 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
554 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
555 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
556 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
557 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
558 + -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
559 + -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
560 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
561 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
562 + -Dman1ext='1' \
563 + -Dman3ext='3pm' \
564 + -Dlibperl="${LIBPERL}" \
565 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
566 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
567 + -Duselargefiles \
568 + -Dd_semctl_semun \
569 + -Dcf_by='Gentoo' \
570 + -Dmyhostname='localhost' \
571 + -Dperladmin='root@localhost' \
572 + -Ud_csh \
573 + -Dsh="${EPREFIX}"/bin/sh \
574 + -Dtargetsh="${EPREFIX}"/bin/sh \
575 + -Uusenm \
576 + "${myconf[@]}" \
577 + "${EXTRA_ECONF[@]}"
578 +
579 + if tc-is-cross-compiler; then
580 + ./configure \
581 + --target="${CHOST}" \
582 + --build="${CBUILD}" \
583 + -Dinstallprefix='' \
584 + -Dinstallusrbinperl='undef' \
585 + -Dusevendorprefix='define' \
586 + "${myconf[@]}" \
587 + || die "Unable to configure"
588 + else
589 + sh Configure \
590 + -des \
591 + -Dinstallprefix="${EPREFIX}"'/usr' \
592 + -Dinstallusrbinperl='n' \
593 + "${myconf[@]}" \
594 + || die "Unable to configure"
595 + fi
596 +}
597 +
598 +src_test() {
599 + export NO_GENTOO_NETWORK_TESTS=1;
600 + export GENTOO_ASSUME_SANDBOXED="${GENTOO_ASSUME_SANDBOXED:-1}"
601 + export GENTOO_NO_PORTING_TESTS="${GENTOO_NO_PORTING_TESTS:-1}"
602 + if [[ ${EUID} == 0 ]] ; then
603 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
604 + return 0
605 + fi
606 + use elibc_uclibc && export MAKEOPTS+=" -j1"
607 + TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
608 +}
609 +
610 +src_install() {
611 + local i
612 + local coredir="${ARCH_LIB}/CORE"
613 +
614 + emake DESTDIR="${D}" install
615 +
616 + rm -f "${ED}/usr/bin/perl${MY_PV}"
617 + ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
618 +
619 + if ! tc-is-static-only ; then
620 + dolib.so "${ED}"${coredir}/${LIBPERL}
621 + rm -f "${ED}"${coredir}/${LIBPERL}
622 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
623 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
624 +
625 + ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
626 + ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
627 + ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
628 + fi
629 +
630 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
631 +
632 + # This removes ${D} from Config.pm
633 + for i in $(find "${D}" -iname "Config.pm" ) ; do
634 + einfo "Removing ${D} from ${i}..."
635 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
636 + done
637 +
638 + dodoc Changes* README AUTHORS
639 +
640 + if use doc ; then
641 + # HTML Documentation
642 + # We expect errors, warnings, and such with the following.
643 +
644 + dodir /usr/share/doc/${PF}/html
645 + LD_LIBRARY_PATH=. ./perl installhtml \
646 + --podroot='.' \
647 + --podpath='lib:ext:pod:vms' \
648 + --recurse \
649 + --htmldir="${ED}/usr/share/doc/${PF}/html"
650 + fi
651 +
652 + [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
653 +
654 + dual_scripts
655 +}
656 +
657 +pkg_preinst() {
658 + check_rebuild
659 +}
660 +
661 +pkg_postinst() {
662 + dual_scripts
663 +
664 + if [[ "${ROOT}" = "/" ]] ; then
665 + local INC DIR file
666 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
667 + einfo "Removing old .ph files"
668 + for DIR in ${INC} ; do
669 + if [[ -d "${DIR}" ]] ; then
670 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
671 + rm -f "${file}"
672 + einfo "<< ${file}"
673 + done
674 + fi
675 + done
676 + # Silently remove the now empty dirs
677 + for DIR in ${INC} ; do
678 + if [[ -d "${DIR}" ]] ; then
679 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
680 + fi
681 + done
682 +
683 + fi
684 +}
685 +
686 +pkg_postrm() {
687 + dual_scripts
688 +}