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