1 |
commit: 32f2d135ae0be4622f332480c630b5d31134ef78 |
2 |
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 22 23:47:52 2018 +0000 |
4 |
Commit: Andreas Hüttel <dilfridge <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Feb 22 23:48:12 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=32f2d135 |
7 |
|
8 |
dev-lang/perl: No pointless linking to libnsl, no including xlocale.h |
9 |
|
10 |
Bug: https://bugs.gentoo.org/648460 |
11 |
Package-Manager: Portage-2.3.24, Repoman-2.3.6 |
12 |
|
13 |
dev-lang/perl/files/perl-5.24-libnsl.patch | 13 + |
14 |
dev-lang/perl/perl-5.24.3-r1.ebuild | 572 ++++++++++++++++++++++++++ |
15 |
dev-lang/perl/perl-5.26.1-r2.ebuild | 627 +++++++++++++++++++++++++++++ |
16 |
3 files changed, 1212 insertions(+) |
17 |
|
18 |
diff --git a/dev-lang/perl/files/perl-5.24-libnsl.patch b/dev-lang/perl/files/perl-5.24-libnsl.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..5cd6f88c998 |
21 |
--- /dev/null |
22 |
+++ b/dev-lang/perl/files/perl-5.24-libnsl.patch |
23 |
@@ -0,0 +1,13 @@ |
24 |
+diff --git a/Configure b/Configure |
25 |
+index e32d18ce1f..85ab0249bc 100755 |
26 |
+--- a/Configure |
27 |
++++ b/Configure |
28 |
+@@ -1497,7 +1497,7 @@ archname='' |
29 |
+ usereentrant='undef' |
30 |
+ : List of libraries we want. |
31 |
+ : If anyone needs extra -lxxx, put those in a hint file. |
32 |
+-libswanted="cl pthread socket bind inet nsl ndbm gdbm dbm db malloc dl ld" |
33 |
++libswanted="cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld" |
34 |
+ libswanted="$libswanted sun m crypt sec util c cposix posix ucb bsd BSD" |
35 |
+ : We probably want to search /usr/shlib before most other libraries. |
36 |
+ : This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. |
37 |
|
38 |
diff --git a/dev-lang/perl/perl-5.24.3-r1.ebuild b/dev-lang/perl/perl-5.24.3-r1.ebuild |
39 |
new file mode 100644 |
40 |
index 00000000000..0d11fd1d39d |
41 |
--- /dev/null |
42 |
+++ b/dev-lang/perl/perl-5.24.3-r1.ebuild |
43 |
@@ -0,0 +1,572 @@ |
44 |
+# Copyright 1999-2018 Gentoo Foundation |
45 |
+# Distributed under the terms of the GNU General Public License v2 |
46 |
+ |
47 |
+EAPI=6 |
48 |
+ |
49 |
+inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing |
50 |
+ |
51 |
+PATCH_VER=2 |
52 |
+CROSS_VER=1.1.7 |
53 |
+PATCH_BASE="perl-5.24.3-patches-${PATCH_VER}" |
54 |
+ |
55 |
+PERL_OLDVERSEN="5.24.2 5.24.1 5.24.0" |
56 |
+DIST_AUTHOR=SHAY |
57 |
+ |
58 |
+SHORT_PV="${PV%.*}" |
59 |
+MY_P="perl-${PV/_rc/-RC}" |
60 |
+MY_PV="${PV%_rc*}" |
61 |
+ |
62 |
+DESCRIPTION="Larry Wall's Practical Extraction and Report Language" |
63 |
+ |
64 |
+SRC_URI=" |
65 |
+ mirror://cpan/src/5.0/${MY_P}.tar.xz |
66 |
+ mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz |
67 |
+ https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz |
68 |
+ mirror://gentoo/${PATCH_BASE}.tar.xz |
69 |
+ https://dev.gentoo.org/~kentnl/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/${SHORT_PV}" |
76 |
+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" |
77 |
+IUSE="berkdb debug doc gdbm ithreads" |
78 |
+ |
79 |
+RDEPEND=" |
80 |
+ berkdb? ( sys-libs/db:= ) |
81 |
+ gdbm? ( >=sys-libs/gdbm-1.8.3 ) |
82 |
+ app-arch/bzip2 |
83 |
+ sys-libs/zlib |
84 |
+" |
85 |
+DEPEND="${RDEPEND} |
86 |
+ !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) ) |
87 |
+" |
88 |
+PDEPEND=" |
89 |
+ >=app-admin/perl-cleaner-2.5 |
90 |
+ >=virtual/perl-File-Path-2.130.0 |
91 |
+ >=virtual/perl-File-Temp-0.230.400-r2 |
92 |
+ >=virtual/perl-Data-Dumper-2.154.0 |
93 |
+ virtual/perl-Test-Harness |
94 |
+" |
95 |
+# bug 390719, bug 523624, bug 620304 |
96 |
+# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker |
97 |
+ |
98 |
+S="${WORKDIR}/${MY_P}" |
99 |
+ |
100 |
+PATCHES=( "${FILESDIR}/perl-5.24-libnsl.patch" ) |
101 |
+ |
102 |
+dual_scripts() { |
103 |
+ src_remove_dual perl-core/Archive-Tar 2.40.100_rc ptar ptardiff ptargrep |
104 |
+ src_remove_dual perl-core/CPAN 2.110.100_rc cpan |
105 |
+ src_remove_dual perl-core/Digest-SHA 5.950.100_rc shasum |
106 |
+ src_remove_dual perl-core/Encode 2.800.100_rc enc2xs piconv |
107 |
+ src_remove_dual perl-core/ExtUtils-MakeMaker 7.100.200_rc instmodsh |
108 |
+ src_remove_dual perl-core/ExtUtils-ParseXS 3.310.0 xsubpp |
109 |
+ src_remove_dual perl-core/IO-Compress 2.69.1_rc zipdetails |
110 |
+ src_remove_dual perl-core/JSON-PP 2.273.0.100_rc json_pp |
111 |
+ src_remove_dual perl-core/Module-CoreList 5.201.709.222.400_rc corelist |
112 |
+ src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect |
113 |
+ src_remove_dual perl-core/Pod-Perldoc 3.250.300_rc perldoc |
114 |
+ src_remove_dual perl-core/Test-Harness 3.360.100_rc prove |
115 |
+ src_remove_dual perl-core/podlators 4.70.0 pod2man pod2text |
116 |
+ src_remove_dual_man perl-core/podlators 4.70.0 /usr/share/man/man1/perlpodstyle.1 |
117 |
+} |
118 |
+ |
119 |
+check_rebuild() { |
120 |
+ # Fresh install |
121 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
122 |
+ return 0; |
123 |
+ # Major Upgrade |
124 |
+ # doesn't matter if there's multiple copies, it still needs a rebuild |
125 |
+ # if the string is anything other than "5.CURRENTMAJOR" |
126 |
+ elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then |
127 |
+ echo "" |
128 |
+ ewarn "UPDATE THE PERL MODULES:" |
129 |
+ ewarn "After updating dev-lang/perl the installed Perl modules" |
130 |
+ ewarn "have to be re-installed. In most cases, this is done automatically" |
131 |
+ ewarn "by the package manager, but subsequent steps are still recommended" |
132 |
+ ewarn "to ensure system consistency." |
133 |
+ ewarn |
134 |
+ ewarn "You should start with a depclean to remove any unused perl dependencies" |
135 |
+ ewarn "that may confuse portage in future. Regular depcleans are also encouraged" |
136 |
+ ewarn "as part of your regular update cycle, as that will keep perl upgrades working." |
137 |
+ ewarn "Recommended: emerge --depclean -va" |
138 |
+ ewarn |
139 |
+ ewarn "You should then call perl-cleaner to clean up any old files and trigger any" |
140 |
+ ewarn "remaining rebuilds portage may have missed." |
141 |
+ ewarn "Use: perl-cleaner --all" |
142 |
+ return 0; |
143 |
+ |
144 |
+ # Reinstall w/ USE Change |
145 |
+ elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \ |
146 |
+ ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \ |
147 |
+ ( use debug && ! has_version dev-lang/perl[debug] ) || \ |
148 |
+ ( ! use debug && has_version dev-lang/perl[debug] ) ; then |
149 |
+ echo "" |
150 |
+ ewarn "TOGGLED USE-FLAGS WARNING:" |
151 |
+ ewarn "You changed one of the use-flags ithreads or debug." |
152 |
+ ewarn "You must rebuild all perl-modules installed." |
153 |
+ ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl" |
154 |
+ fi |
155 |
+} |
156 |
+ |
157 |
+pkg_setup() { |
158 |
+ case ${CHOST} in |
159 |
+ *-freebsd*) osname="freebsd" ;; |
160 |
+ *-dragonfly*) osname="dragonfly" ;; |
161 |
+ *-netbsd*) osname="netbsd" ;; |
162 |
+ *-openbsd*) osname="openbsd" ;; |
163 |
+ *-darwin*) osname="darwin" ;; |
164 |
+ *-interix*) osname="interix" ;; |
165 |
+ *-aix*) osname="aix" ;; |
166 |
+ *-cygwin*) osname="cygwin" ;; |
167 |
+ *) osname="linux" ;; |
168 |
+ esac |
169 |
+ |
170 |
+ myarch="${CHOST%%-*}-${osname}" |
171 |
+ if use debug ; then |
172 |
+ myarch+="-debug" |
173 |
+ fi |
174 |
+ if use ithreads ; then |
175 |
+ mythreading="-multi" |
176 |
+ myarch+="-thread" |
177 |
+ fi |
178 |
+ |
179 |
+ LIBPERL="libperl$(get_libname ${MY_PV} )" |
180 |
+ PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}" |
181 |
+ ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}" |
182 |
+ SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}" |
183 |
+ SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}" |
184 |
+ VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}" |
185 |
+ VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}" |
186 |
+ |
187 |
+ dual_scripts |
188 |
+} |
189 |
+ |
190 |
+src_remove_dual_file() { |
191 |
+ local i pkg ver |
192 |
+ pkg="$1" |
193 |
+ ver="$2" |
194 |
+ shift 2 |
195 |
+ case "${EBUILD_PHASE:-none}" in |
196 |
+ postinst|postrm) |
197 |
+ for i in "$@" ; do |
198 |
+ alternatives_auto_makesym "${i}" "${i}-[0-9]*" |
199 |
+ done |
200 |
+ ;; |
201 |
+ setup) |
202 |
+ for i in "$@" ; do |
203 |
+ if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then |
204 |
+ has_version ${pkg} && ewarn "You must reinstall ${pkg} !" |
205 |
+ break |
206 |
+ fi |
207 |
+ done |
208 |
+ ;; |
209 |
+ install) |
210 |
+ for i in "$@" ; do |
211 |
+ if ! [[ -f "${ED}"${i} ]] ; then |
212 |
+ ewarn "${i} does not exist!" |
213 |
+ continue |
214 |
+ fi |
215 |
+ mv "${ED}"${i}{,-${ver}-${P}} || die |
216 |
+ done |
217 |
+ ;; |
218 |
+ esac |
219 |
+} |
220 |
+ |
221 |
+src_remove_dual_man() { |
222 |
+ local i pkg ver ff |
223 |
+ pkg="$1" |
224 |
+ ver="$2" |
225 |
+ shift 2 |
226 |
+ case "${EBUILD_PHASE:-none}" in |
227 |
+ postinst|postrm) |
228 |
+ for i in "$@" ; do |
229 |
+ ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*` |
230 |
+ ff=${ff##*${i#${i%.[0-9]}}} |
231 |
+ alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*" |
232 |
+ done |
233 |
+ ;; |
234 |
+ install) |
235 |
+ for i in "$@" ; do |
236 |
+ if ! [[ -f "${ED}"${i} ]] ; then |
237 |
+ ewarn "${i} does not exist!" |
238 |
+ continue |
239 |
+ fi |
240 |
+ mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die |
241 |
+ done |
242 |
+ ;; |
243 |
+ esac |
244 |
+} |
245 |
+ |
246 |
+src_remove_dual() { |
247 |
+ local i pkg ver |
248 |
+ pkg="$1" |
249 |
+ ver="$2" |
250 |
+ shift 2 |
251 |
+ for i in "$@" ; do |
252 |
+ src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}" |
253 |
+ src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1" |
254 |
+ done |
255 |
+} |
256 |
+ |
257 |
+src_prepare_update_patchlevel_h() { |
258 |
+ # Copied and modified from debian: |
259 |
+ # Copyright 2011 Niko Tyni |
260 |
+ # This program is free software; you can redistribute it and/or modify |
261 |
+ # it under the same terms as Perl itself. |
262 |
+ local patchdir="${WORKDIR}/patches" |
263 |
+ local prefix |
264 |
+ local patchoutput="patchlevel-gentoo.h" |
265 |
+ |
266 |
+ [[ -f ${patchdir}/series ]] || return 0 |
267 |
+ |
268 |
+while read patch |
269 |
+do |
270 |
+ patchname=$(echo $patch | sed 's/\.diff$//') |
271 |
+ < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e ' |
272 |
+ |
273 |
+ # massage the patch headers |
274 |
+ s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend; |
275 |
+ s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend; |
276 |
+ s|^Bug-Gentoo: ||; tprepend; |
277 |
+ s/^\(Subject\|Description\): //; tappend; |
278 |
+ s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend; |
279 |
+ |
280 |
+ # post-process at the end of input |
281 |
+ $ { x; |
282 |
+ # include the version number in the patchlevel.h description (if available) |
283 |
+ s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/; |
284 |
+ |
285 |
+ # escape any backslashes and double quotes |
286 |
+ s|\\|\\\\|g; s|"|\\"|g; |
287 |
+ |
288 |
+ # add a prefix |
289 |
+ s|^|\t,"'"$prefix$patchname"' - |; |
290 |
+ # newlines away |
291 |
+ s/\n/ /g; s/ */ /g; |
292 |
+ # add a suffix |
293 |
+ s/ *$/"/; p |
294 |
+ }; |
295 |
+ # stop all processing |
296 |
+ d; |
297 |
+ # label: append to the hold space |
298 |
+ :append H; d; |
299 |
+ # label: prepend to the hold space |
300 |
+ :prepend x; H; d; |
301 |
+ ' |
302 |
+done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}" |
303 |
+echo "${patchoutput}" >> "${S}/MANIFEST" |
304 |
+} |
305 |
+ |
306 |
+src_prepare() { |
307 |
+ local patch |
308 |
+ EPATCH_OPTS+=" -p1" |
309 |
+ einfo "Applying patches from ${MY_P}-${PATCH_VER} ..." |
310 |
+ while read patch ; do |
311 |
+ EPATCH_SINGLE_MSG=" ${patch} ..." |
312 |
+ epatch "${WORKDIR}"/patches/${patch} |
313 |
+ done < "${WORKDIR}"/patches/series |
314 |
+ |
315 |
+ src_prepare_update_patchlevel_h |
316 |
+ |
317 |
+ if tc-is-cross-compiler; then |
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 |
+ fi |
337 |
+ |
338 |
+ if ! tc-is-static-only ; then |
339 |
+ ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die |
340 |
+ ln -s ${LIBPERL} libperl$(get_libname ) || die |
341 |
+ fi |
342 |
+ |
343 |
+ if use gdbm; then |
344 |
+ sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \ |
345 |
+ ext/NDBM_File/Makefile.PL || die |
346 |
+ fi |
347 |
+ |
348 |
+ default |
349 |
+} |
350 |
+ |
351 |
+myconf() { |
352 |
+ # the myconf array is declared in src_configure |
353 |
+ myconf=( "${myconf[@]}" "$@" ) |
354 |
+} |
355 |
+ |
356 |
+src_configure() { |
357 |
+ declare -a myconf |
358 |
+ |
359 |
+ export LC_ALL="C" |
360 |
+ [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091 |
361 |
+ |
362 |
+ # some arches and -O do not mix :) |
363 |
+ use ppc && replace-flags -O? -O1 |
364 |
+ |
365 |
+ # Perl has problems compiling with -Os in your flags with glibc |
366 |
+ use elibc_uclibc || replace-flags "-Os" "-O2" |
367 |
+ |
368 |
+ # xlocale.h is going away in glibc-2.26, so it's counterproductive |
369 |
+ # if we use it and include it in CORE/perl.h ... Perl builds just |
370 |
+ # fine with glibc and locale.h only. |
371 |
+ # However, the darwin prefix people have no locale.h ... |
372 |
+ use elibc_glibc && myconf -Ui_xlocale |
373 |
+ |
374 |
+ # This flag makes compiling crash in interesting ways |
375 |
+ filter-flags "-malign-double" |
376 |
+ |
377 |
+ # Fixes bug #97645 |
378 |
+ use ppc && filter-flags "-mpowerpc-gpopt" |
379 |
+ |
380 |
+ # Fixes bug #143895 on gcc-4.1.1 |
381 |
+ filter-flags "-fsched2-use-superblocks" |
382 |
+ |
383 |
+ use sparc && myconf -Ud_longdbl |
384 |
+ |
385 |
+ export BUILD_BZIP2=0 |
386 |
+ export BZIP2_INCLUDE=${EROOT}/usr/include |
387 |
+ export BZIP2_LIB=${EROOT}/usr/$(get_libdir) |
388 |
+ |
389 |
+ export BUILD_ZLIB=False |
390 |
+ export ZLIB_INCLUDE=${EROOT}/usr/include |
391 |
+ export ZLIB_LIB=${EROOT}/usr/$(get_libdir) |
392 |
+ |
393 |
+ # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1 |
394 |
+ myndbm='U' |
395 |
+ mygdbm='U' |
396 |
+ mydb='U' |
397 |
+ if use gdbm ; then |
398 |
+ mygdbm='D' |
399 |
+ if use berkdb ; then |
400 |
+ myndbm='D' |
401 |
+ fi |
402 |
+ fi |
403 |
+ if use berkdb ; then |
404 |
+ mydb='D' |
405 |
+ has_version '=sys-libs/db-1*' && myndbm='D' |
406 |
+ fi |
407 |
+ |
408 |
+ myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db" |
409 |
+ |
410 |
+ if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then |
411 |
+ ewarn "Perl will not be built with berkdb support, use gcc if you needed it..." |
412 |
+ myconf -Ui_db -Ui_ndbm |
413 |
+ fi |
414 |
+ |
415 |
+ use ithreads && myconf -Dusethreads |
416 |
+ |
417 |
+ if use debug ; then |
418 |
+ append-cflags "-g" |
419 |
+ myconf -DDEBUGGING |
420 |
+ elif [[ ${CFLAGS} == *-g* ]] ; then |
421 |
+ myconf -DDEBUGGING=-g |
422 |
+ else |
423 |
+ myconf -DDEBUGGING=none |
424 |
+ fi |
425 |
+ |
426 |
+ if [[ -n ${PERL_OLDVERSEN} ]] ; then |
427 |
+ local inclist=$(for v in ${PERL_OLDVERSEN}; do echo -n "${v}/${myarch}${mythreading} ${v} "; done ) |
428 |
+ myconf -Dinc_version_list="${inclist}" |
429 |
+ fi |
430 |
+ |
431 |
+ [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a" |
432 |
+ |
433 |
+ # Make sure we can do the final link #523730, need to set deployment |
434 |
+ # target to override hardcoded 10.3 which breaks on modern OSX |
435 |
+ [[ ${CHOST} == *-darwin* ]] && \ |
436 |
+ myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)" |
437 |
+ |
438 |
+ # Prefix: the host system needs not to follow Gentoo multilib stuff, and in |
439 |
+ # Prefix itself we don't do multilib either, so make sure perl can find |
440 |
+ # something compatible. |
441 |
+ if use prefix ; then |
442 |
+ # Set a hook to check for each detected library whether it actually works. |
443 |
+ export libscheck=" |
444 |
+ ( echo 'main(){}' > '${T}'/conftest.c && |
445 |
+ $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null |
446 |
+ ) || xxx=/dev/null" |
447 |
+ |
448 |
+ # Use all host paths that might contain useful stuff, the hook above will filter out bad choices. |
449 |
+ local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib" |
450 |
+ myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}" |
451 |
+ elif [[ $(get_libdir) != "lib" ]] ; then |
452 |
+ # We need to use " and not ', as the written config.sh use ' ... |
453 |
+ myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)" |
454 |
+ fi |
455 |
+ |
456 |
+ # don't try building ODBM, bug #354453 |
457 |
+ disabled_extensions="ODBM_File" |
458 |
+ |
459 |
+ if ! use gdbm ; then |
460 |
+ # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm" |
461 |
+ disabled_extensions="${disabled_extensions} GDBM_File NDBM_File" |
462 |
+ fi |
463 |
+ |
464 |
+ myconf -Dnoextensions="${disabled_extensions}" |
465 |
+ |
466 |
+ [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF} |
467 |
+ # allow fiddling via EXTRA_ECONF, bug 558070 |
468 |
+ eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})" |
469 |
+ |
470 |
+ myconf \ |
471 |
+ -Duseshrplib \ |
472 |
+ -Darchname="${myarch}" \ |
473 |
+ -Dcc="$(tc-getCC)" \ |
474 |
+ -Doptimize="${CFLAGS}" \ |
475 |
+ -Dldflags="${LDFLAGS}" \ |
476 |
+ -Dprefix="${EPREFIX}"'/usr' \ |
477 |
+ -Dsiteprefix="${EPREFIX}"'/usr/local' \ |
478 |
+ -Dvendorprefix="${EPREFIX}"'/usr' \ |
479 |
+ -Dscriptdir="${EPREFIX}"'/usr/bin' \ |
480 |
+ -Dprivlib="${EPREFIX}${PRIV_LIB}" \ |
481 |
+ -Darchlib="${EPREFIX}${ARCH_LIB}" \ |
482 |
+ -Dsitelib="${EPREFIX}${SITE_LIB}" \ |
483 |
+ -Dsitearch="${EPREFIX}${SITE_ARCH}" \ |
484 |
+ -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \ |
485 |
+ -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \ |
486 |
+ -Dman1dir="${EPREFIX}"/usr/share/man/man1 \ |
487 |
+ -Dman3dir="${EPREFIX}"/usr/share/man/man3 \ |
488 |
+ -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \ |
489 |
+ -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \ |
490 |
+ -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \ |
491 |
+ -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \ |
492 |
+ -Dman1ext='1' \ |
493 |
+ -Dman3ext='3pm' \ |
494 |
+ -Dlibperl="${LIBPERL}" \ |
495 |
+ -Dlocincpth="${EPREFIX}"'/usr/include ' \ |
496 |
+ -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \ |
497 |
+ -Duselargefiles \ |
498 |
+ -Dd_semctl_semun \ |
499 |
+ -Dcf_by='Gentoo' \ |
500 |
+ -Dmyhostname='localhost' \ |
501 |
+ -Dperladmin='root@localhost' \ |
502 |
+ -Ud_csh \ |
503 |
+ -Dsh="${EPREFIX}"/bin/sh \ |
504 |
+ -Dtargetsh="${EPREFIX}"/bin/sh \ |
505 |
+ -Uusenm \ |
506 |
+ "${myconf[@]}" \ |
507 |
+ "${EXTRA_ECONF[@]}" |
508 |
+ |
509 |
+ if tc-is-cross-compiler; then |
510 |
+ ./configure \ |
511 |
+ --target="${CHOST}" \ |
512 |
+ --build="${CBUILD}" \ |
513 |
+ -Dinstallprefix='' \ |
514 |
+ -Dinstallusrbinperl='undef' \ |
515 |
+ -Dusevendorprefix='define' \ |
516 |
+ "${myconf[@]}" \ |
517 |
+ || die "Unable to configure" |
518 |
+ else |
519 |
+ sh Configure \ |
520 |
+ -des \ |
521 |
+ -Dinstallprefix="${EPREFIX}"'/usr' \ |
522 |
+ -Dinstallusrbinperl='n' \ |
523 |
+ "${myconf[@]}" \ |
524 |
+ || die "Unable to configure" |
525 |
+ fi |
526 |
+} |
527 |
+ |
528 |
+src_test() { |
529 |
+ export NO_GENTOO_NETWORK_TESTS=1; |
530 |
+ if [[ ${EUID} == 0 ]] ; then |
531 |
+ ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..." |
532 |
+ return 0 |
533 |
+ fi |
534 |
+ use elibc_uclibc && export MAKEOPTS+=" -j1" |
535 |
+ TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed" |
536 |
+} |
537 |
+ |
538 |
+src_install() { |
539 |
+ local i |
540 |
+ local coredir="${ARCH_LIB}/CORE" |
541 |
+ |
542 |
+ emake DESTDIR="${D}" install |
543 |
+ |
544 |
+ rm -f "${ED}/usr/bin/perl${MY_PV}" |
545 |
+ ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die |
546 |
+ |
547 |
+ if ! tc-is-static-only ; then |
548 |
+ dolib.so "${ED}"${coredir}/${LIBPERL} |
549 |
+ rm -f "${ED}"${coredir}/${LIBPERL} |
550 |
+ ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die |
551 |
+ ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die |
552 |
+ ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die |
553 |
+ ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die |
554 |
+ ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die |
555 |
+ fi |
556 |
+ |
557 |
+ rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages" |
558 |
+ |
559 |
+ # This removes ${D} from Config.pm |
560 |
+ for i in $(find "${D}" -iname "Config.pm" ) ; do |
561 |
+ einfo "Removing ${D} from ${i}..." |
562 |
+ sed -i -e "s:${D}::" "${i}" || die "Sed failed" |
563 |
+ done |
564 |
+ |
565 |
+ dodoc Changes* README AUTHORS |
566 |
+ |
567 |
+ if use doc ; then |
568 |
+ # HTML Documentation |
569 |
+ # We expect errors, warnings, and such with the following. |
570 |
+ |
571 |
+ dodir /usr/share/doc/${PF}/html |
572 |
+ LD_LIBRARY_PATH=. ./perl installhtml \ |
573 |
+ --podroot='.' \ |
574 |
+ --podpath='lib:ext:pod:vms' \ |
575 |
+ --recurse \ |
576 |
+ --htmldir="${ED}/usr/share/doc/${PF}/html" |
577 |
+ fi |
578 |
+ |
579 |
+ [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local |
580 |
+ |
581 |
+ dual_scripts |
582 |
+} |
583 |
+ |
584 |
+pkg_preinst() { |
585 |
+ check_rebuild |
586 |
+} |
587 |
+ |
588 |
+pkg_postinst() { |
589 |
+ dual_scripts |
590 |
+ |
591 |
+ if [[ "${ROOT}" = "/" ]] ; then |
592 |
+ local INC DIR file |
593 |
+ INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }') |
594 |
+ einfo "Removing old .ph files" |
595 |
+ for DIR in ${INC} ; do |
596 |
+ if [[ -d "${DIR}" ]] ; then |
597 |
+ for file in $(find "${DIR}" -name "*.ph" -type f ) ; do |
598 |
+ rm -f "${file}" |
599 |
+ einfo "<< ${file}" |
600 |
+ done |
601 |
+ fi |
602 |
+ done |
603 |
+ # Silently remove the now empty dirs |
604 |
+ for DIR in ${INC} ; do |
605 |
+ if [[ -d "${DIR}" ]] ; then |
606 |
+ find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null |
607 |
+ fi |
608 |
+ done |
609 |
+ |
610 |
+ fi |
611 |
+} |
612 |
+ |
613 |
+pkg_postrm(){ |
614 |
+ dual_scripts |
615 |
+} |
616 |
|
617 |
diff --git a/dev-lang/perl/perl-5.26.1-r2.ebuild b/dev-lang/perl/perl-5.26.1-r2.ebuild |
618 |
new file mode 100644 |
619 |
index 00000000000..2b6ee9d381d |
620 |
--- /dev/null |
621 |
+++ b/dev-lang/perl/perl-5.26.1-r2.ebuild |
622 |
@@ -0,0 +1,627 @@ |
623 |
+# Copyright 1999-2018 Gentoo Foundation |
624 |
+# Distributed under the terms of the GNU General Public License v2 |
625 |
+ |
626 |
+EAPI=6 |
627 |
+ |
628 |
+inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing |
629 |
+ |
630 |
+PATCH_VER=1 |
631 |
+CROSS_VER=1.1.7 |
632 |
+PATCH_BASE="perl-5.26.1-patches-${PATCH_VER}" |
633 |
+ |
634 |
+DIST_AUTHOR=SHAY |
635 |
+ |
636 |
+# Greatest first, don't include yourself |
637 |
+# Devel point-releases are not ABI-intercompatible, but stable point releases are |
638 |
+# BIN_OLDVERSEN is contains only C-ABI-intercompatible versions |
639 |
+PERL_BIN_OLDVERSEN="5.26.0" |
640 |
+if [[ "${PV##*.}" == "9999" ]]; then |
641 |
+ DIST_VERSION=5.26.1-RC1 |
642 |
+else |
643 |
+ DIST_VERSION="${PV/_rc/-RC}" |
644 |
+fi |
645 |
+SHORT_PV="${DIST_VERSION%.*}" |
646 |
+# Even numbered major versions are ABI intercompatible |
647 |
+# Odd numbered major versions are not |
648 |
+if [[ $(( ${SHORT_PV#*.} % 2 )) == 1 ]]; then |
649 |
+ SUBSLOT="${DIST_VERSION%-RC*}" |
650 |
+else |
651 |
+ SUBSLOT="${DIST_VERSION%.*}" |
652 |
+fi |
653 |
+# Used only in tar paths |
654 |
+MY_P="perl-${DIST_VERSION}" |
655 |
+# Used in library paths |
656 |
+MY_PV="${DIST_VERSION%-RC*}" |
657 |
+ |
658 |
+DESCRIPTION="Larry Wall's Practical Extraction and Report Language" |
659 |
+ |
660 |
+SRC_URI=" |
661 |
+ mirror://cpan/src/5.0/${MY_P}.tar.xz |
662 |
+ mirror://cpan/authors/id/${DIST_AUTHOR:0:1}/${DIST_AUTHOR:0:2}/${DIST_AUTHOR}/${MY_P}.tar.xz |
663 |
+ https://github.com/gentoo-perl/perl-patchset/releases/download/${PATCH_BASE}/${PATCH_BASE}.tar.xz |
664 |
+ mirror://gentoo/${PATCH_BASE}.tar.xz |
665 |
+ https://dev.gentoo.org/~kentnl/distfiles/${PATCH_BASE}.tar.xz |
666 |
+ https://github.com/arsv/perl-cross/releases/download/${CROSS_VER}/perl-cross-${CROSS_VER}.tar.gz |
667 |
+" |
668 |
+HOMEPAGE="https://www.perl.org/" |
669 |
+ |
670 |
+LICENSE="|| ( Artistic GPL-1+ )" |
671 |
+SLOT="0/${SUBSLOT}" |
672 |
+ |
673 |
+if [[ "${PV##*.}" != "9999" ]]; then |
674 |
+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" |
675 |
+fi |
676 |
+ |
677 |
+IUSE="berkdb debug doc gdbm ithreads" |
678 |
+ |
679 |
+RDEPEND=" |
680 |
+ berkdb? ( sys-libs/db:= ) |
681 |
+ gdbm? ( >=sys-libs/gdbm-1.8.3 ) |
682 |
+ app-arch/bzip2 |
683 |
+ sys-libs/zlib |
684 |
+" |
685 |
+DEPEND="${RDEPEND} |
686 |
+ !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) ) |
687 |
+" |
688 |
+PDEPEND=" |
689 |
+ >=app-admin/perl-cleaner-2.5 |
690 |
+ >=virtual/perl-File-Temp-0.230.400-r2 |
691 |
+ >=virtual/perl-Data-Dumper-2.154.0 |
692 |
+ virtual/perl-Test-Harness |
693 |
+" |
694 |
+# bug 390719, bug 523624 |
695 |
+# virtual/perl-Test-Harness is here for the bundled ExtUtils::MakeMaker |
696 |
+ |
697 |
+S="${WORKDIR}/${MY_P}" |
698 |
+ |
699 |
+PATCHES=( "${FILESDIR}/perl-5.24-libnsl.patch" ) |
700 |
+ |
701 |
+dual_scripts() { |
702 |
+ src_remove_dual perl-core/Archive-Tar 2.240.0 ptar ptardiff ptargrep |
703 |
+ src_remove_dual perl-core/CPAN 2.180.0 cpan |
704 |
+ src_remove_dual perl-core/Digest-SHA 5.960.0 shasum |
705 |
+ src_remove_dual perl-core/Encode 2.880.0 enc2xs piconv |
706 |
+ src_remove_dual perl-core/ExtUtils-MakeMaker 7.240.0 instmodsh |
707 |
+ src_remove_dual perl-core/ExtUtils-ParseXS 3.340.0 xsubpp |
708 |
+ src_remove_dual perl-core/IO-Compress 2.74.0 zipdetails |
709 |
+ src_remove_dual perl-core/JSON-PP 2.274.0.200_rc json_pp |
710 |
+ src_remove_dual perl-core/Module-CoreList 5.201.709.222.600_rc corelist |
711 |
+ src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect |
712 |
+ src_remove_dual perl-core/Pod-Perldoc 3.280.0 perldoc |
713 |
+ src_remove_dual perl-core/Test-Harness 3.380.0 prove |
714 |
+ src_remove_dual perl-core/podlators 4.90.0 pod2man pod2text |
715 |
+ src_remove_dual_man perl-core/podlators 4.90.0 /usr/share/man/man1/perlpodstyle.1 |
716 |
+} |
717 |
+ |
718 |
+check_rebuild() { |
719 |
+ # Fresh install |
720 |
+ if [[ -z "${REPLACING_VERSIONS}" ]]; then |
721 |
+ return 0; |
722 |
+ # Major Upgrade |
723 |
+ # doesn't matter if there's multiple copies, it still needs a rebuild |
724 |
+ # if the string is anything other than "5.CURRENTMAJOR" |
725 |
+ elif [[ "${REPLACING_VERSIONS%.*}" != "${PV%.*}" ]]; then |
726 |
+ echo "" |
727 |
+ ewarn "UPDATE THE PERL MODULES:" |
728 |
+ ewarn "After updating dev-lang/perl the installed Perl modules" |
729 |
+ ewarn "have to be re-installed. In most cases, this is done automatically" |
730 |
+ ewarn "by the package manager, but subsequent steps are still recommended" |
731 |
+ ewarn "to ensure system consistency." |
732 |
+ ewarn |
733 |
+ ewarn "You should start with a depclean to remove any unused perl dependencies" |
734 |
+ ewarn "that may confuse portage in future. Regular depcleans are also encouraged" |
735 |
+ ewarn "as part of your regular update cycle, as that will keep perl upgrades working." |
736 |
+ ewarn "Recommended: emerge --depclean -va" |
737 |
+ ewarn |
738 |
+ ewarn "You should then call perl-cleaner to clean up any old files and trigger any" |
739 |
+ ewarn "remaining rebuilds portage may have missed." |
740 |
+ ewarn "Use: perl-cleaner --all" |
741 |
+ return 0; |
742 |
+ |
743 |
+ # Reinstall w/ USE Change |
744 |
+ elif ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \ |
745 |
+ ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \ |
746 |
+ ( use debug && ! has_version dev-lang/perl[debug] ) || \ |
747 |
+ ( ! use debug && has_version dev-lang/perl[debug] ) ; then |
748 |
+ echo "" |
749 |
+ ewarn "TOGGLED USE-FLAGS WARNING:" |
750 |
+ ewarn "You changed one of the use-flags ithreads or debug." |
751 |
+ ewarn "You must rebuild all perl-modules installed." |
752 |
+ ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl" |
753 |
+ fi |
754 |
+} |
755 |
+ |
756 |
+pkg_setup() { |
757 |
+ case ${CHOST} in |
758 |
+ *-freebsd*) osname="freebsd" ;; |
759 |
+ *-dragonfly*) osname="dragonfly" ;; |
760 |
+ *-netbsd*) osname="netbsd" ;; |
761 |
+ *-openbsd*) osname="openbsd" ;; |
762 |
+ *-darwin*) osname="darwin" ;; |
763 |
+ *-interix*) osname="interix" ;; |
764 |
+ *-aix*) osname="aix" ;; |
765 |
+ *-cygwin*) osname="cygwin" ;; |
766 |
+ *) osname="linux" ;; |
767 |
+ esac |
768 |
+ |
769 |
+ myarch="${CHOST%%-*}-${osname}" |
770 |
+ if use debug ; then |
771 |
+ myarch+="-debug" |
772 |
+ fi |
773 |
+ if use ithreads ; then |
774 |
+ mythreading="-multi" |
775 |
+ myarch+="-thread" |
776 |
+ fi |
777 |
+ |
778 |
+ PRIV_BASE="/usr/$(get_libdir)/perl5" |
779 |
+ SITE_BASE="/usr/local/$(get_libdir)/perl5" |
780 |
+ VENDOR_BASE="/usr/$(get_libdir)/perl5/vendor_perl" |
781 |
+ |
782 |
+ LIBPERL="libperl$(get_libname ${MY_PV} )" |
783 |
+ PRIV_LIB="${PRIV_BASE}/${MY_PV}" |
784 |
+ ARCH_LIB="${PRIV_BASE}/${MY_PV}/${myarch}${mythreading}" |
785 |
+ SITE_LIB="${SITE_BASE}/${MY_PV}" |
786 |
+ SITE_ARCH="${SITE_BASE}/${MY_PV}/${myarch}${mythreading}" |
787 |
+ VENDOR_LIB="${VENDOR_BASE}/${MY_PV}" |
788 |
+ VENDOR_ARCH="${VENDOR_BASE}/${MY_PV}/${myarch}${mythreading}" |
789 |
+ |
790 |
+ dual_scripts |
791 |
+} |
792 |
+ |
793 |
+src_remove_dual_file() { |
794 |
+ local i pkg ver |
795 |
+ pkg="$1" |
796 |
+ ver="$2" |
797 |
+ shift 2 |
798 |
+ case "${EBUILD_PHASE:-none}" in |
799 |
+ postinst|postrm) |
800 |
+ for i in "$@" ; do |
801 |
+ alternatives_auto_makesym "${i}" "${i}-[0-9]*" |
802 |
+ done |
803 |
+ ;; |
804 |
+ setup) |
805 |
+ for i in "$@" ; do |
806 |
+ if [[ -f ${EROOT}${i} && ! -h ${EROOT}${i} ]] ; then |
807 |
+ has_version ${pkg} && ewarn "You must reinstall ${pkg} !" |
808 |
+ break |
809 |
+ fi |
810 |
+ done |
811 |
+ ;; |
812 |
+ install) |
813 |
+ for i in "$@" ; do |
814 |
+ if ! [[ -f "${ED}"${i} ]] ; then |
815 |
+ ewarn "${i} does not exist!" |
816 |
+ continue |
817 |
+ fi |
818 |
+ mv "${ED}"${i}{,-${ver}-${P}} || die |
819 |
+ done |
820 |
+ ;; |
821 |
+ esac |
822 |
+} |
823 |
+ |
824 |
+src_remove_dual_man() { |
825 |
+ local i pkg ver ff |
826 |
+ pkg="$1" |
827 |
+ ver="$2" |
828 |
+ shift 2 |
829 |
+ case "${EBUILD_PHASE:-none}" in |
830 |
+ postinst|postrm) |
831 |
+ for i in "$@" ; do |
832 |
+ ff=`echo "${EROOT}${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}}"*` |
833 |
+ ff=${ff##*${i#${i%.[0-9]}}} |
834 |
+ alternatives_auto_makesym "${i}${ff}" "${i%.[0-9]}-[0-9]*" |
835 |
+ done |
836 |
+ ;; |
837 |
+ install) |
838 |
+ for i in "$@" ; do |
839 |
+ if ! [[ -f "${ED}"${i} ]] ; then |
840 |
+ ewarn "${i} does not exist!" |
841 |
+ continue |
842 |
+ fi |
843 |
+ mv "${ED}"${i} "${ED}"${i%.[0-9]}-${ver}-${P}${i#${i%.[0-9]}} || die |
844 |
+ done |
845 |
+ ;; |
846 |
+ esac |
847 |
+} |
848 |
+ |
849 |
+src_remove_dual() { |
850 |
+ local i pkg ver |
851 |
+ pkg="$1" |
852 |
+ ver="$2" |
853 |
+ shift 2 |
854 |
+ for i in "$@" ; do |
855 |
+ src_remove_dual_file "${pkg}" "${ver}" "/usr/bin/${i}" |
856 |
+ src_remove_dual_man "${pkg}" "${ver}" "/usr/share/man/man1/${i}.1" |
857 |
+ done |
858 |
+} |
859 |
+ |
860 |
+src_prepare_update_patchlevel_h() { |
861 |
+ # Copied and modified from debian: |
862 |
+ # Copyright 2011 Niko Tyni |
863 |
+ # This program is free software; you can redistribute it and/or modify |
864 |
+ # it under the same terms as Perl itself. |
865 |
+ local patchdir="${WORKDIR}/patches" |
866 |
+ local prefix |
867 |
+ local patchoutput="patchlevel-gentoo.h" |
868 |
+ |
869 |
+ [[ -f ${patchdir}/series ]] || return 0 |
870 |
+ |
871 |
+while read patch |
872 |
+do |
873 |
+ patchname=$(echo $patch | sed 's/\.diff$//') |
874 |
+ < $patchdir/$patch sed -e '/^Subject:/ { N; s/\n / / }' | sed -n -e ' |
875 |
+ |
876 |
+ # massage the patch headers |
877 |
+ s|^Bug: .*https\?://rt\.perl\.org/.*id=\(.*\).*|[perl #\1]|; tprepend; |
878 |
+ s|^Bug: .*https\?://rt\.cpan\.org/.*id=\(.*\).*|[rt.cpan.org #\1]|; tprepend; |
879 |
+ s|^Bug-Gentoo: ||; tprepend; |
880 |
+ s/^\(Subject\|Description\): //; tappend; |
881 |
+ s|^Origin: .*http://perl5\.git\.perl\.org/perl\.git/commit\(diff\)\?/\(.......\).*|[\2]|; tprepend; |
882 |
+ |
883 |
+ # post-process at the end of input |
884 |
+ $ { x; |
885 |
+ # include the version number in the patchlevel.h description (if available) |
886 |
+ s/List packaged patches/&'" for ${PF}(#${PATCH_VER})"'/; |
887 |
+ |
888 |
+ # escape any backslashes and double quotes |
889 |
+ s|\\|\\\\|g; s|"|\\"|g; |
890 |
+ |
891 |
+ # add a prefix |
892 |
+ s|^|\t,"'"$prefix$patchname"' - |; |
893 |
+ # newlines away |
894 |
+ s/\n/ /g; s/ */ /g; |
895 |
+ # add a suffix |
896 |
+ s/ *$/"/; p |
897 |
+ }; |
898 |
+ # stop all processing |
899 |
+ d; |
900 |
+ # label: append to the hold space |
901 |
+ :append H; d; |
902 |
+ # label: prepend to the hold space |
903 |
+ :prepend x; H; d; |
904 |
+ ' |
905 |
+done < "${WORKDIR}"/patches/series > "${S}/${patchoutput}" |
906 |
+echo "${patchoutput}" >> "${S}/MANIFEST" |
907 |
+} |
908 |
+ |
909 |
+src_prepare_perlcross() { |
910 |
+ cp -a ../perl-cross-${CROSS_VER}/* . || die |
911 |
+ |
912 |
+ sed -i \ |
913 |
+ -e 's/MakeMaker\.pm .*/MakeMaker.pm bf9174c70a0e50ff2fee4552c7df89b37d292da1/' \ |
914 |
+ -e 's/MM_Unix\.pm .*/MM_Unix.pm b0ec308fe2d7dcfcef5732880db0fae1f4ea80fa/' \ |
915 |
+ cnf/diffs/perl5-${PV}/customized.patch || die |
916 |
+ |
917 |
+ sed -i \ |
918 |
+ -e 's|^lib/unicore/CombiningClass.pl pod/perluniprops.pod:|lib/unicore/CombiningClass.pl pod/perluniprops.pod: $(CONFIGPM)|' \ |
919 |
+ Makefile || die |
920 |
+ |
921 |
+ # bug 604072 |
922 |
+ MAKEOPTS+=" -j1" |
923 |
+ export MAKEOPTS |
924 |
+} |
925 |
+src_prepare_dynamic() { |
926 |
+ ln -s ${LIBPERL} libperl$(get_libname ${SHORT_PV}) || die |
927 |
+ ln -s ${LIBPERL} libperl$(get_libname ) || die |
928 |
+} |
929 |
+ |
930 |
+src_prepare() { |
931 |
+ local patch |
932 |
+ EPATCH_OPTS+=" -p1" |
933 |
+ einfo "Applying patches from ${PATCH_BASE} ..." |
934 |
+ while read patch ; do |
935 |
+ EPATCH_SINGLE_MSG=" ${patch} ..." |
936 |
+ epatch "${WORKDIR}"/patches/${patch} |
937 |
+ done < "${WORKDIR}"/patches/series |
938 |
+ |
939 |
+ src_prepare_update_patchlevel_h |
940 |
+ |
941 |
+ tc-is-cross-compiler && src_prepare_perlcross |
942 |
+ |
943 |
+ tc-is-static-only || src_prepare_dynamic |
944 |
+ |
945 |
+ if use gdbm; then |
946 |
+ sed -i "s:INC => .*:INC => \"-I${EROOT}usr/include/gdbm\":g" \ |
947 |
+ ext/NDBM_File/Makefile.PL || die |
948 |
+ fi |
949 |
+ |
950 |
+ default |
951 |
+} |
952 |
+ |
953 |
+myconf() { |
954 |
+ # the myconf array is declared in src_configure |
955 |
+ myconf=( "${myconf[@]}" "$@" ) |
956 |
+} |
957 |
+ |
958 |
+src_configure() { |
959 |
+ declare -a myconf |
960 |
+ |
961 |
+ export LC_ALL="C" |
962 |
+ [[ ${COLUMNS:-1} -ge 1 ]] || unset COLUMNS # bug #394091 |
963 |
+ |
964 |
+ # some arches and -O do not mix :) |
965 |
+ use ppc && replace-flags -O? -O1 |
966 |
+ |
967 |
+ # Perl has problems compiling with -Os in your flags with glibc |
968 |
+ use elibc_uclibc || replace-flags "-Os" "-O2" |
969 |
+ |
970 |
+ # xlocale.h is going away in glibc-2.26, so it's counterproductive |
971 |
+ # if we use it and include it in CORE/perl.h ... Perl builds just |
972 |
+ # fine with glibc and locale.h only. |
973 |
+ # However, the darwin prefix people have no locale.h ... |
974 |
+ use elibc_glibc && myconf -Ui_xlocale |
975 |
+ |
976 |
+ # This flag makes compiling crash in interesting ways |
977 |
+ filter-flags "-malign-double" |
978 |
+ |
979 |
+ # Fixes bug #97645 |
980 |
+ use ppc && filter-flags "-mpowerpc-gpopt" |
981 |
+ |
982 |
+ # Fixes bug #143895 on gcc-4.1.1 |
983 |
+ filter-flags "-fsched2-use-superblocks" |
984 |
+ |
985 |
+ use sparc && myconf -Ud_longdbl |
986 |
+ |
987 |
+ export BUILD_BZIP2=0 |
988 |
+ export BZIP2_INCLUDE=${EROOT}/usr/include |
989 |
+ export BZIP2_LIB=${EROOT}/usr/$(get_libdir) |
990 |
+ |
991 |
+ export BUILD_ZLIB=False |
992 |
+ export ZLIB_INCLUDE=${EROOT}/usr/include |
993 |
+ export ZLIB_LIB=${EROOT}/usr/$(get_libdir) |
994 |
+ |
995 |
+ # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1 |
996 |
+ myndbm='U' |
997 |
+ mygdbm='U' |
998 |
+ mydb='U' |
999 |
+ if use gdbm ; then |
1000 |
+ mygdbm='D' |
1001 |
+ if use berkdb ; then |
1002 |
+ myndbm='D' |
1003 |
+ fi |
1004 |
+ fi |
1005 |
+ if use berkdb ; then |
1006 |
+ mydb='D' |
1007 |
+ has_version '=sys-libs/db-1*' && myndbm='D' |
1008 |
+ fi |
1009 |
+ |
1010 |
+ myconf "-${myndbm}i_ndbm" "-${mygdbm}i_gdbm" "-${mydb}i_db" |
1011 |
+ |
1012 |
+ if use alpha && [[ "$(tc-getCC)" = "ccc" ]] ; then |
1013 |
+ ewarn "Perl will not be built with berkdb support, use gcc if you needed it..." |
1014 |
+ myconf -Ui_db -Ui_ndbm |
1015 |
+ fi |
1016 |
+ |
1017 |
+ use ithreads && myconf -Dusethreads |
1018 |
+ |
1019 |
+ if use debug ; then |
1020 |
+ append-cflags "-g" |
1021 |
+ myconf -DDEBUGGING |
1022 |
+ elif [[ ${CFLAGS} == *-g* ]] ; then |
1023 |
+ myconf -DDEBUGGING=-g |
1024 |
+ else |
1025 |
+ myconf -DDEBUGGING=none |
1026 |
+ fi |
1027 |
+ |
1028 |
+ # Autodiscover all old version directories, some of them will even be newer |
1029 |
+ # if you downgrade |
1030 |
+ if [[ -z ${PERL_OLDVERSEN} ]]; then |
1031 |
+ PERL_OLDVERSEN="$( |
1032 |
+ find "${EROOT%/}${PRIV_BASE}" "${EROOT%/}${SITE_BASE}" "${EROOT%/}${VENDOR_BASE}" \ |
1033 |
+ -maxdepth 1 -mindepth 1 -type d -regex '.*/5[.][0-9]+[.][0-9]+$' \ |
1034 |
+ -printf "%f " 2>/dev/null )" |
1035 |
+ fi |
1036 |
+ # Fixup versions, removing self match, fixing order and dupes |
1037 |
+ PERL_OLDVERSEN="$( |
1038 |
+ echo "${PERL_OLDVERSEN}" |\ |
1039 |
+ tr " " "\n" |\ |
1040 |
+ grep -vF "${DIST_VERSION%-RC}" |\ |
1041 |
+ sort -u -nr -t'.' -k1,1 -k2,2 -k3,3 |
1042 |
+ )" |
1043 |
+ |
1044 |
+ # Experts who want a "Pure" install can set PERL_OLDVERSEN to an empty string |
1045 |
+ if [[ -n "${PERL_OLDVERSEN// }" ]]; then |
1046 |
+ local inclist="$( |
1047 |
+ for v in ${PERL_OLDVERSEN}; do |
1048 |
+ has "${v}" ${PERL_BIN_OLDVERSEN} && echo -n "${v}/${myarch}${mythreading} "; |
1049 |
+ echo -n "${v} "; |
1050 |
+ done )" |
1051 |
+ einfo "This version of perl may partially support modules previously" |
1052 |
+ einfo "installed in any of the following paths:" |
1053 |
+ for incpath in ${inclist}; do |
1054 |
+ [[ -e "${EROOT%/}${VENDOR_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${VENDOR_BASE}/${incpath}" |
1055 |
+ [[ -e "${EROOT%/}${PRIV_BASE}/${incpath}" ]] && einfo " ${EROO%/T}${PRIV_BASE}/${incpath}" |
1056 |
+ [[ -e "${EROOT%/}${SITE_BASE}/${incpath}" ]] && einfo " ${EROOT%/}${SITE_BASE}/${incpath}" |
1057 |
+ done |
1058 |
+ einfo "This is a temporary measure and you should aim to cleanup these paths" |
1059 |
+ einfo "via world updates and perl-cleaner" |
1060 |
+ myconf -Dinc_version_list="${inclist}" |
1061 |
+ fi |
1062 |
+ |
1063 |
+ [[ ${ELIBC} == "FreeBSD" ]] && myconf "-Dlibc=/usr/$(get_libdir)/libc.a" |
1064 |
+ |
1065 |
+ # Make sure we can do the final link #523730, need to set deployment |
1066 |
+ # target to override hardcoded 10.3 which breaks on modern OSX |
1067 |
+ [[ ${CHOST} == *-darwin* ]] && \ |
1068 |
+ myconf "-Dld=env MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET} $(tc-getCC)" |
1069 |
+ |
1070 |
+ # Prefix: the host system needs not to follow Gentoo multilib stuff, and in |
1071 |
+ # Prefix itself we don't do multilib either, so make sure perl can find |
1072 |
+ # something compatible. |
1073 |
+ if use prefix ; then |
1074 |
+ # Set a hook to check for each detected library whether it actually works. |
1075 |
+ export libscheck=" |
1076 |
+ ( echo 'main(){}' > '${T}'/conftest.c && |
1077 |
+ $(tc-getCC) -o '${T}'/conftest '${T}'/conftest.c -l\$thislib >/dev/null 2>/dev/null |
1078 |
+ ) || xxx=/dev/null" |
1079 |
+ |
1080 |
+ # Use all host paths that might contain useful stuff, the hook above will filter out bad choices. |
1081 |
+ local paths="/lib/*-linux-gnu /usr/lib/*-linux-gnu /lib64 /lib/64 /usr/lib64 /usr/lib/64 /lib32 /usr/lib32 /lib /usr/lib" |
1082 |
+ myconf "-Dlibpth=${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir) ${paths}" |
1083 |
+ elif [[ $(get_libdir) != "lib" ]] ; then |
1084 |
+ # We need to use " and not ', as the written config.sh use ' ... |
1085 |
+ myconf "-Dlibpth=/usr/local/$(get_libdir) /$(get_libdir) /usr/$(get_libdir)" |
1086 |
+ fi |
1087 |
+ |
1088 |
+ # don't try building ODBM, bug #354453 |
1089 |
+ disabled_extensions="ODBM_File" |
1090 |
+ |
1091 |
+ if ! use gdbm ; then |
1092 |
+ # workaround for bug #157774: don't try building GDBM related stuff with USE="-gdbm" |
1093 |
+ disabled_extensions="${disabled_extensions} GDBM_File NDBM_File" |
1094 |
+ fi |
1095 |
+ |
1096 |
+ myconf -Dnoextensions="${disabled_extensions}" |
1097 |
+ |
1098 |
+ [[ "${PV##*.}" == "9999" ]] && myconf -Dusedevel -Uversiononly |
1099 |
+ |
1100 |
+ [[ -n "${EXTRA_ECONF}" ]] && ewarn During Perl build, EXTRA_ECONF=${EXTRA_ECONF} |
1101 |
+ # allow fiddling via EXTRA_ECONF, bug 558070 |
1102 |
+ eval "local -a EXTRA_ECONF=(${EXTRA_ECONF})" |
1103 |
+ |
1104 |
+ myconf \ |
1105 |
+ -Duseshrplib \ |
1106 |
+ -Darchname="${myarch}" \ |
1107 |
+ -Dcc="$(tc-getCC)" \ |
1108 |
+ -Doptimize="${CFLAGS}" \ |
1109 |
+ -Dldflags="${LDFLAGS}" \ |
1110 |
+ -Dprefix="${EPREFIX}"'/usr' \ |
1111 |
+ -Dsiteprefix="${EPREFIX}"'/usr/local' \ |
1112 |
+ -Dvendorprefix="${EPREFIX}"'/usr' \ |
1113 |
+ -Dscriptdir="${EPREFIX}"'/usr/bin' \ |
1114 |
+ -Dprivlib="${EPREFIX}${PRIV_LIB}" \ |
1115 |
+ -Darchlib="${EPREFIX}${ARCH_LIB}" \ |
1116 |
+ -Dsitelib="${EPREFIX}${SITE_LIB}" \ |
1117 |
+ -Dsitearch="${EPREFIX}${SITE_ARCH}" \ |
1118 |
+ -Dvendorlib="${EPREFIX}${VENDOR_LIB}" \ |
1119 |
+ -Dvendorarch="${EPREFIX}${VENDOR_ARCH}" \ |
1120 |
+ -Dman1dir="${EPREFIX}"/usr/share/man/man1 \ |
1121 |
+ -Dman3dir="${EPREFIX}"/usr/share/man/man3 \ |
1122 |
+ -Dsiteman1dir="${EPREFIX}"/usr/local/man/man1 \ |
1123 |
+ -Dsiteman3dir="${EPREFIX}"/usr/local/man/man3 \ |
1124 |
+ -Dvendorman1dir="${EPREFIX}"/usr/share/man/man1 \ |
1125 |
+ -Dvendorman3dir="${EPREFIX}"/usr/share/man/man3 \ |
1126 |
+ -Dman1ext='1' \ |
1127 |
+ -Dman3ext='3pm' \ |
1128 |
+ -Dlibperl="${LIBPERL}" \ |
1129 |
+ -Dlocincpth="${EPREFIX}"'/usr/include ' \ |
1130 |
+ -Dglibpth="${EPREFIX}/$(get_libdir) ${EPREFIX}/usr/$(get_libdir)"' ' \ |
1131 |
+ -Duselargefiles \ |
1132 |
+ -Dd_semctl_semun \ |
1133 |
+ -Dcf_by='Gentoo' \ |
1134 |
+ -Dmyhostname='localhost' \ |
1135 |
+ -Dperladmin='root@localhost' \ |
1136 |
+ -Ud_csh \ |
1137 |
+ -Dsh="${EPREFIX}"/bin/sh \ |
1138 |
+ -Dtargetsh="${EPREFIX}"/bin/sh \ |
1139 |
+ -Uusenm \ |
1140 |
+ "${myconf[@]}" \ |
1141 |
+ "${EXTRA_ECONF[@]}" |
1142 |
+ |
1143 |
+ if tc-is-cross-compiler; then |
1144 |
+ ./configure \ |
1145 |
+ --target="${CHOST}" \ |
1146 |
+ --build="${CBUILD}" \ |
1147 |
+ -Dinstallprefix='' \ |
1148 |
+ -Dinstallusrbinperl='undef' \ |
1149 |
+ -Dusevendorprefix='define' \ |
1150 |
+ "${myconf[@]}" \ |
1151 |
+ || die "Unable to configure" |
1152 |
+ else |
1153 |
+ sh Configure \ |
1154 |
+ -des \ |
1155 |
+ -Dinstallprefix="${EPREFIX}"'/usr' \ |
1156 |
+ -Dinstallusrbinperl='n' \ |
1157 |
+ "${myconf[@]}" \ |
1158 |
+ || die "Unable to configure" |
1159 |
+ fi |
1160 |
+} |
1161 |
+ |
1162 |
+src_test() { |
1163 |
+ export NO_GENTOO_NETWORK_TESTS=1; |
1164 |
+ if [[ ${EUID} == 0 ]] ; then |
1165 |
+ ewarn "Test fails with a sandbox error (#328793) if run as root. Skipping tests..." |
1166 |
+ return 0 |
1167 |
+ fi |
1168 |
+ use elibc_uclibc && export MAKEOPTS+=" -j1" |
1169 |
+ TEST_JOBS="$(makeopts_jobs)" make test_harness || die "test failed" |
1170 |
+} |
1171 |
+ |
1172 |
+src_install() { |
1173 |
+ local i |
1174 |
+ local coredir="${ARCH_LIB}/CORE" |
1175 |
+ |
1176 |
+ emake DESTDIR="${D}" install |
1177 |
+ |
1178 |
+ rm -f "${ED}/usr/bin/perl${MY_PV}" |
1179 |
+ ln -s perl "${ED}"/usr/bin/perl${MY_PV} || die |
1180 |
+ |
1181 |
+ if ! tc-is-static-only ; then |
1182 |
+ dolib.so "${ED}"${coredir}/${LIBPERL} |
1183 |
+ rm -f "${ED}"${coredir}/${LIBPERL} |
1184 |
+ ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname ${SHORT_PV}) || die |
1185 |
+ ln -sf ${LIBPERL} "${ED}"/usr/$(get_libdir)/libperl$(get_libname) || die |
1186 |
+ ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/${LIBPERL} || die |
1187 |
+ ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname ${SHORT_PV}) || die |
1188 |
+ ln -sf ../../../../../$(get_libdir)/${LIBPERL} "${ED}"${coredir}/libperl$(get_libname) || die |
1189 |
+ fi |
1190 |
+ |
1191 |
+ rm -rf "${ED}"/usr/share/man/man3 || die "Unable to remove module man pages" |
1192 |
+ |
1193 |
+ # This removes ${D} from Config.pm |
1194 |
+ for i in $(find "${D}" -iname "Config.pm" ) ; do |
1195 |
+ einfo "Removing ${D} from ${i}..." |
1196 |
+ sed -i -e "s:${D}::" "${i}" || die "Sed failed" |
1197 |
+ done |
1198 |
+ |
1199 |
+ dodoc Changes* README AUTHORS |
1200 |
+ |
1201 |
+ if use doc ; then |
1202 |
+ # HTML Documentation |
1203 |
+ # We expect errors, warnings, and such with the following. |
1204 |
+ |
1205 |
+ dodir /usr/share/doc/${PF}/html |
1206 |
+ LD_LIBRARY_PATH=. ./perl installhtml \ |
1207 |
+ --podroot='.' \ |
1208 |
+ --podpath='lib:ext:pod:vms' \ |
1209 |
+ --recurse \ |
1210 |
+ --htmldir="${ED}/usr/share/doc/${PF}/html" |
1211 |
+ fi |
1212 |
+ |
1213 |
+ [[ -d ${ED}/usr/local ]] && rm -r "${ED}"/usr/local |
1214 |
+ |
1215 |
+ dual_scripts |
1216 |
+} |
1217 |
+ |
1218 |
+pkg_preinst() { |
1219 |
+ check_rebuild |
1220 |
+} |
1221 |
+ |
1222 |
+pkg_postinst() { |
1223 |
+ dual_scripts |
1224 |
+ |
1225 |
+ if [[ "${ROOT}" = "/" ]] ; then |
1226 |
+ local INC DIR file |
1227 |
+ INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }') |
1228 |
+ einfo "Removing old .ph files" |
1229 |
+ for DIR in ${INC} ; do |
1230 |
+ if [[ -d "${DIR}" ]] ; then |
1231 |
+ for file in $(find "${DIR}" -name "*.ph" -type f ) ; do |
1232 |
+ rm -f "${file}" |
1233 |
+ einfo "<< ${file}" |
1234 |
+ done |
1235 |
+ fi |
1236 |
+ done |
1237 |
+ # Silently remove the now empty dirs |
1238 |
+ for DIR in ${INC} ; do |
1239 |
+ if [[ -d "${DIR}" ]] ; then |
1240 |
+ find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null |
1241 |
+ fi |
1242 |
+ done |
1243 |
+ |
1244 |
+ fi |
1245 |
+} |
1246 |
+ |
1247 |
+pkg_postrm(){ |
1248 |
+ dual_scripts |
1249 |
+} |