Gentoo Archives: gentoo-commits

From: Kent Fredric <kentnl@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/perl/
Date: Wed, 29 Mar 2017 06:30:29
Message-Id: 1490769016.9cd51b850b4d864a01f58806a336fa4466e72786.kentnl@gentoo
1 commit: 9cd51b850b4d864a01f58806a336fa4466e72786
2 Author: Kent Fredric <kentnl <AT> gentoo <DOT> org>
3 AuthorDate: Sat Mar 25 05:37:28 2017 +0000
4 Commit: Kent Fredric <kentnl <AT> gentoo <DOT> org>
5 CommitDate: Wed Mar 29 06:30:16 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9cd51b85
7
8 dev-lang/perl: Add 5.26.9999 periodic-snapshot version
9
10 This is a pre-release of 5.26 series and aims to be a
11 work-in-progress for the life of Perl 5.26.
12
13 Changes are intended to happen here first, and then get folded
14 out into actual releases.
15
16 This version requires grown-up mode and likely judicious use
17 of package.provided ( because at least at this time, requisite
18 virtuals are missing )
19
20 Also, this package is very ambitious and employs INC modifications
21 that incorporate a broader selection of previous perls' versions,
22 by re-including the architecture-independent paths from older
23 perls.
24
25 Its not known at this time if this is a viable strategy for a
26 final release, but it intends to make testing this easier.
27
28 ( Because you might need lots of --nodeps to use this version
29 to begin with )
30
31 Also, you may want to borrow from
32 https://github.com/gentoo-perl/perl-testing-profiles
33
34 Which has a few things optimised for doing this, and for testing
35 in general, including some workarounds for known defects / spurious
36 failures.
37
38 Package-Manager: Portage-2.3.4, Repoman-2.3.2
39
40 dev-lang/perl/Manifest | 2 +
41 dev-lang/perl/perl-5.26.9999.ebuild | 591 ++++++++++++++++++++++++++++++++++++
42 2 files changed, 593 insertions(+)
43
44 diff --git a/dev-lang/perl/Manifest b/dev-lang/perl/Manifest
45 index 54a833ca45a..af07577f554 100644
46 --- a/dev-lang/perl/Manifest
47 +++ b/dev-lang/perl/Manifest
48 @@ -7,6 +7,8 @@ DIST perl-5.24.1-RC4.tar.xz 11553836 SHA256 6da6333809eb2b35b17ee3c25b7f0327da32
49 DIST perl-5.24.1-patches-2.tar.xz 21124 SHA256 6b00ee799d0d2b88e641eb49800d0f756802540ec11e5d963bf19cd1de8f70a6 SHA512 c4c128d2ee62f57558f23c63fc12ae7f4159632927e7301de9a9dadd5e7c5894b7fe36f68d361d44b2ddad0b1e526714a99204a34b045ef4d7395a8f1c56f3d2 WHIRLPOOL 226d62663e13a09d7cedd095fec7331449a491618323603912f9f12d130857398967f3f8ac087957523deea374a5905f7f4308f6d85d860b202c93c50a5e232f
50 DIST perl-5.24.1-patches-3.tar.xz 24012 SHA256 b8f8164c1fb34c5db82d9f16c5330cdb2d56e283562dd2d684c2abc26e58bf83 SHA512 1af59b80fca8317fe8df171eba6fcc0830c65f94ad7f73bac611877afdd6e5dfe9ce7c67205a860703fcf6c5b87ba14a0163196e1b833a20562525d06b26b6f3 WHIRLPOOL 9d1f7d3050f544d04e413e1c6c4a8cc6bc593a8250dbf45fb166cf92060ea8bb8e4b09bb73a686cce8101395a04c853842588c1c223c903c5b74cedaf68c5d18
51 DIST perl-5.24.1.tar.xz 11569284 SHA256 03a77bac4505c270f1890ece75afc7d4b555090b41aa41ea478747e23b2afb3f SHA512 9429608eb4d7f6a01b5a7df8601e0757acdf3e6d5af960d5cf710f8e4fd20ffe082bb42eedc2cd079d5173e48cf5574d55477e1c51f7f53b32fb5d1b89f6db8c WHIRLPOOL 26d401f03af54ba61ea8e761f483f3d374737660fa4beaa3bd77951c0f920f88f9e47f327754c32d4c3c49557882a2a531b9eebef420ad6155d62423f7753406
52 +DIST perl-5.25.11-patches-1.tar.xz 16776 SHA256 43dda2f9a20b44442d25caa733ba94acb0c48b26e8201b3f8fa3d2be24a6667e SHA512 ee340824746d3b626b41c76bfa901543869fb9560ef75ff6d338df017e5528e33c344a91ce7cbe9f2fa9e813bf61bbe9eb290433baceb05b832110e746ce9036 WHIRLPOOL 98681898039e1bcc3e9a33498a8b7b8b3f24cc4c49396b33dfd04a853c329323ad47081d64da61ba2880fbd3505e10ffe90367dffa8005bda86c4f114b283934
53 +DIST perl-5.25.11.tar.xz 11960840 SHA256 f77e8e230b0405990f96d31a00fb9849a19de526cb3cb6c20603dc17d87f420c SHA512 1ca2ba2b6495ec1871f1d2a506344d8fe5fe725789a1afb6447392dbf81a8abc9c9646590d22552b33a08ee8ec5ede1646192483d8ad41f27bd45df3940602a3 WHIRLPOOL f952f38a4ea9ba2a3b4232e134e8287a29e9b89d878f176d8828967419a798e7ffecf558b043b99201244b8d1be3e93c0f3743992bcad9ee71f5409b1e65db03
54 DIST perl-cross-1.1.1.tar.gz 88283 SHA256 8ee72f39119b342f3b911266e5c965914a44a484fd18d9c444d106aca4dd7abc SHA512 8ad958d08d8e7ff2b80333959544aaf0e83a74f2e34c9e8aca543052d039c0f4b00cda694ee940874b192b0d83656a9f6854ebbf2c444b212ba9d4417c576591 WHIRLPOOL e6739ca8fc4dcafa14a20585d75931cf6b6a98fad9c732312d15507b29b926452668afc4f27f2b6c5bb6faa623fc506538a53ed9d303d21897f42d47c26e4924
55 DIST perl-cross-1.1.3.tar.gz 93856 SHA256 181b24ff71815fb2c8065e6ea139d106796eee0964aebfd8081f0b7f69e0696d SHA512 d1ea6ab8a431f831ec9c4c6b71a238a66f021f5610505ebb48c3b0d0b8c9afb0fcb8050779abe1a126afdd92e65f8c86e134832b45a0a6c26ca4b46735e3021d WHIRLPOOL f7313b859031d13516193a88a70fff845987eea93eab3d0d3bac6f3b47c781324acddeed72d6cef8c7d8ee06c8ca5f59a10560b20a53575ffdfd2ce36272a723
56 DIST perl-cross-1.1.4.tar.gz 94623 SHA256 c840a327d5464ca271cac40d52e2d199330875527bf1003c28a6e550fb7bcc57 SHA512 3bfc108245f0c05b7d45c317eb28c2eb70aba528dfe8a39bc99d6e49b4751f5dca4f4ac661484bfc7528c3e28fcdbd8994c36daa49c25516618fec1f58116d79 WHIRLPOOL c4a150cf15d067cd58db63dae01bbe810808888477f9a2bfcd8557b2eeee097bbf93509bb9128feef84e8a2913724a82de0accc3b9c5d65207ee9dcd2989fe51
57
58 diff --git a/dev-lang/perl/perl-5.26.9999.ebuild b/dev-lang/perl/perl-5.26.9999.ebuild
59 new file mode 100644
60 index 00000000000..62d914d8c9a
61 --- /dev/null
62 +++ b/dev-lang/perl/perl-5.26.9999.ebuild
63 @@ -0,0 +1,591 @@
64 +# Copyright 1999-2017 Gentoo Foundation
65 +# Distributed under the terms of the GNU General Public License v2
66 +
67 +EAPI=6
68 +
69 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
70 +
71 +PATCH_VER=1
72 +CROSS_VER=1.1.4
73 +
74 +DIST_AUTHOR=XSAWYERX
75 +
76 +# NB: BIN_ are perls that are XS-Compatible
77 +if [[ "${PV##*.}" == "9999" ]]; then
78 + # Include more versions for blead releases
79 + # for circular reasons
80 + # Greatest first, don't include yourself
81 + PERL_BIN_OLDVERSEN=""
82 + PERL_OLDVERSEN="5.24.2 5.24.1 5.24.0 5.22.3 5.22.2 5.22.1 5.22.0"
83 + DIST_VERSION=5.25.11
84 + SHORT_PV="${DIST_VERSION%.*}"
85 + MY_P="perl-${DIST_VERSION/_rc/-RC}"
86 + MY_PV="${DIST_VERSION%_rc*}"
87 +else
88 + PERL_BIN_OLDVERSEN=""
89 + # Compat reasons
90 + PERL_OLDVERSEN=""
91 + # First 2 digits only
92 + SHORT_PV="${PV%.*}"
93 + MY_P="perl-${PV/_rc/-RC}"
94 + MY_PV="${PV%_rc*}"
95 +fi
96 +
97 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
98 +
99 +SRC_URI="
100 + mirror://cpan/src/5.0/${MY_P}.tar.xz
101 + mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz
102 + https://github.com/gentoo-perl/perl-patchset/releases/download/${MY_P}-patches-${PATCH_VER}/${MY_P}-patches-${PATCH_VER}.tar.xz
103 + mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.xz
104 + https://dev.gentoo.org/~kentnl/distfiles/${MY_P}-patches-${PATCH_VER}.tar.xz
105 + https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz
106 +"
107 +HOMEPAGE="http://www.perl.org/"
108 +
109 +LICENSE="|| ( Artistic GPL-1+ )"
110 +SLOT="0/${SHORT_PV}"
111 +
112 +if [[ "${PV##*.}" != "9999" ]]; then
113 +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"
114 +fi
115 +
116 +IUSE="berkdb debug doc gdbm ithreads"
117 +
118 +RDEPEND="
119 + berkdb? ( sys-libs/db:= )
120 + gdbm? ( >=sys-libs/gdbm-1.8.3 )
121 + app-arch/bzip2
122 + sys-libs/zlib
123 +"
124 +DEPEND="${RDEPEND}
125 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
126 +"
127 +PDEPEND="
128 + >=app-admin/perl-cleaner-2.5
129 + >=virtual/perl-File-Temp-0.230.400-r2
130 + >=virtual/perl-Data-Dumper-2.154.0
131 + virtual/perl-Test-Harness
132 +"
133 +# bug 390719, bug 523624
134 +# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker
135 +
136 +S="${WORKDIR}/${MY_P}"
137 +
138 +dual_scripts() {
139 + src_remove_dual perl-core/Archive-Tar 2.240.0 ptar ptardiff ptargrep
140 + src_remove_dual perl-core/CPAN 2.170.0 cpan
141 + src_remove_dual perl-core/Digest-SHA 5.960.0 shasum
142 + src_remove_dual perl-core/Encode 2.880.0 enc2xs piconv
143 + src_remove_dual perl-core/ExtUtils-MakeMaker 7.240.0 instmodsh
144 + src_remove_dual perl-core/ExtUtils-ParseXS 3.340.0 xsubpp
145 + src_remove_dual perl-core/IO-Compress 2.74.0 zipdetails
146 + src_remove_dual perl-core/JSON-PP 2.274.0.200_rc json_pp
147 + src_remove_dual perl-core/Module-CoreList 5.201.701.230_rc corelist
148 + src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect
149 + src_remove_dual perl-core/Pod-Perldoc 3.280.0 perldoc
150 + src_remove_dual perl-core/Test-Harness 3.380.0 prove
151 + src_remove_dual perl-core/podlators 4.90.0 pod2man pod2text
152 + src_remove_dual_man perl-core/podlators 4.90.0 /usr/share/man/man1/perlpodstyle.1
153 +}
154 +
155 +check_rebuild() {
156 + # Fresh install
157 + if [[ -z "${REPLACING_VERSIONS}" ]]; then
158 + return 0;
159 + # Major Upgrade
160 + # doesn't matter if there's multiple copies, it still needs a rebuild
161 + # if the string is anything other than "5.CURRENTMAJOR"
162 + elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then
163 + echo ""
164 + ewarn "UPDATE THE PERL MODULES:"
165 + ewarn "After updating dev-lang/perl the installed Perl modules"
166 + ewarn "have to be re-installed. In most cases, this is done automatically"
167 + ewarn "by the package manager, but subsequent steps are still recommended"
168 + ewarn "to ensure system consistency."
169 + ewarn
170 + ewarn "You should start with a depclean to remove any unused perl dependencies"
171 + ewarn "that may confuse portage in future. Regular depcleans are also encouraged"
172 + ewarn "as part of your regular update cycle, as that will keep perl upgrades working."
173 + ewarn "Recommended: emerge --depclean -va"
174 + ewarn
175 + ewarn "You should then call perl-cleaner to clean up any old files and trigger any"
176 + ewarn "remaining rebuilds portage may have missed."
177 + ewarn "Use: perl-cleaner --all"
178 + return 0;
179 +
180 + # Reinstall w/ USE Change
181 + elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
182 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
183 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
184 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
185 + echo ""
186 + ewarn "TOGGLED USE-FLAGS WARNING:"
187 + ewarn "You changed one of the use-flags ithreads or debug."
188 + ewarn "You must rebuild all perl-modules installed."
189 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
190 + fi
191 +}
192 +
193 +pkg_setup() {
194 + case ${CHOST} in
195 + *-freebsd*) osname="freebsd" ;;
196 + *-dragonfly*) osname="dragonfly" ;;
197 + *-netbsd*) osname="netbsd" ;;
198 + *-openbsd*) osname="openbsd" ;;
199 + *-darwin*) osname="darwin" ;;
200 + *-interix*) osname="interix" ;;
201 + *-aix*) osname="aix" ;;
202 + *-cygwin*) osname="cygwin" ;;
203 + *) osname="linux" ;;
204 + esac
205 +
206 + myarch="${CHOST%%-*}-${osname}"
207 + if use debug ; then
208 + myarch+="-debug"
209 + fi
210 + if use ithreads ; then
211 + mythreading="-multi"
212 + myarch+="-thread"
213 + fi
214 +
215 + LIBPERL="libperl$(get_libname ${MY_PV} )"
216 + PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}"
217 + ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
218 + SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}"
219 + SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
220 + VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}"
221 + VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}"
222 +
223 + dual_scripts
224 +}
225 +
226 +src_remove_dual_file() {
227 + local i pkg ver
228 + pkg="$1"
229 + ver="$2"
230 + shift 2
231 + case "${EBUILD_PHASE:-none}" in
232 + postinst|postrm)
233 + for i in "$@" ; do
234 + alternatives_auto_makesym "${i}" "${i}-[0-9]*"
235 + done
236 + ;;
237 + setup)
238 + for i in "$@" ; do
239 + if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then
240 + has_version ${pkg} && ewarn "You must reinstall ${pkg} !"
241 + break
242 + fi
243 + done
244 + ;;
245 + install)
246 + for i in "$@" ; do
247 + if ! [[ -f "${ED}"${i} ]] ; then
248 + ewarn "${i} does not exist!"
249 + continue
250 + fi
251 + mv "${ED}"${i}{,-${ver}-${P}} || die
252 + done
253 + ;;
254 + esac
255 +}
256 +
257 +src_remove_dual_man() {
258 + local i pkg ver ff
259 + pkg="$1"
260 + ver="$2"
261 + shift 2
262 + case "${EBUILD_PHASE:-none}" in
263 + postinst|postrm)
264 + for i in "$@" ; do
265 + ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*`
266 + ff=${ff##*${i#${i%.[0-9]}}}
267 + alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*"
268 + done
269 + ;;
270 + install)
271 + for i in "$@" ; do
272 + if ! [[ -f "${ED}"${i} ]] ; then
273 + ewarn "${i} does not exist!"
274 + continue
275 + fi
276 + mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die
277 + done
278 + ;;
279 + esac
280 +}
281 +
282 +src_remove_dual() {
283 + local i pkg ver
284 + pkg="$1"
285 + ver="$2"
286 + shift 2
287 + for i in "$@" ; do
288 + src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}"
289 + src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1"
290 + done
291 +}
292 +
293 +src_prepare_update_patchlevel_h() {
294 + # Copied and modified from debian:
295 + # Copyright 2011 Niko Tyni
296 + # This program is free software; you can redistribute it and/or modify
297 + # it under the same terms as Perl itself.
298 + local patchdir="${WORKDIR}/patches"
299 + local prefix
300 + local patchoutput="patchlevel-gentoo.h"
301 +
302 + [[ -f ${patchdir}/series ]] || return 0
303 +
304 +while read patch
305 +do
306 + patchname=$(echo $patch | sed 's/\.diff$//')
307 + < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e '
308 +
309 + # massage the patch headers
310 + s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend;
311 + s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend;
312 + s|^Bug-Gentoo: ||; tprepend;
313 + s/^\(Subject\|Description\): //; tappend;
314 + s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend;
315 +
316 + # post-process at the end of input
317 + $ { x;
318 + # include the version number in the patchlevel.h description (if available)
319 + s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/;
320 +
321 + # escape any backslashes and double quotes
322 + s|\\|\\\\|g; s|"|\\"|g;
323 +
324 + # add a prefix
325 + s|^|\t,"'"$prefix$patchname"' - |;
326 + # newlines away
327 + s/\n/ /g; s/ */ /g;
328 + # add a suffix
329 + s/ *$/"/; p
330 + };
331 + # stop all processing
332 + d;
333 + # label: append to the hold space
334 + :append H; d;
335 + # label: prepend to the hold space
336 + :prepend x; H; d;
337 + '
338 +done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}"
339 +echo "${patchoutput}" >> "${S}/MANIFEST"
340 +}
341 +
342 +src_prepare_perlcross() {
343 + cp -a ../perl-cross-${CROSS_VER}/* . || die
344 +
345 + sed -i \
346 + -e 's/(15 + $CLEANUP)/(13 + $CLEANUP)/' \
347 + cnf/diffs/perl5-${PV}/makemaker-test.patch || die
348 +
349 + sed -i \
350 + -e 's/MakeMaker\.pm .*/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1/' \
351 + -e 's/MM_Unix\.pm .*/MM_Unix.pm b0ec308fe2d7dcfcef5732880db0fae1f4ea80fa/' \
352 + cnf/diffs/perl5-${PV}/customized.patch || die
353 +
354 + sed -i \
355 + -e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \
356 + Makefile || die
357 +
358 + # bug 604072
359 + MAKEOPTS+=" -j1"
360 + export MAKEOPTS
361 +}
362 +src_prepare_dynamic() {
363 + ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die
364 + ln -s ${LIBPERL} libperl$(get_libname ) || die
365 +}
366 +
367 +src_prepare() {
368 + local patch
369 + EPATCH_OPTS+=" -p1"
370 + einfo "Applying patches from ${MY_P}-${PATCH_VER} ..."
371 + while read patch ; do
372 + EPATCH_SINGLE_MSG=" ${patch} ..."
373 + epatch "${WORKDIR}"/patches/${patch}
374 + done < "${WORKDIR}"/patches/series
375 +
376 + src_prepare_update_patchlevel_h
377 +
378 + tc-is-cross-compiler && src_prepare_perlcross
379 +
380 + tc-is-static-only || src_prepare_dynamic
381 +
382 + if use gdbm; then
383 + sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \
384 + ext/NDBM_File/Makefile.PL || die
385 + fi
386 +
387 + default
388 +}
389 +
390 +myconf() {
391 + # the myconf array is declared in src_configure
392 + myconf=( "${myconf[@]}" "$@" )
393 +}
394 +
395 +src_configure() {
396 + declare -a myconf
397 +
398 + export LC_ALL="C"
399 + [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091
400 +
401 + # some arches and -O do not mix :)
402 + use ppc && replace-flags -O? -O1
403 +
404 + # Perl has problems compiling with -Os in your flags with glibc
405 + use elibc_uclibc || replace-flags "-Os" "-O2"
406 +
407 + # This flag makes compiling crash in interesting ways
408 + filter-flags "-malign-double"
409 +
410 + # Fixes bug #97645
411 + use ppc && filter-flags "-mpowerpc-gpopt"
412 +
413 + # Fixes bug #143895 on gcc-4.1.1
414 + filter-flags "-fsched2-use-superblocks"
415 +
416 + use sparc && myconf -Ud_longdbl
417 +
418 + export BUILD_BZIP2=0
419 + export BZIP2_INCLUDE=${EROOT}/usr/include
420 + export BZIP2_LIB=${EROOT}/usr/$(get_libdir)
421 +
422 + export BUILD_ZLIB=False
423 + export ZLIB_INCLUDE=${EROOT}/usr/include
424 + export ZLIB_LIB=${EROOT}/usr/$(get_libdir)
425 +
426 + # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
427 + myndbm='U'
428 + mygdbm='U'
429 + mydb='U'
430 + if use gdbm ; then
431 + mygdbm='D'
432 + if use berkdb ; then
433 + myndbm='D'
434 + fi
435 + fi
436 + if use berkdb ; then
437 + mydb='D'
438 + has_version '=sys-libs/db-1*' && myndbm='D'
439 + fi
440 +
441 + myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db"
442 +
443 + if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then
444 + ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
445 + myconf -Ui_db -Ui_ndbm
446 + fi
447 +
448 + use ithreads && myconf -Dusethreads
449 +
450 + if use debug ; then
451 + append-cflags "-g"
452 + myconf -DDEBUGGING
453 + elif [[ ${CFLAGS} == *-g* ]] ; then
454 + myconf -DDEBUGGING=-g
455 + else
456 + myconf -DDEBUGGING=none
457 + fi
458 +
459 + if [[ -n ${PERL_OLDVERSEN} ]] ; then
460 + local inclist=$(
461 + for v in ${PERL_OLDVERSEN}; do
462 + has "${v}" "${PERL_BIN_OLDVERSEN}" && echo -n "${v}/${myarch}${mythreading} ";
463 + echo -n "${v} ";
464 + done )
465 + myconf -Dinc_version_list="${inclist}"
466 + fi
467 +
468 + [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a"
469 +
470 + # Make sure we can do the final link #523730, need to set deployment
471 + # target to override hardcoded 10.3 which breaks on modern OSX
472 + [[ ${CHOST} == *-darwin* ]] && \
473 + myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)"
474 +
475 + # Prefix: the host system needs not to follow Gentoo multilib stuff, and in
476 + # Prefix itself we don't do multilib either, so make sure perl can find
477 + # something compatible.
478 + if use prefix ; then
479 + # Set a hook to check for each detected library whether it actually works.
480 + export libscheck="
481 + ( echo 'main(){}' > '${T}'/conftest.c &&
482 + $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null
483 + ) || xxx=/dev/null"
484 +
485 + # Use all host paths that might contain useful stuff, the hook above will filter out bad choices.
486 + local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib"
487 + myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}"
488 + elif [[ $(get_libdir) != "lib" ]] ; then
489 + # We need to use " and not ', as the written config.sh use ' ...
490 + myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)"
491 + fi
492 +
493 + # don't try building ODBM, bug #354453
494 + disabled_extensions="ODBM_File"
495 +
496 + if ! use gdbm ; then
497 + # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm"
498 + disabled_extensions="${disabled_extensions} GDBM_File NDBM_File"
499 + fi
500 +
501 + myconf -Dnoextensions="${disabled_extensions}"
502 +
503 + [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly
504 +
505 + [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF}
506 + # allow fiddling via EXTRA_ECONF, bug 558070
507 + eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})"
508 +
509 + myconf \
510 + -Duseshrplib \
511 + -Darchname="${myarch}" \
512 + -Dcc="$(tc-getCC)" \
513 + -Doptimize="${CFLAGS}" \
514 + -Dldflags="${LDFLAGS}" \
515 + -Dprefix="${EPREFIX}"'/usr' \
516 + -Dsiteprefix="${EPREFIX}"'/usr/local' \
517 + -Dvendorprefix="${EPREFIX}"'/usr' \
518 + -Dscriptdir="${EPREFIX}"'/usr/bin' \
519 + -Dprivlib="${EPREFIX}${PRIV_LIB}" \
520 + -Darchlib="${EPREFIX}${ARCH_LIB}" \
521 + -Dsitelib="${EPREFIX}${SITE_LIB}" \
522 + -Dsitearch="${EPREFIX}${SITE_ARCH}" \
523 + -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \
524 + -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \
525 + -Dman1dir="${EPREFIX}"/usr/share/man/man1 \
526 + -Dman3dir="${EPREFIX}"/usr/share/man/man3 \
527 + -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \
528 + -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \
529 + -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \
530 + -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \
531 + -Dman1ext='1' \
532 + -Dman3ext='3pm' \
533 + -Dlibperl="${LIBPERL}" \
534 + -Dlocincpth="${EPREFIX}"'/usr/include ' \
535 + -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \
536 + -Duselargefiles \
537 + -Dd_semctl_semun \
538 + -Dcf_by='Gentoo' \
539 + -Dmyhostname='localhost' \
540 + -Dperladmin='root@localhost' \
541 + -Ud_csh \
542 + -Dsh="${EPREFIX}"/bin/sh \
543 + -Dtargetsh="${EPREFIX}"/bin/sh \
544 + -Uusenm \
545 + "${myconf[@]}" \
546 + "${EXTRA_ECONF[@]}"
547 +
548 + if tc-is-cross-compiler; then
549 + ./configure \
550 + --target="${CHOST}" \
551 + --build="${CBUILD}" \
552 + -Dinstallprefix='' \
553 + -Dinstallusrbinperl='undef' \
554 + -Dusevendorprefix='define' \
555 + "${myconf[@]}" \
556 + || die "Unable to configure"
557 + else
558 + sh Configure \
559 + -des \
560 + -Dinstallprefix="${EPREFIX}"'/usr' \
561 + -Dinstallusrbinperl='n' \
562 + "${myconf[@]}" \
563 + || die "Unable to configure"
564 + fi
565 +}
566 +
567 +src_test() {
568 + export NO_GENTOO_NETWORK_TESTS=1;
569 + if [[ ${EUID} == 0 ]] ; then
570 + ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..."
571 + return 0
572 + fi
573 + use elibc_uclibc && export MAKEOPTS+=" -j1"
574 + TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed"
575 +}
576 +
577 +src_install() {
578 + local i
579 + local coredir="${ARCH_LIB}/CORE"
580 +
581 + emake DESTDIR="${D}" install
582 +
583 + rm -f "${ED}/usr/bin/perl${MY_PV}"
584 + ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die
585 +
586 + if ! tc-is-static-only ; then
587 + dolib.so "${ED}"${coredir}/${LIBPERL}
588 + rm -f "${ED}"${coredir}/${LIBPERL}
589 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die
590 + ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die
591 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die
592 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die
593 + ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die
594 + fi
595 +
596 + rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages"
597 +
598 + # This removes ${D} from Config.pm
599 + for i in $(find "${D}" -iname "Config.pm" ) ; do
600 + einfo "Removing ${D} from ${i}..."
601 + sed -i -e "s:${D}::" "${i}" || die "Sed failed"
602 + done
603 +
604 + dodoc Changes* README AUTHORS
605 +
606 + if use doc ; then
607 + # HTML Documentation
608 + # We expect errors, warnings, and such with the following.
609 +
610 + dodir /usr/share/doc/${PF}/html
611 + LD_LIBRARY_PATH=. ./perl installhtml \
612 + --podroot='.' \
613 + --podpath='lib:ext:pod:vms' \
614 + --recurse \
615 + --htmldir="${ED}/usr/share/doc/${PF}/html"
616 + fi
617 +
618 + [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local
619 +
620 + dual_scripts
621 +}
622 +
623 +pkg_preinst() {
624 + check_rebuild
625 +}
626 +
627 +pkg_postinst() {
628 + dual_scripts
629 +
630 + if [[ "${ROOT}" = "/" ]] ; then
631 + local INC DIR file
632 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
633 + einfo "Removing old .ph files"
634 + for DIR in ${INC} ; do
635 + if [[ -d "${DIR}" ]] ; then
636 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
637 + rm -f "${file}"
638 + einfo "<< ${file}"
639 + done
640 + fi
641 + done
642 + # Silently remove the now empty dirs
643 + for DIR in ${INC} ; do
644 + if [[ -d "${DIR}" ]] ; then
645 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
646 + fi
647 + done
648 +
649 + fi
650 +}
651 +
652 +pkg_postrm(){
653 + dual_scripts
654 +}