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: Sat, 09 Oct 2021 14:26:16
Message-Id: 1633789548.36806b114dc6d313b093b2d3ff4c9040c29ebcfb.dilfridge@gentoo
1 commit: 36806b114dc6d313b093b2d3ff4c9040c29ebcfb
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 9 14:25:48 2021 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 9 14:25:48 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=36806b11
7
8 dev-lang/perl: Remove old
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Andreas K. Huettel <dilfridge <AT> gentoo.org>
12
13 dev-lang/perl/perl-5.34.0-r1.ebuild | 822 ------------------------------------
14 dev-lang/perl/perl-5.34.0.ebuild | 819 -----------------------------------
15 2 files changed, 1641 deletions(-)
16
17 diff --git a/dev-lang/perl/perl-5.34.0-r1.ebuild b/dev-lang/perl/perl-5.34.0-r1.ebuild
18 deleted file mode 100644
19 index 8f4017c8989..00000000000
20 --- a/dev-lang/perl/perl-5.34.0-r1.ebuild
21 +++ /dev/null
22 @@ -1,822 +0,0 @@
23 -# Copyright 1999-2021 Gentoo Authors
24 -# Distributed under the terms of the GNU General Public License v2
25 -
26 -EAPI=7
27 -
28 -inherit alternatives flag-o-matic toolchain-funcs multilib multiprocessing
29 -
30 -PATCH_VER=1
31 -CROSS_VER=1.3.6
32 -PATCH_BASE="perl-5.34.0-patches-${PATCH_VER}"
33 -PATCH_DEV=dilfridge
34 -
35 -DIST_AUTHOR=XSAWYERX
36 -
37 -# Greatest first, don't include yourself
38 -# Devel point-releases are not ABI-intercompatible, but stable point releases are
39 -# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
40 -PERL_BIN_OLDVERSEN=""
41 -
42 -# Yes we can.
43 -PERL_SINGLE_SLOT=y
44 -
45 -if [[ "${PV##*.}" == "9999" ]]; then
46 - DIST_VERSION=5.30.0
47 -else
48 - DIST_VERSION="${PV/_rc/-RC}"
49 -fi
50 -SHORT_PV="${DIST_VERSION%.*}"
51 -# Even numbered major versions are ABI intercompatible
52 -# Odd numbered major versions are not
53 -if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
54 - SUBSLOT="${DIST_VERSION%-RC*}"
55 -else
56 - SUBSLOT="${DIST_VERSION%.*}"
57 -fi
58 -# Used only in tar paths
59 -MY_P="perl-${DIST_VERSION}"
60 -# Used in library paths
61 -MY_PV="${DIST_VERSION%-RC*}"
62 -
63 -DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
64 -
65 -SRC_URI="
66 - mirror://cpan/src/5.0/${MY_P}.tar.xz
67 - mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
68 - https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz
69 - https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${PATCH_BASE}.tar.xz
70 - https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
71 -"
72 -HOMEPAGE="https://www.perl.org/"
73 -
74 -LICENSE="|| ( Artistic GPL-1+ )"
75 -SLOT="0/${SUBSLOT}"
76 -
77 -if [[ "${PV##*.}" != "9999" ]] && [[ "${PV/rc//}" == "${PV}" ]] ; then
78 -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
79 -fi
80 -
81 -IUSE="berkdb debug doc gdbm ithreads minimal"
82 -
83 -RDEPEND="
84 - berkdb? ( sys-libs/db:= )
85 - gdbm? ( >=sys-libs/gdbm-1.8.3:= )
86 - app-arch/bzip2
87 - sys-libs/zlib
88 - virtual/libcrypt:=
89 -"
90 -DEPEND="${RDEPEND}"
91 -BDEPEND="${RDEPEND}"
92 -
93 -PDEPEND="
94 - !minimal? (
95 - >=app-admin/perl-cleaner-2.5
96 - >=virtual/perl-File-Temp-0.230.400-r2
97 - >=virtual/perl-Data-Dumper-2.154.0
98 - virtual/perl-Test-Harness
99 - )
100 -"
101 -# bug 390719, bug 523624
102 -# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
103 -
104 -S="${WORKDIR}/${MY_P}"
105 -
106 -dual_scripts() {
107 - src_remove_dual perl-core/Archive-Tar 2.380.0 ptar ptardiff ptargrep
108 - src_remove_dual perl-core/CPAN 2.280.0 cpan
109 - src_remove_dual perl-core/Digest-SHA 6.20.0 shasum
110 - src_remove_dual perl-core/Encode 3.80.0 enc2xs piconv
111 - src_remove_dual perl-core/ExtUtils-MakeMaker 7.620.0 instmodsh
112 - src_remove_dual perl-core/ExtUtils-ParseXS 3.430.0 xsubpp
113 - src_remove_dual perl-core/IO-Compress 2.102.0 zipdetails
114 - src_remove_dual perl-core/JSON-PP 4.60.0 json_pp
115 - src_remove_dual perl-core/Module-CoreList 5.202.105.200 corelist
116 - src_remove_dual perl-core/Pod-Checker 1.740.0 podchecker
117 - src_remove_dual perl-core/Pod-Perldoc 3.280.100 perldoc
118 - src_remove_dual perl-core/Pod-Usage 2.10.0 pod2usage
119 - src_remove_dual perl-core/Test-Harness 3.430.0 prove
120 - src_remove_dual perl-core/podlators 4.140.0 pod2man pod2text
121 - src_remove_dual_man perl-core/podlators 4.140.0 /usr/share/man/man1/perlpodstyle.1
122 -}
123 -
124 -check_rebuild() {
125 - # Fresh install
126 - if [[ -z "${REPLACING_VERSIONS}" ]]; then
127 - return 0;
128 - # Major Upgrade
129 - # doesn't matter if there's multiple copies, it still needs a rebuild
130 - # if the string is anything other than "5.CURRENTMAJOR"
131 - elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
132 - echo ""
133 - ewarn "UPDATE THE PERL MODULES:"
134 - ewarn "After updating dev-lang/perl the installed Perl modules"
135 - ewarn "have to be re-installed. In most cases, this is done automatically"
136 - ewarn "by the package manager, but subsequent steps are still recommended"
137 - ewarn "to ensure system consistency."
138 - ewarn
139 - ewarn "You should start with a depclean to remove any unused perl dependencies"
140 - ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
141 - ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
142 - ewarn "Recommended: emerge --depclean -va"
143 - ewarn
144 - ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
145 - ewarn "remaining rebuilds portage may have missed."
146 - ewarn "Use: perl-cleaner --all"
147 - return 0;
148 -
149 - # Reinstall w/ USE Change
150 - elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
151 - ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
152 - ( use debug && ! has_version dev-lang/perl[debug] ) || \
153 - ( ! use debug && has_version dev-lang/perl[debug] ) ; then
154 - echo ""
155 - ewarn "TOGGLED USE-FLAGS WARNING:"
156 - ewarn "You changed one of the use-flags ithreads or debug."
157 - ewarn "You must rebuild all perl-modules installed."
158 - ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
159 - fi
160 -}
161 -
162 -pkg_setup() {
163 - case ${CHOST} in
164 - *-freebsd*) osname="freebsd" ;;
165 - *-dragonfly*) osname="dragonfly" ;;
166 - *-netbsd*) osname="netbsd" ;;
167 - *-openbsd*) osname="openbsd" ;;
168 - *-darwin*) osname="darwin" ;;
169 - *-solaris*) osname="solaris" ;;
170 - *-cygwin*) osname="cygwin" ;;
171 - *) osname="linux" ;;
172 - esac
173 -
174 - myarch="${CHOST%%-*}-${osname}"
175 - if use debug ; then
176 - myarch+="-debug"
177 - fi
178 - if use ithreads ; then
179 - mythreading="-multi"
180 - myarch+="-thread"
181 - fi
182 -
183 - PRIV_BASE="/usr/$(get_libdir)/perl5"
184 - SITE_BASE="/usr/local/$(get_libdir)/perl5"
185 - VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl"
186 -
187 - LIBPERL="libperl$(get_libname ${MY_PV} )"
188 -
189 - # This ENV var tells perl to build with a directory like "5.30"
190 - # regardless of its patch version. This is for experts only
191 - # at this point.
192 - if [[ -z "${PERL_SINGLE_SLOT}" ]]; then
193 - PRIV_LIB="${PRIV_BASE}/${MY_PV}"
194 - ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}"
195 - SITE_LIB="${SITE_BASE}/${MY_PV}"
196 - SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}"
197 - VENDOR_LIB="${VENDOR_BASE}/${MY_PV}"
198 - VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}"
199 - else
200 - PRIV_LIB="${PRIV_BASE}/${SUBSLOT}"
201 - ARCH_LIB="${PRIV_BASE}/${SUBSLOT}/${myarch}${mythreading}"
202 - SITE_LIB="${SITE_BASE}/${SUBSLOT}"
203 - SITE_ARCH="${SITE_BASE}/${SUBSLOT}/${myarch}${mythreading}"
204 - VENDOR_LIB="${VENDOR_BASE}/${SUBSLOT}"
205 - VENDOR_ARCH="${VENDOR_BASE}/${SUBSLOT}/${myarch}${mythreading}"
206 - fi
207 -
208 - dual_scripts
209 -}
210 -
211 -src_remove_dual_file() {
212 - local i pkg ver
213 - pkg="$1"
214 - ver="$2"
215 - shift 2
216 - case "${EBUILD_PHASE:-none}" in
217 - postinst|postrm)
218 - for i in "$@" ; do
219 - alternatives_auto_makesym "${i}" "${i}-[0-9]*"
220 - done
221 - ;;
222 - setup)
223 - for i in "$@" ; do
224 - if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
225 - has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
226 - break
227 - fi
228 - done
229 - ;;
230 - install)
231 - for i in "$@" ; do
232 - if ! [[ -f "${ED}"${i} ]] ; then
233 - ewarn "${i} does not exist!"
234 - continue
235 - fi
236 - mv "${ED}"${i}{,-${ver}-${P}} || die
237 - done
238 - ;;
239 - esac
240 -}
241 -
242 -src_remove_dual_man() {
243 - local i pkg ver ff
244 - pkg="$1"
245 - ver="$2"
246 - shift 2
247 - case "${EBUILD_PHASE:-none}" in
248 - postinst|postrm)
249 - for i in "$@" ; do
250 - ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
251 - ff=${ff##*${i#${i%.[0-9]}}}
252 - alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
253 - done
254 - ;;
255 - install)
256 - for i in "$@" ; do
257 - if ! [[ -f "${ED}"${i} ]] ; then
258 - ewarn "${i} does not exist!"
259 - continue
260 - fi
261 - mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
262 - done
263 - ;;
264 - esac
265 -}
266 -
267 -src_remove_dual() {
268 - local i pkg ver
269 - pkg="$1"
270 - ver="$2"
271 - shift 2
272 - for i in "$@" ; do
273 - src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
274 - src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
275 - done
276 -}
277 -
278 -src_prepare_perlcross() {
279 - cp -a ../perl-cross-${CROSS_VER}/* . || die
280 -
281 - # bug 794463, needs further analysis what is exactly wrong here
282 - eapply "${FILESDIR}/perl-5.34.0-crossfit.patch"
283 -
284 - # bug 604072
285 - MAKEOPTS+=" -j1"
286 - export MAKEOPTS
287 -}
288 -src_prepare_dynamic() {
289 - ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
290 - ln -s ${LIBPERL} libperl$(get_libname ) || die
291 -}
292 -
293 -# Copy a patch into the patch series
294 -# add_patch SRC_PATH DEST_NAME ['description'] ['bug'] ['bug']
295 -# - description is optional, but recommended
296 -# - all arguments after descriptions are bug URLs
297 -add_patch() {
298 - local patchdir="${WORKDIR}/patches"
299 - local infodir="${WORKDIR}/patch-info"
300 - local src_name dest_name desc
301 - src_name="$1"
302 - dest_name="$2"
303 - desc="$3"
304 - shift; shift; shift;
305 - einfo "Adding ${dest_name} to patch bundle"
306 - cp "${src_name}" "${patchdir}/${dest_name}" || die "Couldn't copy ${src_name} to ${dest_name}"
307 - if [[ -n "${desc}" ]]; then
308 - printf "%s" "${desc}" > "${infodir}/${dest_name}.desc" || die "Couldn't write ${dest_name}.desc"
309 - fi
310 - if [[ $# -gt 0 ]]; then
311 - # Note: when $@ is more than one element, this emits a
312 - # line for each element
313 - printf "%s\n" "$@" > "${infodir}/${dest_name}.bugs" || die "Couldn't write ${dest_name}.bugs"
314 - fi
315 -}
316 -# Remove a patch using a glob expr
317 -# eg:
318 -# rm_patch *-darin-Use-CC*
319 -#
320 -rm_patch() {
321 - local patchdir="${WORKDIR}/patches"
322 - local expr="$1"
323 - local patch="$( cd "${patchdir}"; echo $expr )"
324 - einfo "Removing $patch ($expr) from patch bundle"
325 - if [[ -e "${patchdir}/${patch}" ]]; then
326 - rm -f "${patchdir}/${patch}" || die "Can't remove ${patch} ( $expr )"
327 - else
328 - ewarn "No ${expr} found in ${patchdir} to remove"
329 - fi
330 -}
331 -# Yes, this is a reasonable amount of code for something seemingly simple
332 -# but this is far easier to debug when things go wrong, and things went wrong
333 -# multiple times while I was getting the exact number of slashes right, which
334 -# requires circumnavigating both bash and sed escape mechanisms.
335 -c_escape_string() {
336 - local slash dquote
337 - slash='\'
338 - dquote='"'
339 - re_slash="${slash}${slash}"
340 - re_dquote="${slash}${dquote}"
341 -
342 - # Convert \ to \\,
343 - # " to \"
344 - echo "$1" |\
345 - sed "s|${re_slash}|${re_slash}${re_slash}|g" |\
346 - sed "s|${re_dquote}|${re_slash}${re_dquote}|g"
347 -}
348 -c_escape_file() {
349 - c_escape_string "$(cat "$1")"
350 -}
351 -
352 -apply_patchdir() {
353 - local patchdir="${WORKDIR}/patches"
354 - local infodir="${WORKDIR}/patch-info"
355 - local patchoutput="patchlevel-gentoo.h"
356 -
357 - # Inject Patch-Level info into description for patchlevel.h patch
358 - # to show in -V
359 - local patch_expr="*List-packaged-patches*"
360 - local patch="$( cd "${patchdir}"; echo $patch_expr )";
361 - einfo "Injecting patch-level info into ${patch}.desc ( $patch_expr )"
362 -
363 - if [[ -e "${patchdir}/${patch}" ]]; then
364 - printf "List packaged patches for %s(%s) in patchlevel.h" "${PF}" "${PATCH_BASE}"\
365 - >"${infodir}/${patch}.desc" || die "Can't rewrite ${patch}.desc"
366 - else
367 - eerror "No $patch_expr found in ${patchdir}"
368 - fi
369 -
370 - # Compute patch list to apply
371 - # different name other than PATCHES to stop default
372 - # reapplying it
373 - # Single depth is currently only supported, as artifacts can reside
374 - # from the old layout being multiple-directories, as well as it grossly
375 - # simplifying the patchlevel_gentoo.h generation.
376 - local PERL_PATCHES=($(
377 - find "${patchdir}" -maxdepth 1 -mindepth 1 -type f -printf "%f\n" |\
378 - grep -E '[.](diff|patch)$' |\
379 - sort -n
380 - ))
381 -
382 - for patch in "${PERL_PATCHES[@]}"; do
383 - eapply "${WORKDIR}"/patches/${patch}
384 - done
385 -
386 - einfo "Generating $patchoutput"
387 -
388 - # This code creates a header file, each iteration
389 - # creates one-or-more-lines for each entry found in PERL_PATCHES
390 - # and STDOUT is redirected to the .h file
391 - for patch in "${PERL_PATCHES[@]}"; do
392 - local desc_f="${infodir}/${patch}.desc"
393 - local bugs_f="${infodir}/${patch}.bugs"
394 -
395 - printf ',"%s"\n' "${patch}"
396 - if [[ ! -e "${desc_f}" ]]; then
397 - ewarn "No description provided for ${patch} (expected: ${desc_f} )"
398 - else
399 - local desc="$(c_escape_file "${desc_f}")"
400 - printf ',"- %s"\n' "${desc}"
401 - fi
402 - if [[ -e "${bugs_f}" ]]; then
403 - while read -d $'\n' -r line; do
404 - local esc_line="$(c_escape_string "${line}")"
405 - printf ',"- Bug: %s"\n' "${esc_line}"
406 - done <"${bugs_f}"
407 - fi
408 - done > "${S}/${patchoutput}"
409 - printf "%s\n" "${patchoutput}" >> "${S}/MANIFEST"
410 -
411 -}
412 -src_prepare() {
413 - local patchdir="${WORKDIR}/patches"
414 -
415 - # Prepare Patch dir with additional patches / remove unwanted patches
416 - # Inject bug/desc entries for perl -V
417 - # Old example:
418 - # add_patch "${FILESDIR}/${PN}-5.26.2-hppa.patch" "100-5.26.2-hppa.patch"\
419 - # "Fix broken miniperl on hppa"\
420 - # "https://bugs.debian.org/869122" "https://bugs.gentoo.org/634162"
421 -
422 - if [[ ${CHOST} == *-solaris* ]] ; then
423 - # do NOT mess with nsl, on Solaris this is always necessary,
424 - # when -lsocket is used e.g. to get h_errno
425 - rm_patch "*-nsl-and-cl*"
426 - fi
427 -
428 - apply_patchdir
429 -
430 - tc-is-cross-compiler && src_prepare_perlcross
431 -
432 - tc-is-static-only || src_prepare_dynamic
433 -
434 - if use gdbm; then
435 - sed -i "s:INC => .*:INC => \"-I${EROOT}/usr/include/gdbm\":g" \
436 - ext/NDBM_File/Makefile.PL || die
437 - fi
438 -
439 - # Use errno.h from prefix rather than from host system, bug #645804
440 - if use prefix && [[ -e "${EPREFIX}"/usr/include/errno.h ]] ; then
441 - sed -i "/my..sysroot/s:'':'${EPREFIX}':" ext/Errno/Errno_pm.PL || die
442 - fi
443 -
444 - if [[ ${CHOST} == *-solaris* ]] ; then
445 - # set a soname, fix linking against just built libperl
446 - sed -i -e 's/netbsd\*/netbsd*|solaris*/' Makefile.SH || die
447 - fi
448 -
449 - if [[ ${CHOST} == *-darwin* ]] ; then
450 - # fix install_name (soname) not to reference $D
451 - sed -i -e '/install_name `pwd/s/`pwd`/\\$(shrpdir)/' Makefile.SH || die
452 - fi
453 -
454 - default
455 -}
456 -
457 -myconf() {
458 - # the myconf array is declared in src_configure
459 - myconf=( "${myconf[@]}" "$@" )
460 -}
461 -
462 -# Outputs a list of versions which have been seen in any of the
463 -# primary perl @INC prefix paths, such as:
464 -# /usr/lib64/perl5/<NUMBER>
465 -# /usr/local/lib64/perl5/<NUMBER>
466 -# /usr/lib64/perl5/vendor_perl/<NUMBER>
467 -#
468 -# All values of NUMBER must be like "5.x.y", unless PERL_SUPPORT_SINGLE_SLOT
469 -# is enabled, where it will also allow numbers like "5.x"
470 -#
471 -# PERL_SUPPORT_SINGLE_SLOT should only be used to transition *away* from PERL_SINGLE_SLOT
472 -# if you used that.
473 -find_candidate_inc_versions() {
474 - local regex='.*/5[.][0-9]+[.][0-9]+$';
475 - if [[ ! -z "${PERL_SUPPORT_SINGLE_SLOT}" || ! -z "${PERL_SINGLE_SLOT}" ]]; then
476 - regex='.*/5[.][0-9]+\([.][0-9]+\|\)$'
477 - fi
478 - local dirs=(
479 - "${EROOT}${PRIV_BASE}"
480 - "${EROOT}${SITE_BASE}"
481 - "${EROOT}${VENDOR_BASE}"
482 - )
483 - for dir in "${dirs[@]}"; do
484 - if [[ ! -e "${dir}" ]]; then
485 - continue
486 - fi
487 - # Without access to readdir() on these dirs, find will not be able
488 - # to reveal any @INC directories inside them, and will subsequently prune
489 - # them from the built perl's @INC support, breaking our compatiblity options
490 - # entirely.
491 - if [[ ! -r "${dir}" || ! -x "${dir}" ]]; then
492 - eerror "Bad permissions on ${dir}, this will probably break things"
493 - eerror "Ensure ${dir} is +rx for at least uid=$EUID"
494 - eerror "Recommended permission is +rx for all"
495 - eerror "> chmod o+rx ${dir}"
496 - fi
497 - done
498 - einfo "Scanning for old @INC dirs matching '$regex' in: ${dirs[*]}"
499 - find "${dirs[@]}" -maxdepth 1 -mindepth 1 -type d -regex "${regex}" -printf "%f " 2>/dev/null
500 -}
501 -# Sort versions passed versiony-ly, remove self-version if present
502 -# dedup. Takes each version as an argument
503 -sanitize_inc_versions() {
504 - local vexclude="${DIST_VERSION%-RC}"
505 - if [[ ! -z "${PERL_SINGLE_SLOT}" ]]; then
506 - vexclude="${SUBSLOT}"
507 - fi
508 - einfo "Normalizing/Sorting candidate list: $*"
509 - einfo " to remove '${vexclude}'"
510 - # Note, general numeric sort has to be used
511 - # for the last component, or unique will convert
512 - # 5.30.0 + 5.30 into just 5.30
513 - printf "%s\n" "$@" |\
514 - grep -vxF "${vexclude}" |\
515 - sort -u -nr -t'.' -k1,1rn -k2,2rn -k3,3rg
516 -}
517 -
518 -versions_to_inclist() {
519 - local oldv="${PERL_BIN_OLDVERSEN}"
520 - if [[ ! -z "${PERL_SINGLE_SLOT}" ]]; then
521 - oldv="${DIST_VERSION%-RC} ${PERL_BIN_OLDVERSEN}"
522 - fi
523 - for v; do
524 - has "${v}" ${oldv} && echo -n "${v}/${myarch}${mythreading}/ ";
525 - echo -n "${v}/ ";
526 - done
527 -}
528 -versions_to_gentoolibdirs() {
529 - local oldv="${PERL_BIN_OLDVERSEN}"
530 - local root
531 - local v
532 - if [[ ! -z "${PERL_SINGLE_SLOT}" ]]; then
533 - oldv="${DIST_VERSION%-RC} ${PERL_BIN_OLDVERSEN}"
534 - fi
535 - for v; do
536 - for root in "${PRIV_BASE}" "${VENDOR_BASE}" "${SITE_BASE}"; do
537 - local fullpath="${EROOT}${root}/${v}"
538 - if [[ -e "${fullpath}" ]]; then
539 - has "${v}" ${oldv} && printf "%s:" "${fullpath}/${myarch}${mythreading}";
540 - printf "%s:" "${fullpath}"
541 - fi
542 - done
543 - done
544 -}
545 -
546 -src_configure() {
547 - declare -a myconf
548 -
549 - export LC_ALL="C"
550 - [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
551 -
552 - # Perl has problems compiling with -Os in your flags with glibc
553 - use elibc_uclibc || replace-flags "-Os" "-O2"
554 -
555 - # xlocale.h is going away in glibc-2.26, so it's counterproductive
556 - # if we use it and include it in CORE/perl.h ... Perl builds just
557 - # fine with glibc and locale.h only.
558 - # However, the darwin prefix people have no locale.h ...
559 - use elibc_glibc && myconf -Ui_xlocale
560 -
561 - # This flag makes compiling crash in interesting ways
562 - filter-flags "-malign-double"
563 -
564 - # Generic LTO broken since 5.28, triggers EUMM failures
565 - filter-flags "-flto"
566 -
567 - use sparc && myconf -Ud_longdbl
568 -
569 - export BUILD_BZIP2=0
570 - export BZIP2_INCLUDE=${EROOT}/usr/include
571 - export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
572 -
573 - export BUILD_ZLIB=False
574 - export ZLIB_INCLUDE=${EROOT}/usr/include
575 - export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
576 -
577 - # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
578 - myndbm='U'
579 - mygdbm='U'
580 - mydb='U'
581 - if use gdbm ; then
582 - mygdbm='D'
583 - if use berkdb ; then
584 - myndbm='D'
585 - fi
586 - fi
587 - if use berkdb ; then
588 - mydb='D'
589 - has_version '=sys-libs/db-1*' && myndbm='D'
590 - fi
591 -
592 - myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
593 -
594 - if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
595 - ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
596 - myconf -Ui_db -Ui_ndbm
597 - fi
598 -
599 - use ithreads && myconf -Dusethreads
600 -
601 - if use debug ; then
602 - append-cflags "-g"
603 - myconf -DDEBUGGING
604 - elif [[ ${CFLAGS} == *-g* ]] ; then
605 - myconf -DDEBUGGING=-g
606 - else
607 - myconf -DDEBUGGING=none
608 - fi
609 -
610 - # modifying 'optimize' prevents cross configure script from appending required flags
611 - if tc-is-cross-compiler; then
612 - append-cflags "-fwrapv -fno-strict-aliasing"
613 - fi
614 -
615 - # Autodiscover all old version directories, some of them will even be newer
616 - # if you downgrade
617 - if [[ -z ${PERL_OLDVERSEN} ]]; then
618 - PERL_OLDVERSEN="$( find_candidate_inc_versions )"
619 - fi
620 -
621 - # Fixup versions, removing self match, fixing order and dupes
622 - PERL_OLDVERSEN="$( sanitize_inc_versions ${PERL_OLDVERSEN} )"
623 -
624 - # Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string
625 - if [[ -n "${PERL_OLDVERSEN// }" ]]; then
626 - local inclist="$( versions_to_inclist ${PERL_OLDVERSEN} )"
627 - einfo "This version of perl may partially support modules previously"
628 - einfo "installed in any of the following paths:"
629 - for incpath in ${inclist}; do
630 - [[ -e "${EROOT}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT}${VENDOR_BASE}/${incpath}"
631 - [[ -e "${EROOT}${PRIV_BASE}/${incpath}" ]] && einfo " ${EROOT}${PRIV_BASE}/${incpath}"
632 - [[ -e "${EROOT}${SITE_BASE}/${incpath}" ]] && einfo " ${EROOT}${SITE_BASE}/${incpath}"
633 - done
634 - einfo "This is a temporary measure and you should aim to cleanup these paths"
635 - einfo "via world updates and perl-cleaner"
636 - # myconf -Dinc_version_list="${inclist}"
637 - myconf -Dgentoolibdirs="$( versions_to_gentoolibdirs ${PERL_OLDVERSEN} )"
638 - fi
639 -
640 - [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
641 -
642 - # Make sure we can do the final link #523730, need to set deployment
643 - # target to override hardcoded 10.3 which breaks on modern OSX
644 - [[ ${CHOST} == *-darwin* ]] && \
645 - myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
646 -
647 - # Older macOS with non-Apple GCC chokes on inline in system headers
648 - # using c89 mode as injected by cflags.SH
649 - [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
650 - append-cflags -Dinline=__inline__
651 -
652 - # flock on 32-bit sparc Solaris is broken, fall back to fcntl
653 - [[ ${CHOST} == sparc-*-solaris* ]] && \
654 - myconf -Ud_flock
655 -
656 - # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
657 - # Prefix itself we don't do multilib either, so make sure perl can find
658 - # something compatible.
659 - if use prefix ; then
660 - # Set a hook to check for each detected library whether it actually works.
661 - export libscheck="
662 - ( echo 'main(){}' > '${T}'/conftest.c &&
663 - $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
664 - ) || xxx=/dev/null"
665 -
666 - # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
667 - local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
668 - myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
669 - elif [[ $(get_libdir) != "lib" ]] ; then
670 - # We need to use " and not ', as the written config.sh use ' ...
671 - myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
672 - fi
673 -
674 - # don't try building ODBM, bug #354453
675 - disabled_extensions="ODBM_File"
676 -
677 - if ! use gdbm ; then
678 - # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
679 - disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
680 - fi
681 -
682 - myconf -Dnoextensions="${disabled_extensions}"
683 -
684 - [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
685 -
686 - [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
687 - # allow fiddling via EXTRA_ECONF, bug 558070
688 - eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
689 -
690 - # setting -Dld= to tc-getLD breaks perl and all perl things
691 - # https://github.com/Perl/perl5/issues/17791#issuecomment-630145202
692 - myconf \
693 - -Duseshrplib \
694 - -Darchname="${myarch}" \
695 - -Dcc="$(tc-getCC)" \
696 - -Dar="$(tc-getAR)" \
697 - -Dnm="$(tc-getNM)" \
698 - -Dcpp="$(tc-getCPP)" \
699 - -Dranlib="$(tc-getRANLIB)" \
700 - -Doptimize="${CFLAGS}" \
701 - -Dldflags="${LDFLAGS}" \
702 - -Dprefix="${EPREFIX}"'/usr' \
703 - -Dsiteprefix="${EPREFIX}"'/usr/local' \
704 - -Dvendorprefix="${EPREFIX}"'/usr' \
705 - -Dscriptdir="${EPREFIX}"'/usr/bin' \
706 - -Dprivlib="${EPREFIX}${PRIV_LIB}" \
707 - -Darchlib="${EPREFIX}${ARCH_LIB}" \
708 - -Dsitelib="${EPREFIX}${SITE_LIB}" \
709 - -Dsitearch="${EPREFIX}${SITE_ARCH}" \
710 - -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
711 - -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
712 - -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
713 - -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
714 - -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
715 - -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
716 - -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
717 - -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
718 - -Dman1ext='1' \
719 - -Dman3ext='3pm' \
720 - -Dlibperl="${LIBPERL}" \
721 - -Dlocincpth="${EPREFIX}"'/usr/include ' \
722 - -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
723 - -Duselargefiles \
724 - -Dd_semctl_semun \
725 - -Dcf_by='Gentoo' \
726 - -Dmyhostname='localhost' \
727 - -Dperladmin='root@localhost' \
728 - -Ud_csh \
729 - -Dsh="${EPREFIX}"/bin/sh \
730 - -Dtargetsh="${EPREFIX}"/bin/sh \
731 - -Uusenm \
732 - "${myconf[@]}" \
733 - "${EXTRA_ECONF[@]}"
734 -
735 - if tc-is-cross-compiler; then
736 - ./configure \
737 - --target="${CHOST}" \
738 - --build="${CBUILD}" \
739 - -Dinstallprefix='' \
740 - -Dinstallusrbinperl='undef' \
741 - -Dusevendorprefix='define' \
742 - "${myconf[@]}" \
743 - || die "Unable to configure"
744 - else
745 - sh Configure \
746 - -des \
747 - -Dinstallprefix="${EPREFIX}"'/usr' \
748 - -Dinstallusrbinperl='n' \
749 - "${myconf[@]}" \
750 - || die "Unable to configure"
751 - fi
752 -}
753 -
754 -src_test() {
755 - export NO_GENTOO_NETWORK_TESTS=1;
756 - export GENTOO_ASSUME_SANDBOXED="${GENTOO_ASSUME_SANDBOXED:-1}"
757 - export GENTOO_NO_PORTING_TESTS="${GENTOO_NO_PORTING_TESTS:-1}"
758 - if [[ ${EUID} == 0 ]] ; then
759 - ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
760 - return 0
761 - fi
762 - use elibc_uclibc && export MAKEOPTS+=" -j1"
763 - TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
764 -}
765 -
766 -src_install() {
767 - local i
768 - local coredir="${ARCH_LIB}/CORE"
769 -
770 - emake DESTDIR="${D}" install
771 -
772 - rm -f "${ED}/usr/bin/perl${MY_PV}"
773 - ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
774 -
775 - if ! tc-is-static-only ; then
776 - dolib.so "${ED}"${coredir}/${LIBPERL}
777 - rm -f "${ED}"${coredir}/${LIBPERL}
778 - ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
779 - ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
780 -
781 - ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
782 - ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
783 - ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
784 - fi
785 -
786 - rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
787 -
788 - # This removes ${D} from Config.pm
789 - for i in $(find "${D}" -iname "Config.pm" ) ; do
790 - einfo "Removing ${D} from ${i}..."
791 - sed -i -e "s:${D}::" "${i}" || die "Sed failed"
792 - done
793 -
794 - dodoc Changes* README AUTHORS
795 -
796 - if use doc ; then
797 - # HTML Documentation
798 - # We expect errors, warnings, and such with the following.
799 -
800 - dodir /usr/share/doc/${PF}/html
801 - LD_LIBRARY_PATH=. ./perl installhtml \
802 - --podroot='.' \
803 - --podpath='lib:ext:pod:vms' \
804 - --recurse \
805 - --htmldir="${ED}/usr/share/doc/${PF}/html"
806 - fi
807 -
808 - [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
809 -
810 - dual_scripts
811 -}
812 -
813 -pkg_preinst() {
814 - check_rebuild
815 -}
816 -
817 -pkg_postinst() {
818 - dual_scripts
819 -
820 - if [[ "${ROOT}" = "/" ]] ; then
821 - local INC DIR file
822 - INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
823 - einfo "Removing old .ph files"
824 - for DIR in ${INC} ; do
825 - if [[ -d "${DIR}" ]] ; then
826 - for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
827 - rm -f "${file}"
828 - einfo "<< ${file}"
829 - done
830 - fi
831 - done
832 - # Silently remove the now empty dirs
833 - for DIR in ${INC} ; do
834 - if [[ -d "${DIR}" ]] ; then
835 - find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
836 - fi
837 - done
838 -
839 - fi
840 -}
841 -
842 -pkg_postrm() {
843 - dual_scripts
844 -}
845
846 diff --git a/dev-lang/perl/perl-5.34.0.ebuild b/dev-lang/perl/perl-5.34.0.ebuild
847 deleted file mode 100644
848 index a9aa55e7376..00000000000
849 --- a/dev-lang/perl/perl-5.34.0.ebuild
850 +++ /dev/null
851 @@ -1,819 +0,0 @@
852 -# Copyright 1999-2021 Gentoo Authors
853 -# Distributed under the terms of the GNU General Public License v2
854 -
855 -EAPI=7
856 -
857 -inherit alternatives flag-o-matic toolchain-funcs multilib multiprocessing
858 -
859 -PATCH_VER=1
860 -CROSS_VER=1.3.6
861 -PATCH_BASE="perl-5.34.0-patches-${PATCH_VER}"
862 -PATCH_DEV=dilfridge
863 -
864 -DIST_AUTHOR=XSAWYERX
865 -
866 -# Greatest first, don't include yourself
867 -# Devel point-releases are not ABI-intercompatible, but stable point releases are
868 -# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
869 -PERL_BIN_OLDVERSEN=""
870 -
871 -# Yes we can.
872 -PERL_SINGLE_SLOT=y
873 -
874 -if [[ "${PV##*.}" == "9999" ]]; then
875 - DIST_VERSION=5.30.0
876 -else
877 - DIST_VERSION="${PV/_rc/-RC}"
878 -fi
879 -SHORT_PV="${DIST_VERSION%.*}"
880 -# Even numbered major versions are ABI intercompatible
881 -# Odd numbered major versions are not
882 -if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
883 - SUBSLOT="${DIST_VERSION%-RC*}"
884 -else
885 - SUBSLOT="${DIST_VERSION%.*}"
886 -fi
887 -# Used only in tar paths
888 -MY_P="perl-${DIST_VERSION}"
889 -# Used in library paths
890 -MY_PV="${DIST_VERSION%-RC*}"
891 -
892 -DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
893 -
894 -SRC_URI="
895 - mirror://cpan/src/5.0/${MY_P}.tar.xz
896 - mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
897 - https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz
898 - https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${PATCH_BASE}.tar.xz
899 - https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
900 -"
901 -HOMEPAGE="https://www.perl.org/"
902 -
903 -LICENSE="|| ( Artistic GPL-1+ )"
904 -SLOT="0/${SUBSLOT}"
905 -
906 -if [[ "${PV##*.}" != "9999" ]] && [[ "${PV/rc//}" == "${PV}" ]] ; then
907 -KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
908 -fi
909 -
910 -IUSE="berkdb debug doc gdbm ithreads minimal"
911 -
912 -RDEPEND="
913 - berkdb? ( sys-libs/db:= )
914 - gdbm? ( >=sys-libs/gdbm-1.8.3:= )
915 - app-arch/bzip2
916 - sys-libs/zlib
917 - virtual/libcrypt:=
918 -"
919 -DEPEND="${RDEPEND}"
920 -BDEPEND="${RDEPEND}"
921 -
922 -PDEPEND="
923 - !minimal? (
924 - >=app-admin/perl-cleaner-2.5
925 - >=virtual/perl-File-Temp-0.230.400-r2
926 - >=virtual/perl-Data-Dumper-2.154.0
927 - virtual/perl-Test-Harness
928 - )
929 -"
930 -# bug 390719, bug 523624
931 -# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
932 -
933 -S="${WORKDIR}/${MY_P}"
934 -
935 -dual_scripts() {
936 - src_remove_dual perl-core/Archive-Tar 2.380.0 ptar ptardiff ptargrep
937 - src_remove_dual perl-core/CPAN 2.280.0 cpan
938 - src_remove_dual perl-core/Digest-SHA 6.20.0 shasum
939 - src_remove_dual perl-core/Encode 3.80.0 enc2xs piconv
940 - src_remove_dual perl-core/ExtUtils-MakeMaker 7.620.0 instmodsh
941 - src_remove_dual perl-core/ExtUtils-ParseXS 3.430.0 xsubpp
942 - src_remove_dual perl-core/IO-Compress 2.102.0 zipdetails
943 - src_remove_dual perl-core/JSON-PP 4.60.0 json_pp
944 - src_remove_dual perl-core/Module-CoreList 5.202.105.200 corelist
945 - src_remove_dual perl-core/Pod-Checker 1.740.0 podchecker
946 - src_remove_dual perl-core/Pod-Perldoc 3.280.100 perldoc
947 - src_remove_dual perl-core/Pod-Usage 2.10.0 pod2usage
948 - src_remove_dual perl-core/Test-Harness 3.430.0 prove
949 - src_remove_dual perl-core/podlators 4.140.0 pod2man pod2text
950 - src_remove_dual_man perl-core/podlators 4.140.0 /usr/share/man/man1/perlpodstyle.1
951 -}
952 -
953 -check_rebuild() {
954 - # Fresh install
955 - if [[ -z "${REPLACING_VERSIONS}" ]]; then
956 - return 0;
957 - # Major Upgrade
958 - # doesn't matter if there's multiple copies, it still needs a rebuild
959 - # if the string is anything other than "5.CURRENTMAJOR"
960 - elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
961 - echo ""
962 - ewarn "UPDATE THE PERL MODULES:"
963 - ewarn "After updating dev-lang/perl the installed Perl modules"
964 - ewarn "have to be re-installed. In most cases, this is done automatically"
965 - ewarn "by the package manager, but subsequent steps are still recommended"
966 - ewarn "to ensure system consistency."
967 - ewarn
968 - ewarn "You should start with a depclean to remove any unused perl dependencies"
969 - ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
970 - ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
971 - ewarn "Recommended: emerge --depclean -va"
972 - ewarn
973 - ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
974 - ewarn "remaining rebuilds portage may have missed."
975 - ewarn "Use: perl-cleaner --all"
976 - return 0;
977 -
978 - # Reinstall w/ USE Change
979 - elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
980 - ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
981 - ( use debug && ! has_version dev-lang/perl[debug] ) || \
982 - ( ! use debug && has_version dev-lang/perl[debug] ) ; then
983 - echo ""
984 - ewarn "TOGGLED USE-FLAGS WARNING:"
985 - ewarn "You changed one of the use-flags ithreads or debug."
986 - ewarn "You must rebuild all perl-modules installed."
987 - ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
988 - fi
989 -}
990 -
991 -pkg_setup() {
992 - case ${CHOST} in
993 - *-freebsd*) osname="freebsd" ;;
994 - *-dragonfly*) osname="dragonfly" ;;
995 - *-netbsd*) osname="netbsd" ;;
996 - *-openbsd*) osname="openbsd" ;;
997 - *-darwin*) osname="darwin" ;;
998 - *-solaris*) osname="solaris" ;;
999 - *-cygwin*) osname="cygwin" ;;
1000 - *) osname="linux" ;;
1001 - esac
1002 -
1003 - myarch="${CHOST%%-*}-${osname}"
1004 - if use debug ; then
1005 - myarch+="-debug"
1006 - fi
1007 - if use ithreads ; then
1008 - mythreading="-multi"
1009 - myarch+="-thread"
1010 - fi
1011 -
1012 - PRIV_BASE="/usr/$(get_libdir)/perl5"
1013 - SITE_BASE="/usr/local/$(get_libdir)/perl5"
1014 - VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl"
1015 -
1016 - LIBPERL="libperl$(get_libname ${MY_PV} )"
1017 -
1018 - # This ENV var tells perl to build with a directory like "5.30"
1019 - # regardless of its patch version. This is for experts only
1020 - # at this point.
1021 - if [[ -z "${PERL_SINGLE_SLOT}" ]]; then
1022 - PRIV_LIB="${PRIV_BASE}/${MY_PV}"
1023 - ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}"
1024 - SITE_LIB="${SITE_BASE}/${MY_PV}"
1025 - SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}"
1026 - VENDOR_LIB="${VENDOR_BASE}/${MY_PV}"
1027 - VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}"
1028 - else
1029 - PRIV_LIB="${PRIV_BASE}/${SUBSLOT}"
1030 - ARCH_LIB="${PRIV_BASE}/${SUBSLOT}/${myarch}${mythreading}"
1031 - SITE_LIB="${SITE_BASE}/${SUBSLOT}"
1032 - SITE_ARCH="${SITE_BASE}/${SUBSLOT}/${myarch}${mythreading}"
1033 - VENDOR_LIB="${VENDOR_BASE}/${SUBSLOT}"
1034 - VENDOR_ARCH="${VENDOR_BASE}/${SUBSLOT}/${myarch}${mythreading}"
1035 - fi
1036 -
1037 - dual_scripts
1038 -}
1039 -
1040 -src_remove_dual_file() {
1041 - local i pkg ver
1042 - pkg="$1"
1043 - ver="$2"
1044 - shift 2
1045 - case "${EBUILD_PHASE:-none}" in
1046 - postinst|postrm)
1047 - for i in "$@" ; do
1048 - alternatives_auto_makesym "${i}" "${i}-[0-9]*"
1049 - done
1050 - ;;
1051 - setup)
1052 - for i in "$@" ; do
1053 - if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
1054 - has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
1055 - break
1056 - fi
1057 - done
1058 - ;;
1059 - install)
1060 - for i in "$@" ; do
1061 - if ! [[ -f "${ED}"${i} ]] ; then
1062 - ewarn "${i} does not exist!"
1063 - continue
1064 - fi
1065 - mv "${ED}"${i}{,-${ver}-${P}} || die
1066 - done
1067 - ;;
1068 - esac
1069 -}
1070 -
1071 -src_remove_dual_man() {
1072 - local i pkg ver ff
1073 - pkg="$1"
1074 - ver="$2"
1075 - shift 2
1076 - case "${EBUILD_PHASE:-none}" in
1077 - postinst|postrm)
1078 - for i in "$@" ; do
1079 - ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
1080 - ff=${ff##*${i#${i%.[0-9]}}}
1081 - alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
1082 - done
1083 - ;;
1084 - install)
1085 - for i in "$@" ; do
1086 - if ! [[ -f "${ED}"${i} ]] ; then
1087 - ewarn "${i} does not exist!"
1088 - continue
1089 - fi
1090 - mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
1091 - done
1092 - ;;
1093 - esac
1094 -}
1095 -
1096 -src_remove_dual() {
1097 - local i pkg ver
1098 - pkg="$1"
1099 - ver="$2"
1100 - shift 2
1101 - for i in "$@" ; do
1102 - src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
1103 - src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
1104 - done
1105 -}
1106 -
1107 -src_prepare_perlcross() {
1108 - cp -a ../perl-cross-${CROSS_VER}/* . || die
1109 -
1110 - # bug 604072
1111 - MAKEOPTS+=" -j1"
1112 - export MAKEOPTS
1113 -}
1114 -src_prepare_dynamic() {
1115 - ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
1116 - ln -s ${LIBPERL} libperl$(get_libname ) || die
1117 -}
1118 -
1119 -# Copy a patch into the patch series
1120 -# add_patch SRC_PATH DEST_NAME ['description'] ['bug'] ['bug']
1121 -# - description is optional, but recommended
1122 -# - all arguments after descriptions are bug URLs
1123 -add_patch() {
1124 - local patchdir="${WORKDIR}/patches"
1125 - local infodir="${WORKDIR}/patch-info"
1126 - local src_name dest_name desc
1127 - src_name="$1"
1128 - dest_name="$2"
1129 - desc="$3"
1130 - shift; shift; shift;
1131 - einfo "Adding ${dest_name} to patch bundle"
1132 - cp "${src_name}" "${patchdir}/${dest_name}" || die "Couldn't copy ${src_name} to ${dest_name}"
1133 - if [[ -n "${desc}" ]]; then
1134 - printf "%s" "${desc}" > "${infodir}/${dest_name}.desc" || die "Couldn't write ${dest_name}.desc"
1135 - fi
1136 - if [[ $# -gt 0 ]]; then
1137 - # Note: when $@ is more than one element, this emits a
1138 - # line for each element
1139 - printf "%s\n" "$@" > "${infodir}/${dest_name}.bugs" || die "Couldn't write ${dest_name}.bugs"
1140 - fi
1141 -}
1142 -# Remove a patch using a glob expr
1143 -# eg:
1144 -# rm_patch *-darin-Use-CC*
1145 -#
1146 -rm_patch() {
1147 - local patchdir="${WORKDIR}/patches"
1148 - local expr="$1"
1149 - local patch="$( cd "${patchdir}"; echo $expr )"
1150 - einfo "Removing $patch ($expr) from patch bundle"
1151 - if [[ -e "${patchdir}/${patch}" ]]; then
1152 - rm -f "${patchdir}/${patch}" || die "Can't remove ${patch} ( $expr )"
1153 - else
1154 - ewarn "No ${expr} found in ${patchdir} to remove"
1155 - fi
1156 -}
1157 -# Yes, this is a reasonable amount of code for something seemingly simple
1158 -# but this is far easier to debug when things go wrong, and things went wrong
1159 -# multiple times while I was getting the exact number of slashes right, which
1160 -# requires circumnavigating both bash and sed escape mechanisms.
1161 -c_escape_string() {
1162 - local slash dquote
1163 - slash='\'
1164 - dquote='"'
1165 - re_slash="${slash}${slash}"
1166 - re_dquote="${slash}${dquote}"
1167 -
1168 - # Convert \ to \\,
1169 - # " to \"
1170 - echo "$1" |\
1171 - sed "s|${re_slash}|${re_slash}${re_slash}|g" |\
1172 - sed "s|${re_dquote}|${re_slash}${re_dquote}|g"
1173 -}
1174 -c_escape_file() {
1175 - c_escape_string "$(cat "$1")"
1176 -}
1177 -
1178 -apply_patchdir() {
1179 - local patchdir="${WORKDIR}/patches"
1180 - local infodir="${WORKDIR}/patch-info"
1181 - local patchoutput="patchlevel-gentoo.h"
1182 -
1183 - # Inject Patch-Level info into description for patchlevel.h patch
1184 - # to show in -V
1185 - local patch_expr="*List-packaged-patches*"
1186 - local patch="$( cd "${patchdir}"; echo $patch_expr )";
1187 - einfo "Injecting patch-level info into ${patch}.desc ( $patch_expr )"
1188 -
1189 - if [[ -e "${patchdir}/${patch}" ]]; then
1190 - printf "List packaged patches for %s(%s) in patchlevel.h" "${PF}" "${PATCH_BASE}"\
1191 - >"${infodir}/${patch}.desc" || die "Can't rewrite ${patch}.desc"
1192 - else
1193 - eerror "No $patch_expr found in ${patchdir}"
1194 - fi
1195 -
1196 - # Compute patch list to apply
1197 - # different name other than PATCHES to stop default
1198 - # reapplying it
1199 - # Single depth is currently only supported, as artifacts can reside
1200 - # from the old layout being multiple-directories, as well as it grossly
1201 - # simplifying the patchlevel_gentoo.h generation.
1202 - local PERL_PATCHES=($(
1203 - find "${patchdir}" -maxdepth 1 -mindepth 1 -type f -printf "%f\n" |\
1204 - grep -E '[.](diff|patch)$' |\
1205 - sort -n
1206 - ))
1207 -
1208 - for patch in "${PERL_PATCHES[@]}"; do
1209 - eapply "${WORKDIR}"/patches/${patch}
1210 - done
1211 -
1212 - einfo "Generating $patchoutput"
1213 -
1214 - # This code creates a header file, each iteration
1215 - # creates one-or-more-lines for each entry found in PERL_PATCHES
1216 - # and STDOUT is redirected to the .h file
1217 - for patch in "${PERL_PATCHES[@]}"; do
1218 - local desc_f="${infodir}/${patch}.desc"
1219 - local bugs_f="${infodir}/${patch}.bugs"
1220 -
1221 - printf ',"%s"\n' "${patch}"
1222 - if [[ ! -e "${desc_f}" ]]; then
1223 - ewarn "No description provided for ${patch} (expected: ${desc_f} )"
1224 - else
1225 - local desc="$(c_escape_file "${desc_f}")"
1226 - printf ',"- %s"\n' "${desc}"
1227 - fi
1228 - if [[ -e "${bugs_f}" ]]; then
1229 - while read -d $'\n' -r line; do
1230 - local esc_line="$(c_escape_string "${line}")"
1231 - printf ',"- Bug: %s"\n' "${esc_line}"
1232 - done <"${bugs_f}"
1233 - fi
1234 - done > "${S}/${patchoutput}"
1235 - printf "%s\n" "${patchoutput}" >> "${S}/MANIFEST"
1236 -
1237 -}
1238 -src_prepare() {
1239 - local patchdir="${WORKDIR}/patches"
1240 -
1241 - # Prepare Patch dir with additional patches / remove unwanted patches
1242 - # Inject bug/desc entries for perl -V
1243 - # Old example:
1244 - # add_patch "${FILESDIR}/${PN}-5.26.2-hppa.patch" "100-5.26.2-hppa.patch"\
1245 - # "Fix broken miniperl on hppa"\
1246 - # "https://bugs.debian.org/869122" "https://bugs.gentoo.org/634162"
1247 -
1248 - if [[ ${CHOST} == *-solaris* ]] ; then
1249 - # do NOT mess with nsl, on Solaris this is always necessary,
1250 - # when -lsocket is used e.g. to get h_errno
1251 - rm_patch "*-nsl-and-cl*"
1252 - fi
1253 -
1254 - apply_patchdir
1255 -
1256 - tc-is-cross-compiler && src_prepare_perlcross
1257 -
1258 - tc-is-static-only || src_prepare_dynamic
1259 -
1260 - if use gdbm; then
1261 - sed -i "s:INC => .*:INC => \"-I${EROOT}/usr/include/gdbm\":g" \
1262 - ext/NDBM_File/Makefile.PL || die
1263 - fi
1264 -
1265 - # Use errno.h from prefix rather than from host system, bug #645804
1266 - if use prefix && [[ -e "${EPREFIX}"/usr/include/errno.h ]] ; then
1267 - sed -i "/my..sysroot/s:'':'${EPREFIX}':" ext/Errno/Errno_pm.PL || die
1268 - fi
1269 -
1270 - if [[ ${CHOST} == *-solaris* ]] ; then
1271 - # set a soname, fix linking against just built libperl
1272 - sed -i -e 's/netbsd\*/netbsd*|solaris*/' Makefile.SH || die
1273 - fi
1274 -
1275 - if [[ ${CHOST} == *-darwin* ]] ; then
1276 - # fix install_name (soname) not to reference $D
1277 - sed -i -e '/install_name `pwd/s/`pwd`/\\$(shrpdir)/' Makefile.SH || die
1278 - fi
1279 -
1280 - default
1281 -}
1282 -
1283 -myconf() {
1284 - # the myconf array is declared in src_configure
1285 - myconf=( "${myconf[@]}" "$@" )
1286 -}
1287 -
1288 -# Outputs a list of versions which have been seen in any of the
1289 -# primary perl @INC prefix paths, such as:
1290 -# /usr/lib64/perl5/<NUMBER>
1291 -# /usr/local/lib64/perl5/<NUMBER>
1292 -# /usr/lib64/perl5/vendor_perl/<NUMBER>
1293 -#
1294 -# All values of NUMBER must be like "5.x.y", unless PERL_SUPPORT_SINGLE_SLOT
1295 -# is enabled, where it will also allow numbers like "5.x"
1296 -#
1297 -# PERL_SUPPORT_SINGLE_SLOT should only be used to transition *away* from PERL_SINGLE_SLOT
1298 -# if you used that.
1299 -find_candidate_inc_versions() {
1300 - local regex='.*/5[.][0-9]+[.][0-9]+$';
1301 - if [[ ! -z "${PERL_SUPPORT_SINGLE_SLOT}" || ! -z "${PERL_SINGLE_SLOT}" ]]; then
1302 - regex='.*/5[.][0-9]+\([.][0-9]+\|\)$'
1303 - fi
1304 - local dirs=(
1305 - "${EROOT}${PRIV_BASE}"
1306 - "${EROOT}${SITE_BASE}"
1307 - "${EROOT}${VENDOR_BASE}"
1308 - )
1309 - for dir in "${dirs[@]}"; do
1310 - if [[ ! -e "${dir}" ]]; then
1311 - continue
1312 - fi
1313 - # Without access to readdir() on these dirs, find will not be able
1314 - # to reveal any @INC directories inside them, and will subsequently prune
1315 - # them from the built perl's @INC support, breaking our compatiblity options
1316 - # entirely.
1317 - if [[ ! -r "${dir}" || ! -x "${dir}" ]]; then
1318 - eerror "Bad permissions on ${dir}, this will probably break things"
1319 - eerror "Ensure ${dir} is +rx for at least uid=$EUID"
1320 - eerror "Recommended permission is +rx for all"
1321 - eerror "> chmod o+rx ${dir}"
1322 - fi
1323 - done
1324 - einfo "Scanning for old @INC dirs matching '$regex' in: ${dirs[*]}"
1325 - find "${dirs[@]}" -maxdepth 1 -mindepth 1 -type d -regex "${regex}" -printf "%f " 2>/dev/null
1326 -}
1327 -# Sort versions passed versiony-ly, remove self-version if present
1328 -# dedup. Takes each version as an argument
1329 -sanitize_inc_versions() {
1330 - local vexclude="${DIST_VERSION%-RC}"
1331 - if [[ ! -z "${PERL_SINGLE_SLOT}" ]]; then
1332 - vexclude="${SUBSLOT}"
1333 - fi
1334 - einfo "Normalizing/Sorting candidate list: $*"
1335 - einfo " to remove '${vexclude}'"
1336 - # Note, general numeric sort has to be used
1337 - # for the last component, or unique will convert
1338 - # 5.30.0 + 5.30 into just 5.30
1339 - printf "%s\n" "$@" |\
1340 - grep -vxF "${vexclude}" |\
1341 - sort -u -nr -t'.' -k1,1rn -k2,2rn -k3,3rg
1342 -}
1343 -
1344 -versions_to_inclist() {
1345 - local oldv="${PERL_BIN_OLDVERSEN}"
1346 - if [[ ! -z "${PERL_SINGLE_SLOT}" ]]; then
1347 - oldv="${DIST_VERSION%-RC} ${PERL_BIN_OLDVERSEN}"
1348 - fi
1349 - for v; do
1350 - has "${v}" ${oldv} && echo -n "${v}/${myarch}${mythreading}/ ";
1351 - echo -n "${v}/ ";
1352 - done
1353 -}
1354 -versions_to_gentoolibdirs() {
1355 - local oldv="${PERL_BIN_OLDVERSEN}"
1356 - local root
1357 - local v
1358 - if [[ ! -z "${PERL_SINGLE_SLOT}" ]]; then
1359 - oldv="${DIST_VERSION%-RC} ${PERL_BIN_OLDVERSEN}"
1360 - fi
1361 - for v; do
1362 - for root in "${PRIV_BASE}" "${VENDOR_BASE}" "${SITE_BASE}"; do
1363 - local fullpath="${EROOT}${root}/${v}"
1364 - if [[ -e "${fullpath}" ]]; then
1365 - has "${v}" ${oldv} && printf "%s:" "${fullpath}/${myarch}${mythreading}";
1366 - printf "%s:" "${fullpath}"
1367 - fi
1368 - done
1369 - done
1370 -}
1371 -
1372 -src_configure() {
1373 - declare -a myconf
1374 -
1375 - export LC_ALL="C"
1376 - [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
1377 -
1378 - # Perl has problems compiling with -Os in your flags with glibc
1379 - use elibc_uclibc || replace-flags "-Os" "-O2"
1380 -
1381 - # xlocale.h is going away in glibc-2.26, so it's counterproductive
1382 - # if we use it and include it in CORE/perl.h ... Perl builds just
1383 - # fine with glibc and locale.h only.
1384 - # However, the darwin prefix people have no locale.h ...
1385 - use elibc_glibc && myconf -Ui_xlocale
1386 -
1387 - # This flag makes compiling crash in interesting ways
1388 - filter-flags "-malign-double"
1389 -
1390 - # Generic LTO broken since 5.28, triggers EUMM failures
1391 - filter-flags "-flto"
1392 -
1393 - use sparc && myconf -Ud_longdbl
1394 -
1395 - export BUILD_BZIP2=0
1396 - export BZIP2_INCLUDE=${EROOT}/usr/include
1397 - export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
1398 -
1399 - export BUILD_ZLIB=False
1400 - export ZLIB_INCLUDE=${EROOT}/usr/include
1401 - export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
1402 -
1403 - # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
1404 - myndbm='U'
1405 - mygdbm='U'
1406 - mydb='U'
1407 - if use gdbm ; then
1408 - mygdbm='D'
1409 - if use berkdb ; then
1410 - myndbm='D'
1411 - fi
1412 - fi
1413 - if use berkdb ; then
1414 - mydb='D'
1415 - has_version '=sys-libs/db-1*' && myndbm='D'
1416 - fi
1417 -
1418 - myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
1419 -
1420 - if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
1421 - ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
1422 - myconf -Ui_db -Ui_ndbm
1423 - fi
1424 -
1425 - use ithreads && myconf -Dusethreads
1426 -
1427 - if use debug ; then
1428 - append-cflags "-g"
1429 - myconf -DDEBUGGING
1430 - elif [[ ${CFLAGS} == *-g* ]] ; then
1431 - myconf -DDEBUGGING=-g
1432 - else
1433 - myconf -DDEBUGGING=none
1434 - fi
1435 -
1436 - # modifying 'optimize' prevents cross configure script from appending required flags
1437 - if tc-is-cross-compiler; then
1438 - append-cflags "-fwrapv -fno-strict-aliasing"
1439 - fi
1440 -
1441 - # Autodiscover all old version directories, some of them will even be newer
1442 - # if you downgrade
1443 - if [[ -z ${PERL_OLDVERSEN} ]]; then
1444 - PERL_OLDVERSEN="$( find_candidate_inc_versions )"
1445 - fi
1446 -
1447 - # Fixup versions, removing self match, fixing order and dupes
1448 - PERL_OLDVERSEN="$( sanitize_inc_versions ${PERL_OLDVERSEN} )"
1449 -
1450 - # Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string
1451 - if [[ -n "${PERL_OLDVERSEN// }" ]]; then
1452 - local inclist="$( versions_to_inclist ${PERL_OLDVERSEN} )"
1453 - einfo "This version of perl may partially support modules previously"
1454 - einfo "installed in any of the following paths:"
1455 - for incpath in ${inclist}; do
1456 - [[ -e "${EROOT}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT}${VENDOR_BASE}/${incpath}"
1457 - [[ -e "${EROOT}${PRIV_BASE}/${incpath}" ]] && einfo " ${EROOT}${PRIV_BASE}/${incpath}"
1458 - [[ -e "${EROOT}${SITE_BASE}/${incpath}" ]] && einfo " ${EROOT}${SITE_BASE}/${incpath}"
1459 - done
1460 - einfo "This is a temporary measure and you should aim to cleanup these paths"
1461 - einfo "via world updates and perl-cleaner"
1462 - # myconf -Dinc_version_list="${inclist}"
1463 - myconf -Dgentoolibdirs="$( versions_to_gentoolibdirs ${PERL_OLDVERSEN} )"
1464 - fi
1465 -
1466 - [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
1467 -
1468 - # Make sure we can do the final link #523730, need to set deployment
1469 - # target to override hardcoded 10.3 which breaks on modern OSX
1470 - [[ ${CHOST} == *-darwin* ]] && \
1471 - myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
1472 -
1473 - # Older macOS with non-Apple GCC chokes on inline in system headers
1474 - # using c89 mode as injected by cflags.SH
1475 - [[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
1476 - append-cflags -Dinline=__inline__
1477 -
1478 - # flock on 32-bit sparc Solaris is broken, fall back to fcntl
1479 - [[ ${CHOST} == sparc-*-solaris* ]] && \
1480 - myconf -Ud_flock
1481 -
1482 - # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
1483 - # Prefix itself we don't do multilib either, so make sure perl can find
1484 - # something compatible.
1485 - if use prefix ; then
1486 - # Set a hook to check for each detected library whether it actually works.
1487 - export libscheck="
1488 - ( echo 'main(){}' > '${T}'/conftest.c &&
1489 - $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
1490 - ) || xxx=/dev/null"
1491 -
1492 - # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
1493 - local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
1494 - myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
1495 - elif [[ $(get_libdir) != "lib" ]] ; then
1496 - # We need to use " and not ', as the written config.sh use ' ...
1497 - myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
1498 - fi
1499 -
1500 - # don't try building ODBM, bug #354453
1501 - disabled_extensions="ODBM_File"
1502 -
1503 - if ! use gdbm ; then
1504 - # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
1505 - disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
1506 - fi
1507 -
1508 - myconf -Dnoextensions="${disabled_extensions}"
1509 -
1510 - [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
1511 -
1512 - [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
1513 - # allow fiddling via EXTRA_ECONF, bug 558070
1514 - eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
1515 -
1516 - # setting -Dld= to tc-getLD breaks perl and all perl things
1517 - # https://github.com/Perl/perl5/issues/17791#issuecomment-630145202
1518 - myconf \
1519 - -Duseshrplib \
1520 - -Darchname="${myarch}" \
1521 - -Dcc="$(tc-getCC)" \
1522 - -Dar="$(tc-getAR)" \
1523 - -Dnm="$(tc-getNM)" \
1524 - -Dcpp="$(tc-getCPP)" \
1525 - -Dranlib="$(tc-getRANLIB)" \
1526 - -Doptimize="${CFLAGS}" \
1527 - -Dldflags="${LDFLAGS}" \
1528 - -Dprefix="${EPREFIX}"'/usr' \
1529 - -Dsiteprefix="${EPREFIX}"'/usr/local' \
1530 - -Dvendorprefix="${EPREFIX}"'/usr' \
1531 - -Dscriptdir="${EPREFIX}"'/usr/bin' \
1532 - -Dprivlib="${EPREFIX}${PRIV_LIB}" \
1533 - -Darchlib="${EPREFIX}${ARCH_LIB}" \
1534 - -Dsitelib="${EPREFIX}${SITE_LIB}" \
1535 - -Dsitearch="${EPREFIX}${SITE_ARCH}" \
1536 - -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
1537 - -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
1538 - -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
1539 - -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
1540 - -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
1541 - -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
1542 - -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
1543 - -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
1544 - -Dman1ext='1' \
1545 - -Dman3ext='3pm' \
1546 - -Dlibperl="${LIBPERL}" \
1547 - -Dlocincpth="${EPREFIX}"'/usr/include ' \
1548 - -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
1549 - -Duselargefiles \
1550 - -Dd_semctl_semun \
1551 - -Dcf_by='Gentoo' \
1552 - -Dmyhostname='localhost' \
1553 - -Dperladmin='root@localhost' \
1554 - -Ud_csh \
1555 - -Dsh="${EPREFIX}"/bin/sh \
1556 - -Dtargetsh="${EPREFIX}"/bin/sh \
1557 - -Uusenm \
1558 - "${myconf[@]}" \
1559 - "${EXTRA_ECONF[@]}"
1560 -
1561 - if tc-is-cross-compiler; then
1562 - ./configure \
1563 - --target="${CHOST}" \
1564 - --build="${CBUILD}" \
1565 - -Dinstallprefix='' \
1566 - -Dinstallusrbinperl='undef' \
1567 - -Dusevendorprefix='define' \
1568 - "${myconf[@]}" \
1569 - || die "Unable to configure"
1570 - else
1571 - sh Configure \
1572 - -des \
1573 - -Dinstallprefix="${EPREFIX}"'/usr' \
1574 - -Dinstallusrbinperl='n' \
1575 - "${myconf[@]}" \
1576 - || die "Unable to configure"
1577 - fi
1578 -}
1579 -
1580 -src_test() {
1581 - export NO_GENTOO_NETWORK_TESTS=1;
1582 - export GENTOO_ASSUME_SANDBOXED="${GENTOO_ASSUME_SANDBOXED:-1}"
1583 - export GENTOO_NO_PORTING_TESTS="${GENTOO_NO_PORTING_TESTS:-1}"
1584 - if [[ ${EUID} == 0 ]] ; then
1585 - ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
1586 - return 0
1587 - fi
1588 - use elibc_uclibc && export MAKEOPTS+=" -j1"
1589 - TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
1590 -}
1591 -
1592 -src_install() {
1593 - local i
1594 - local coredir="${ARCH_LIB}/CORE"
1595 -
1596 - emake DESTDIR="${D}" install
1597 -
1598 - rm -f "${ED}/usr/bin/perl${MY_PV}"
1599 - ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
1600 -
1601 - if ! tc-is-static-only ; then
1602 - dolib.so "${ED}"${coredir}/${LIBPERL}
1603 - rm -f "${ED}"${coredir}/${LIBPERL}
1604 - ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
1605 - ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
1606 -
1607 - ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
1608 - ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
1609 - ln -sf ../../../../${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
1610 - fi
1611 -
1612 - rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
1613 -
1614 - # This removes ${D} from Config.pm
1615 - for i in $(find "${D}" -iname "Config.pm" ) ; do
1616 - einfo "Removing ${D} from ${i}..."
1617 - sed -i -e "s:${D}::" "${i}" || die "Sed failed"
1618 - done
1619 -
1620 - dodoc Changes* README AUTHORS
1621 -
1622 - if use doc ; then
1623 - # HTML Documentation
1624 - # We expect errors, warnings, and such with the following.
1625 -
1626 - dodir /usr/share/doc/${PF}/html
1627 - LD_LIBRARY_PATH=. ./perl installhtml \
1628 - --podroot='.' \
1629 - --podpath='lib:ext:pod:vms' \
1630 - --recurse \
1631 - --htmldir="${ED}/usr/share/doc/${PF}/html"
1632 - fi
1633 -
1634 - [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
1635 -
1636 - dual_scripts
1637 -}
1638 -
1639 -pkg_preinst() {
1640 - check_rebuild
1641 -}
1642 -
1643 -pkg_postinst() {
1644 - dual_scripts
1645 -
1646 - if [[ "${ROOT}" = "/" ]] ; then
1647 - local INC DIR file
1648 - INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
1649 - einfo "Removing old .ph files"
1650 - for DIR in ${INC} ; do
1651 - if [[ -d "${DIR}" ]] ; then
1652 - for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
1653 - rm -f "${file}"
1654 - einfo "<< ${file}"
1655 - done
1656 - fi
1657 - done
1658 - # Silently remove the now empty dirs
1659 - for DIR in ${INC} ; do
1660 - if [[ -d "${DIR}" ]] ; then
1661 - find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
1662 - fi
1663 - done
1664 -
1665 - fi
1666 -}
1667 -
1668 -pkg_postrm() {
1669 - dual_scripts
1670 -}