Diff perl-5.24.4 with a perl-5.26.2

/usr/portage/dev-lang/perl/perl-5.26.2.ebuild 2019-02-16 12:09:00.000000000 +0300
1
# Copyright 1999-2018 Gentoo Foundation
1
# Copyright 1999-2019 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4 4
EAPI=6
......
7 7

  
8 8
PATCH_VER=1
9 9
CROSS_VER=1.1.9
10
PATCH_BASE="perl-5.24.4-patches-${PATCH_VER}"
10
PATCH_BASE="perl-5.26.2-patches-${PATCH_VER}"
11 11

  
12
PERL_OLDVERSEN="5.24.3 5.24.2 5.24.1 5.24.0"
13 12
DIST_AUTHOR=SHAY
14 13

  
15
SHORT_PV="${PV%.*}"
16
MY_P="perl-${PV/_rc/-RC}"
17
MY_PV="${PV%_rc*}"
14
# Greatest first, don't include yourself
15
# Devel point-releases are not ABI-intercompatible, but stable point releases are
16
# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions
17
PERL_BIN_OLDVERSEN="5.26.1 5.26.0"
18
if [[ "${PV##*.}" == "9999" ]]; then
19
	DIST_VERSION=5.26.2
20
else
21
	DIST_VERSION="${PV/_rc/-RC}"
22
fi
23
SHORT_PV="${DIST_VERSION%.*}"
24
# Even numbered major versions are ABI intercompatible
25
# Odd numbered major versions are not
26
if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then
27
	SUBSLOT="${DIST_VERSION%-RC*}"
28
else
29
	SUBSLOT="${DIST_VERSION%.*}"
30
fi
31
# Used only in tar paths
32
MY_P="perl-${DIST_VERSION}"
33
# Used in library paths
34
MY_PV="${DIST_VERSION%-RC*}"
18 35

  
19 36
DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
20 37

  
......
29 46
HOMEPAGE="https://www.perl.org/"
30 47

  
31 48
LICENSE="|| ( Artistic GPL-1+ )"
32
SLOT="0/${SHORT_PV}"
33
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
49
SLOT="0/${SUBSLOT}"
50

  
51
if [[ "${PV##*.}" != "9999" ]]; then
52
KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
53
fi
54

  
34 55
IUSE="berkdb debug doc gdbm ithreads"
35 56

  
36 57
RDEPEND="
......
44 65
"
45 66
PDEPEND="
46 67
	>=app-admin/perl-cleaner-2.5
47
	>=virtual/perl-File-Path-2.130.0
48 68
	>=virtual/perl-File-Temp-0.230.400-r2
49 69
	>=virtual/perl-Data-Dumper-2.154.0
50 70
	virtual/perl-Test-Harness
51 71
"
52
# bug 390719, bug 523624, bug 620304
72
# bug 390719, bug 523624
53 73
# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
54 74

  
55 75
S="${WORKDIR}/${MY_P}"
56 76

  
57 77
dual_scripts() {
58
	src_remove_dual      perl-core/Archive-Tar        2.40.100_rc   ptar ptardiff ptargrep
59
	src_remove_dual      perl-core/CPAN               2.110.100_rc  cpan
60
	src_remove_dual      perl-core/Digest-SHA         5.950.100_rc  shasum
61
	src_remove_dual      perl-core/Encode             2.800.100_rc  enc2xs piconv
62
	src_remove_dual      perl-core/ExtUtils-MakeMaker 7.100.200_rc  instmodsh
63
	src_remove_dual      perl-core/ExtUtils-ParseXS   3.310.0       xsubpp
64
	src_remove_dual      perl-core/IO-Compress        2.69.1_rc          zipdetails
65
	src_remove_dual      perl-core/JSON-PP            2.273.0.100_rc     json_pp
66
	src_remove_dual      perl-core/Module-CoreList    5.201.804.142.400_rc  corelist
78
	src_remove_dual      perl-core/Archive-Tar        2.240.0       ptar ptardiff ptargrep
79
	src_remove_dual      perl-core/CPAN               2.180.0       cpan
80
	src_remove_dual      perl-core/Digest-SHA         5.960.0       shasum
81
	src_remove_dual      perl-core/Encode             2.880.0       enc2xs piconv
82
	src_remove_dual      perl-core/ExtUtils-MakeMaker 7.240.0       instmodsh
83
	src_remove_dual      perl-core/ExtUtils-ParseXS   3.340.0       xsubpp
84
	src_remove_dual      perl-core/IO-Compress        2.74.0        zipdetails
85
	src_remove_dual      perl-core/JSON-PP            2.274.0.200_rc   json_pp
86
	src_remove_dual      perl-core/Module-CoreList    5.201.804.142.600_rc corelist
67 87
	src_remove_dual      perl-core/Pod-Parser         1.630.0       pod2usage podchecker podselect
68
	src_remove_dual      perl-core/Pod-Perldoc        3.250.300_rc  perldoc
69
	src_remove_dual      perl-core/Test-Harness       3.360.100_rc  prove
70
	src_remove_dual      perl-core/podlators          4.70.0        pod2man pod2text
71
	src_remove_dual_man  perl-core/podlators          4.70.0        /usr/share/man/man1/perlpodstyle.1
88
	src_remove_dual      perl-core/Pod-Perldoc        3.280.0       perldoc
89
	src_remove_dual      perl-core/Test-Harness       3.380.0       prove
90
	src_remove_dual      perl-core/podlators          4.90.0        pod2man pod2text
91
	src_remove_dual_man  perl-core/podlators          4.90.0        /usr/share/man/man1/perlpodstyle.1
72 92
}
73 93

  
74 94
check_rebuild() {
......
131 151
		myarch+="-thread"
132 152
	fi
133 153

  
154
	PRIV_BASE="/usr/$(get_libdir)/perl5"
155
	SITE_BASE="/usr/local/$(get_libdir)/perl5"
156
	VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl"
157

  
134 158
	LIBPERL="libperl$(get_libname ${MY_PV} )"
135
	PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}"
