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