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