136
	ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
137
	SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}"
138
	SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
139
	VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}"
140
	VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}"
159
	PRIV_LIB="${PRIV_BASE}/${MY_PV}"
160
	ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}"
161
	SITE_LIB="${SITE_BASE}/${MY_PV}"
162
	SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}"
163
	VENDOR_LIB="${VENDOR_BASE}/${MY_PV}"
164
	VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}"
141 165

  
142 166
	dual_scripts
143 167
}
......
258 282
echo "${patchoutput}" >> "${S}/MANIFEST"
259 283
}
260 284

  
285
src_prepare_perlcross() {
286
	cp -a ../perl-cross-${CROSS_VER}/* . || die
287

  
288
	sed -i \
289
		-e 's/MakeMaker\.pm .*/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1/' \
290
		-e 's/MM_Unix\.pm .*/MM_Unix.pm b0ec308fe2d7dcfcef5732880db0fae1f4ea80fa/' \
291
		cnf/diffs/perl5-${PV}/customized.patch || die
292

  
293
	sed -i \
294
		-e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \
295
		Makefile || die
296

  
297
	# bug 604072
298
	MAKEOPTS+=" -j1"
299
	export MAKEOPTS
300
}
301
src_prepare_dynamic() {
302
	ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
303
	ln -s ${LIBPERL} libperl$(get_libname ) || die
304
}
305

  
261 306
src_prepare() {
262 307
	local patch
263 308
	EPATCH_OPTS+=" -p1"
264
	einfo "Applying patches from ${MY_P}-${PATCH_VER} ..."
309

  
310
	if use hppa ; then
311
		epatch "${FILESDIR}/${PN}-5.26.2-hppa.patch" # bug 634162
312
	fi
313

  
314
	if [[ ${CHOST} == *-solaris* ]] ; then
315
		# do NOT mess with nsl, on Solaris this is always necessary,
316
		# when -lsocket is used e.g. to get h_errno
317
		sed -i '/gentoo\/no-nsl\.patch/d' "${WORKDIR}/patches/series" || die "Can't exclude libnsl patch"
318
	fi
319

  
320
	einfo "Applying patches from ${PATCH_BASE} ..."
265 321
	while read patch ; do
266 322
		EPATCH_SINGLE_MSG="  ${patch} ..."
267 323
		epatch "${WORKDIR}"/patches/${patch}
......
269 325

  
270 326
	src_prepare_update_patchlevel_h
271 327

  
272
	if tc-is-cross-compiler; then
273
		cp -a ../perl-cross-${CROSS_VER}/* . || die
328
	tc-is-cross-compiler && src_prepare_perlcross
274 329

  
275
		sed -i \
276
			-e 's/(15 + $CLEANUP)/(13 + $CLEANUP)/' \
277
			cnf/diffs/perl5-${PV}/makemaker-test.patch || die
278

  
279
		sed -i \
280
			-e 's/MakeMaker\.pm .*/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1/' \
281
			-e 's/MM_Unix\.pm .*/MM_Unix.pm b0ec308fe2d7dcfcef5732880db0fae1f4ea80fa/' \
282
			cnf/diffs/perl5-${PV}/customized.patch || die
283

  
284
		sed -i \
285
			-e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \
286
			Makefile || die
287

  
288
		# bug 604072
289
		MAKEOPTS+=" -j1"
290
		export MAKEOPTS
291
	fi
292

  
293
	if ! tc-is-static-only ; then
294
		ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
295
		ln -s ${LIBPERL} libperl$(get_libname ) || die
296
	fi
330
	tc-is-static-only || src_prepare_dynamic
297 331

  
298 332
	if use gdbm; then
299 333
		sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \
300 334
			ext/NDBM_File/Makefile.PL || die
301 335
	fi
302 336

  
337
	# Use errno.h from prefix rather than from host system, bug #645804
338
	if use prefix && [[ -e "${EPREFIX}"/usr/include/errno.h ]] ; then
339
		sed -i "/my..sysroot/s:'':'${EPREFIX}':" ext/Errno/Errno_pm.PL || die
340
	fi
341

  
303 342
	default
304 343
}
305 344

  
......
378 417
		myconf -DDEBUGGING=none
