Gentoo Archives: gentoo-commits

From: Benda XU <heroxbd@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] dev/heroxbd:master commit in: dev-lang/perl/files/eblits/, dev-lang/perl/
Date: Mon, 21 Dec 2015 04:31:22
Message-Id: 1439349344.ef1a9de5bf0afa3e9829dad99ba521daf27881bc.heroxbd@gentoo
1 commit: ef1a9de5bf0afa3e9829dad99ba521daf27881bc
2 Author: Benda Xu <heroxbd <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 12 03:15:44 2015 +0000
4 Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 12 03:15:44 2015 +0000
6 URL: https://gitweb.gentoo.org/dev/heroxbd.git/commit/?id=ef1a9de5
7
8 perl: track perl-5.22 raw files.
9
10 .../perl/files/eblits/pkg_postinst-v50220001.eblit | 67 ++++++++++++
11 .../perl/files/eblits/pkg_postrm-v50220001.eblit | 12 +++
12 .../perl/files/eblits/pkg_setup-v50220001.eblit | 72 +++++++++++++
13 dev-lang/perl/perl-5.22.0.ebuild | 120 +++++++++++++++++++++
14 4 files changed, 271 insertions(+)
15
16 diff --git a/dev-lang/perl/files/eblits/pkg_postinst-v50220001.eblit b/dev-lang/perl/files/eblits/pkg_postinst-v50220001.eblit
17 new file mode 100644
18 index 0000000..a268f78
19 --- /dev/null
20 +++ b/dev-lang/perl/files/eblits/pkg_postinst-v50220001.eblit
21 @@ -0,0 +1,67 @@
22 +# Copyright 1999-2015 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Id$
25 +
26 +eblit-perl-pkg_postinst() {
27 + dual_scripts
28 +
29 + if [[ "${ROOT}" = "/" ]] ; then
30 + local INC DIR file
31 + INC=$(perl -e 'for $line (@INC) { next if $line eq "."; next if $line =~ m/'${SHORT_PV}'|etc|local|perl$/; print "$line\n" }')
32 + einfo "Removing old .ph files"
33 + for DIR in ${INC} ; do
34 + if [[ -d "${DIR}" ]] ; then
35 + for file in $(find "${DIR}" -name "*.ph" -type f ) ; do
36 + rm -f "${file}"
37 + einfo "<< ${file}"
38 + done
39 + fi
40 + done
41 + # Silently remove the now empty dirs
42 + for DIR in ${INC} ; do
43 + if [[ -d "${DIR}" ]] ; then
44 + find "${DIR}" -depth -type d -print0 | xargs -0 -r rmdir &> /dev/null
45 + fi
46 + done
47 +
48 +# ebegin "Generating ConfigLocal.pm (ignore any error)"
49 +# enc2xs -C
50 +
51 + einfo "Converting C header files to the corresponding Perl format (ignore any error)"
52 + # Prefix note: unprefixed as this is all kernel/libc stuff that we never provide
53 + pushd /usr/include >/dev/null
54 + h2ph -Q -a -d "${EPREFIX}"${ARCH_LIB} \
55 + asm/termios.h syscall.h syslimits.h syslog.h sys/ioctl.h \
56 + sys/socket.h sys/time.h wait.h sysexits.h
57 + popd >/dev/null
58 +
59 +# This has been moved into a function because rumor has it that a future release
60 +# of portage will allow us to check what version was just removed - which means
61 +# we will be able to invoke this only as needed :)
62 + # Tried doing this via -z, but $INC is too big...
63 + #if [[ "${INC}x" != "x" ]]; then
64 + # cleaner_msg
65 + #fi
66 + fi
67 +}
68 +
69 +cleaner_msg() {
70 + eerror "You have had multiple versions of perl. It is recommended"
71 + eerror "that you run perl-cleaner now. perl-cleaner will"
72 + eerror "assist with this transition. This script is capable"
73 + eerror "of cleaning out old .ph files, rebuilding modules for "
74 + eerror "your new version of perl, as well as re-emerging"
75 + eerror "applications that compiled against your old libperl$(get_libname)"
76 + eerror
77 + eerror "PLEASE DO NOT INTERRUPT THE RUNNING OF THIS SCRIPT."
78 + eerror "Part of the rebuilding of applications compiled against "
79 + eerror "your old libperl involves temporarily unmerging"
80 + eerror "them - interruptions could leave you with unmerged"
81 + eerror "packages before they can be remerged."
82 + eerror ""
83 + eerror "If you have run perl-cleaner and a package still gives"
84 + eerror "you trouble, and re-emerging it fails to correct"
85 + eerror "the problem, please check http://bugs.gentoo.org/"
86 + eerror "for more information or to report a bug."
87 + eerror ""
88 +}
89
90 diff --git a/dev-lang/perl/files/eblits/pkg_postrm-v50220001.eblit b/dev-lang/perl/files/eblits/pkg_postrm-v50220001.eblit
91 new file mode 100644
92 index 0000000..5bead2a
93 --- /dev/null
94 +++ b/dev-lang/perl/files/eblits/pkg_postrm-v50220001.eblit
95 @@ -0,0 +1,12 @@
96 +# Copyright 1999-2015 Gentoo Foundation
97 +# Distributed under the terms of the GNU General Public License v2
98 +# $Id$
99 +
100 +eblit-perl-pkg_postrm(){
101 + dual_scripts
102 +
103 +# if [[ -e ${ARCH_LIB}/Encode/ConfigLocal.pm ]] ; then
104 +# ebegin "Removing ConfigLocal.pm"
105 +# rm "${ARCH_LIB}/Encode/ConfigLocal.pm"
106 +# fi
107 +}
108
109 diff --git a/dev-lang/perl/files/eblits/pkg_setup-v50220001.eblit b/dev-lang/perl/files/eblits/pkg_setup-v50220001.eblit
110 new file mode 100644
111 index 0000000..a2b0957
112 --- /dev/null
113 +++ b/dev-lang/perl/files/eblits/pkg_setup-v50220001.eblit
114 @@ -0,0 +1,72 @@
115 +# Copyright 1999-2015 Gentoo Foundation
116 +# Distributed under the terms of the GNU General Public License v2
117 +# $Id$
118 +
119 +eblit-perl-pkg_setup() {
120 + case ${CHOST} in
121 + *-freebsd*) osname="freebsd" ;;
122 + *-dragonfly*) osname="dragonfly" ;;
123 + *-netbsd*) osname="netbsd" ;;
124 + *-openbsd*) osname="openbsd" ;;
125 + *-darwin*) osname="darwin" ;;
126 + *-interix*) osname="interix" ;;
127 + *-aix*) osname="aix" ;;
128 + *) osname="linux" ;;
129 + esac
130 +
131 + myarch="${CHOST%%-*}-${osname}"
132 + if use debug ; then
133 + myarch+="-debug"
134 + fi
135 + if use ithreads ; then
136 + mythreading="-multi"
137 + myarch+="-thread"
138 + fi
139 +
140 + LIBPERL="libperl$(get_libname ${MY_PV} )"
141 + PRIV_LIB="/usr/$(get_libdir)/perl5/${MY_PV}"
142 + ARCH_LIB="/usr/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
143 + SITE_LIB="/usr/local/$(get_libdir)/perl5/${MY_PV}"
144 + SITE_ARCH="/usr/local/$(get_libdir)/perl5/${MY_PV}/${myarch}${mythreading}"
145 + VENDOR_LIB="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}"
146 + VENDOR_ARCH="/usr/$(get_libdir)/perl5/vendor_perl/${MY_PV}/${myarch}${mythreading}"
147 +
148 + if use ithreads ; then
149 + echo ""
150 + ewarn "THREADS WARNING:"
151 + ewarn "PLEASE NOTE: You are compiling ${MY_P} with"
152 + ewarn "interpreter-level threading enabled."
153 + ewarn "Threading is not supported by all applications "
154 + ewarn "that compile against perl. You use threading at "
155 + ewarn "your own discretion. "
156 + fi
157 + check_rebuild
158 + dual_scripts
159 +}
160 +
161 +check_rebuild() {
162 + if has_version "<dev-lang/perl-${SHORT_PV}" ; then
163 + echo ""
164 + ewarn "UPDATE THE PERL MODULES:"
165 + ewarn "After updating dev-lang/perl the installed Perl modules will"
166 + ewarn "have to be re-installed. In most cases, this is done automatically"
167 + ewarn "by the package manager, but you should still call perl-cleaner to"
168 + ewarn "make sure your system is consistent."
169 + ewarn "Use: perl-cleaner --all"
170 + elif has_version dev-lang/perl ; then
171 + # doesnot work
172 + #if ! has_version dev-lang/perl[ithreads=,debug=] ; then
173 + #if ! has_version dev-lang/perl[ithreads=] || ! has_version dev-lang/perl[debug=] ; then
174 + if ( use ithreads && ! has_version dev-lang/perl[ithreads] ) || \
175 + ( ! use ithreads && has_version dev-lang/perl[ithreads] ) || \
176 + ( use debug && ! has_version dev-lang/perl[debug] ) || \
177 + ( ! use debug && has_version dev-lang/perl[debug] ) ; then
178 + echo ""
179 + ewarn "TOGGLED USE-FLAGS WARNING:"
180 + ewarn "You changed one of the use-flags ithreads or debug."
181 + ewarn "You must rebuild all perl-modules installed."
182 + ewarn "Use: perl-cleaner --modules ; perl-cleaner --force --libperl"
183 + fi
184 + fi
185 +}
186 +
187
188 diff --git a/dev-lang/perl/perl-5.22.0.ebuild b/dev-lang/perl/perl-5.22.0.ebuild
189 new file mode 100644
190 index 0000000..f1f5b24
191 --- /dev/null
192 +++ b/dev-lang/perl/perl-5.22.0.ebuild
193 @@ -0,0 +1,120 @@
194 +# Copyright 1999-2015 Gentoo Foundation
195 +# Distributed under the terms of the GNU General Public License v2
196 +# $Id$
197 +
198 +EAPI=5
199 +
200 +inherit eutils alternatives flag-o-matic toolchain-funcs multilib multiprocessing
201 +
202 +PATCH_VER=1
203 +
204 +PERL_OLDVERSEN=""
205 +MODULE_AUTHOR=SHAY
206 +
207 +SHORT_PV="${PV%.*}"
208 +MY_P="perl-${PV/_rc/-RC}"
209 +MY_PV="${PV%_rc*}"
210 +
211 +DESCRIPTION="Larry Wall's Practical Extraction and Report Language"
212 +
213 +SRC_URI="
214 + mirror://cpan/src/5.0/${MY_P}.tar.bz2
215 + mirror://cpan/authors/id/${MODULE_AUTHOR:0:1}/${MODULE_AUTHOR:0:2}/${MODULE_AUTHOR}/${MY_P}.tar.bz2
216 + mirror://gentoo/${MY_P}-patches-${PATCH_VER}.tar.xz
217 + http://dev.gentoo.org/~civil/distfiles/${MY_P}-patches-${PATCH_VER}.tar.xz
218 +"
219 +HOMEPAGE="http://www.perl.org/"
220 +
221 +LICENSE="|| ( Artistic GPL-1+ )"
222 +SLOT="0/${SHORT_PV}"
223 +KEYWORDS="~alpha ~amd64 ~amd64-fbsd ~amd64-linux ~arm ~arm64 ~hppa ~hppa-hpux ~ia64 ~ia64-hpux ~ia64-linux ~m68k ~m68k-mint ~mips ~ppc ~ppc64 ~ppc-aix ~ppc-macos ~s390 ~sh ~sparc ~sparc64-solaris ~sparc-solaris ~x64-freebsd ~x64-macos ~x64-solaris ~x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~x86-linux ~x86-macos ~x86-solaris"
224 +IUSE="berkdb debug doc gdbm ithreads"
225 +
226 +RDEPEND="
227 + berkdb? ( sys-libs/db:* )
228 + gdbm? ( >=sys-libs/gdbm-1.8.3 )
229 + app-arch/bzip2
230 + sys-libs/zlib
231 +"
232 +DEPEND="${RDEPEND}
233 + !prefix? ( elibc_FreeBSD? ( sys-freebsd/freebsd-mk-defs ) )
234 +"
235 +PDEPEND="
236 + >=app-admin/perl-cleaner-2.5
237 + >=virtual/perl-File-Temp-0.230.400-r2
238 + >=virtual/perl-Data-Dumper-2.154.0
239 +"
240 +# bug 390719, bug 523624
241 +
242 +S="${WORKDIR}/${MY_P}"
243 +
244 +dual_scripts() {
245 + src_remove_dual perl-core/Archive-Tar 2.40.0 ptar ptardiff ptargrep
246 + src_remove_dual perl-core/Digest-SHA 5.950.0 shasum
247 + src_remove_dual perl-core/CPAN 2.110.0 cpan
248 + src_remove_dual perl-core/Encode 2.720.0 enc2xs piconv
249 + src_remove_dual perl-core/ExtUtils-MakeMaker 7.40.100 instmodsh
250 + src_remove_dual perl-core/ExtUtils-ParseXS 3.280.0 xsubpp
251 + src_remove_dual perl-core/IO-Compress 2.68.0 zipdetails
252 + src_remove_dual perl-core/JSON-PP 2.273.0 json_pp
253 + src_remove_dual perl-core/Module-CoreList 5.201.505.200 corelist
254 + src_remove_dual perl-core/Pod-Parser 1.630.0 pod2usage podchecker podselect
255 + src_remove_dual perl-core/Pod-Perldoc 3.250.0 perldoc
256 + src_remove_dual perl-core/Test-Harness 3.350.0 prove
257 + src_remove_dual perl-core/podlators 2.5.3 pod2man pod2text
258 + src_remove_dual_man perl-core/podlators 2.5.3 /usr/share/man/man1/perlpodstyle.1
259 +}
260 +
261 +# eblit-include [--skip] <function> [version]
262 +eblit-include() {
263 + local skipable=false
264 + [[ $1 == "--skip" ]] && skipable=true && shift
265 + [[ $1 == pkg_* ]] && skipable=true
266 +
267 + local e v func=$1 ver=$2
268 + [[ -z ${func} ]] && die "Usage: eblit-include <function> [version]"
269 + for v in ${ver:+-}${ver} -${PVR} -${PV} "" ; do
270 + e="${FILESDIR}/eblits/${func}${v}.eblit"
271 + if [[ -e ${e} ]] ; then
272 + . "${e}"
273 + return 0
274 + fi
275 + done
276 + ${skipable} && return 0
277 + die "Could not locate requested eblit '${func}' in ${FILESDIR}/eblits/"
278 +}
279 +
280 +# eblit-run-maybe <function>
281 +# run the specified function if it is defined
282 +eblit-run-maybe() {
283 + [[ $(type -t "$@") == "function" ]] && "$@"
284 +}
285 +
286 +# eblit-run <function> [version]
287 +# aka: src_unpack() { eblit-run src_unpack ; }
288 +eblit-run() {
289 + eblit-include --skip common "${*:2}"
290 + eblit-include "$@"
291 + eblit-run-maybe eblit-$1-pre
292 + eblit-${PN}-$1
293 + eblit-run-maybe eblit-$1-post
294 +}
295 +
296 +src_prepare() { eblit-run src_prepare v50160001 ; }
297 +src_configure() { eblit-run src_configure v50180002 ; }
298 +#src_compile() { eblit-run src_compile v50160001 ; }
299 +src_test() {
300 + export NO_GENTOO_NETWORK_TESTS=1;
301 + eblit-run src_test v50160001 ;
302 +}
303 +src_install() { eblit-run src_install v50200001 ; }
304 +
305 +# FILESDIR might not be available during binpkg install
306 +# FIXME: version passing
307 +for x in setup {pre,post}{inst,rm} ; do
308 + e="${FILESDIR}/eblits/pkg_${x}-v50220001.eblit"
309 + if [[ -e ${e} ]] ; then
310 + . "${e}"
311 + eval "pkg_${x}() { eblit-run pkg_${x} v50160001 ; }"
312 + fi
313 +done