379 418
	fi
380 419

  
381
	if [[ -n ${PERL_OLDVERSEN} ]] ; then
382
		local inclist=$(for v in ${PERL_OLDVERSEN}; do echo -n "${v}/${myarch}${mythreading} ${v} "; done )
420
	# Autodiscover all old version directories, some of them will even be newer
421
	# if you downgrade
422
	if [[ -z ${PERL_OLDVERSEN} ]]; then
423
		PERL_OLDVERSEN="$(
424
			find "${EROOT%/}${PRIV_BASE}" "${EROOT%/}${SITE_BASE}" "${EROOT%/}${VENDOR_BASE}" \
425
				   -maxdepth 1 -mindepth 1 -type d -regex '.*/5[.][0-9]+[.][0-9]+$' \
426
				   -printf "%f "  2>/dev/null )"
427
	fi
428
	# Fixup versions, removing self match, fixing order and dupes
429
	PERL_OLDVERSEN="$(
430
		echo "${PERL_OLDVERSEN}"           |\
431
			tr " " "\n" 				   |\
432
			grep -vF "${DIST_VERSION%-RC}" |\
433
			sort -u -nr -t'.' -k1,1 -k2,2 -k3,3
434
	)"
435

  
436
	# Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string
437
	if [[ -n "${PERL_OLDVERSEN// }" ]]; then
438
		local inclist="$(
439
				for v in ${PERL_OLDVERSEN};	do
440
					has "${v}" ${PERL_BIN_OLDVERSEN} && echo -n "${v}/${myarch}${mythreading} ";
441
					echo -n "${v} ";
442
				done )"
443
		einfo "This version of perl may partially support modules previously"
444
		einfo "installed in any of the following paths:"
445
		for incpath in ${inclist}; do
446
			[[ -e "${EROOT%/}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${VENDOR_BASE}/${incpath}"
447
			[[ -e "${EROOT%/}${PRIV_BASE}/${incpath}"   ]] && einfo " ${EROO%/T}${PRIV_BASE}/${incpath}"
448
			[[ -e "${EROOT%/}${SITE_BASE}/${incpath}"   ]] && einfo " ${EROOT%/}${SITE_BASE}/${incpath}"
449
		done
450
		einfo "This is a temporary measure and you should aim to cleanup these paths"
451
		einfo "via world updates and perl-cleaner"
383 452
		myconf -Dinc_version_list="${inclist}"
384 453
	fi
385 454

  
......
390 459
	[[ ${CHOST} == *-darwin* ]] && \
391 460
		myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
392 461

  
462
	# Older macOS with non-Apple GCC chokes on inline in system headers
463
	# using c89 mode as injected by cflags.SH
464
	[[ ${CHOST} == *-darwin* && ${CHOST##*darwin} -le 9 ]] && tc-is-gcc && \
465
		append-cflags -Dinline=__inline__
466

  
393 467
	# Prefix: the host system needs not to follow Gentoo multilib stuff, and in
394 468
	# Prefix itself we don't do multilib either, so make sure perl can find
395 469
	# something compatible.
......
418 492

  
419 493
	myconf -Dnoextensions="${disabled_extensions}"
420 494

  
495
	[[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
496

  
421 497
	[[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
422 498
	# allow fiddling via EXTRA_ECONF, bug 558070
423 499
	eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
Thank you!