/[gentoo-x86]/sys-devel/libperl/libperl-5.8.7.ebuild
Gentoo

Contents of /sys-devel/libperl/libperl-5.8.7.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.26 - (show annotations) (download)
Mon Oct 23 19:34:42 2006 UTC (12 years, 11 months ago) by mcummings
Branch: MAIN
CVS Tags: HEAD
Changes since 1.25: +1 -1 lines
FILE REMOVED
Removing old libperl
(Portage version: 2.1.2_pre3-r5)
 (Signed Manifest commit)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-devel/libperl/libperl-5.8.7.ebuild,v 1.25 2006/09/08 10:44:44 mcummings Exp $
4
5 # The basic theory based on comments from Daniel Robbins <drobbins@gentoo.org>.
6 #
7 # We split the perl ebuild into libperl and perl. The layout is as follows:
8 #
9 # libperl:
10 #
11 # This is a slotted (SLOT=[0-9]*) ebuild, meaning we should be able to have a
12 # few versions that are not binary compadible installed.
13 #
14 # How we get libperl.so multi-versioned, is by adding to the link command:
15 #
16 # -Wl,-soname -Wl,libperl.so.`echo $(LIBPERL) | cut -d. -f3`
17 #
18 # This gives us:
19 #
20 # $(LIBPERL): $& perl$(OBJ_EXT) $(obj) $(LIBPERLEXPORT)
21 # $(LD) -o $@ $(SHRPLDFLAGS) perl$(OBJ_EXT) $(obj) \
22 # -Wl,-soname -Wl,libperl.so.`echo $(LIBPERL) | cut -d. -f3`
23 #
24 # We then configure perl with LIBPERL set to:
25 #
26 # LIBPERL="libperl.so.${SLOT}.`echo ${PV} | cut -d. -f1,2`"
27 #
28 # Or with the variables defined in this ebuild:
29 #
30 # LIBPERL="libperl.so.${PERLSLOT}.${SHORT_PV}"
31 #
32 # The result is that our 'soname' is 'libperl.so.${PERLSLOT}' (at the time of
33 # writing this for perl-5.8.0, 'libperl.so.1'), causing all apps that is linked
34 # to libperl to link to 'libperl.so.${PERLSLOT}'.
35 #
36 # If a new perl version, perl-z.y.z comes out that have a libperl not binary
37 # compatible with the previous version, we just keep the previous libperl
38 # installed, and all apps linked to it will still be able to use:
39 #
40 # libperl.so.${PERLSLOT}'
41 #
42 # while the new ones will link to:
43 #
44 # libperl.so.$((PERLSLOT+1))'
45 #
46 # perl:
47 #
48 # Not much to this one. It compiles with a static libperl.a, and are unslotted
49 # (meaning SLOT=0). We thus always have the latest *stable* perl version
50 # installed, with corrisponding version of libperl. The perl ebuild will of
51 # course DEPEND on libperl.
52 #
53 # Martin Schlemmer <azarah@gentoo.org> (28 Dec 2002).
54
55 IUSE="berkdb debug gdbm ithreads"
56
57 inherit eutils flag-o-matic toolchain-funcs multilib
58
59 # The slot of this binary compat version of libperl.so
60 PERLSLOT="1"
61
62 SHORT_PV="${PV%.*}"
63 MY_P="perl-${PV/_rc/-RC}"
64 S="${WORKDIR}/${MY_P}"
65 DESCRIPTION="Larry Wall's Practical Extraction and Reporting Language"
66 SRC_URI="ftp://ftp.cpan.org/pub/CPAN/src/${MY_P}.tar.bz2"
67 HOMEPAGE="http://www.perl.org"
68 SLOT="${PERLSLOT}"
69 LIBPERL="libperl$(get_libname ${PERLSLOT}.${SHORT_PV})"
70 LICENSE="Artistic GPL-2"
71 KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ~ppc-macos ppc64 s390 sh sparc x86"
72
73 # rac 2004.08.06
74
75 # i am not kidding here. you will forkbomb yourself out of existence
76 # because make check -n wants to make miniperl, which runs itself at
77 # the very end to make sure it's working right. this behaves very
78 # badly when you -n it, because it won't exist and will therefore try
79 # to build itself again ad infinitum.
80
81 RESTRICT="test"
82
83 DEPEND="!elibc_uclibc? ( sys-apps/groff )
84 berkdb? ( sys-libs/db )
85 gdbm? ( >=sys-libs/gdbm-1.8.0 )"
86
87 RDEPEND="
88 berkdb? ( sys-libs/db )
89 gdbm? ( >=sys-libs/gdbm-1.8.0 )"
90
91 PDEPEND=">=dev-lang/perl-${PV}"
92
93 pkg_setup() {
94 # I think this should rather be displayed if you *have* 'ithreads'
95 # in USE if it could break things ...
96 if use ithreads
97 then
98 ewarn ""
99 ewarn "PLEASE NOTE: You are compiling perl-5.8 with"
100 ewarn "interpreter-level threading enabled."
101 ewarn "Threading is not supported by all applications "
102 ewarn "that compile against perl. You use threading at "
103 ewarn "your own discretion. "
104 ewarn ""
105 epause 10
106 else
107 ewarn ""
108 ewarn "PLEASE NOTE: If you want to compile perl-5.8 with"
109 ewarn "threading enabled , you must restart this emerge"
110 ewarn "with USE=ithreads emerge...."
111 ewarn "Threading is not supported by all applications "
112 ewarn "that compile against perl. You use threading at "
113 ewarn "your own discretion. "
114 ewarn ""
115 epause 10
116 fi
117 }
118
119 src_unpack() {
120
121 unpack ${A}
122
123 # Fix the build scripts to create libperl with a soname of ${SLOT}.
124 # We basically add:
125 #
126 # -Wl,-soname -Wl,libperl.so.`echo $(LIBPERL) | cut -d. -f3`
127 #
128 # to the line that links libperl.so, and then set LIBPERL to:
129 #
130 # LIBPERL=libperl.so.${SLOT}.`echo ${PV} | cut -d. -f1,2`
131 #
132 cd ${S};
133 use userland_Darwin || epatch ${FILESDIR}/${PN}-create-libperl-soname.patch
134
135 # Configure makes an unwarranted assumption that /bin/ksh is a
136 # good shell. This patch makes it revert to using /bin/sh unless
137 # /bin/ksh really is executable. Should fix bug 42665.
138 # rac 2004.06.09
139 cd ${S}; epatch ${FILESDIR}/${PN}-noksh.patch
140
141 # we need the same @INC-inversion magic here we do in perl
142 cd ${S}; epatch ${FILESDIR}/${PN}-reorder-INC.patch
143 }
144
145 src_compile() {
146 # Perl has problems compiling with -Os in your flags
147 use elibc_uclibc || replace-flags "-Os" "-O2"
148 # This flag makes compiling crash in interesting ways
149 filter-flags "-malign-double"
150
151 export LC_ALL="C"
152 local myconf=""
153
154 case ${CHOST} in
155 *-freebsd*) osname="freebsd" ;;
156 *-netbsd*) osname="netbsd" ;;
157 *-openbsd*) osname="openbsd" ;;
158 *-darwin*) osname="darwin" ;;
159
160 *) osname="linux" ;;
161 esac
162
163 if use ithreads
164 then
165 einfo "using ithreads"
166 mythreading="-multi"
167 myconf="-Dusethreads ${myconf}"
168 myarch=$(get_abi_CHOST)
169 myarch="${myarch%%-*}-${osname}-thread"
170 else
171 myarch=$(get_abi_CHOST)
172 myarch="${myarch%%-*}-${osname}"
173 fi
174
175 ewarn "myarch: ${myarch}"
176
177 if use gdbm
178 then
179 myconf="${myconf} -Di_gdbm"
180 fi
181 if use berkdb
182 then
183 myconf="${myconf} -Di_db -Di_ndbm"
184 else
185 myconf="${myconf} -Ui_db -Ui_ndbm"
186 fi
187 if use mips
188 then
189 # this is needed because gcc 3.3-compiled kernels will hang
190 # the machine trying to run this test - check with `Kumba
191 # <rac@gentoo.org> 2003.06.26
192 myconf="${myconf} -Dd_u32align"
193 fi
194
195 if use debug
196 then
197 CFLAGS="${CFLAGS} -g"
198 fi
199
200 if use sparc
201 then
202 myconf="${myconf} -Ud_longdbl"
203 fi
204
205 rm -f config.sh Policy.sh
206
207 [ -n "${ABI}" ] && myconf="${myconf} -Dusrinc=$(get_ml_incdir)"
208
209 [[ ${ELIBC} == "FreeBSD" ]] && myconf="${myconf} -Dlibc=/usr/lib/libc.a"
210
211 if [[ $(get_libdir) != "lib" ]] ; then
212 myconf="${myconf} -Dlibpth='/usr/local/$(get_libdir) /$(get_libdir) \
213 /usr/$(get_libdir)'"
214 fi
215
216 sh Configure -des \
217 -Darchname="${myarch}" \
218 -Dcccdlflags='-fPIC' \
219 -Dccdlflags='-rdynamic' \
220 -Dcc="$(tc-getCC)" \
221 -Dprefix='/usr' \
222 -Dvendorprefix='/usr' \
223 -Dsiteprefix='/usr' \
224 -Dlocincpth=' ' \
225 -Doptimize="${CFLAGS}" \
226 -Duselargefiles \
227 -Duseshrplib \
228 -Dman3ext='3pm' \
229 -Dlibperl="${LIBPERL}" \
230 -Dd_dosuid \
231 -Dd_semctl_semun \
232 -Dcf_by='Gentoo' \
233 -Ud_csh \
234 ${myconf} || die
235
236 emake -j1 -f Makefile depend || die "Couldn't make libperl$(get_libname) depends"
237 emake -j1 -f Makefile LIBPERL=${LIBPERL} ${LIBPERL} || die "Unable to make libperl$(get_libname)"
238 mv ${LIBPERL} ${WORKDIR}
239 }
240
241 src_install() {
242
243 export LC_ALL="C"
244
245 if [ "${PN}" = "libperl" ]
246 then
247 dolib.so ${WORKDIR}/${LIBPERL}
248 dosym ${LIBPERL} /usr/$(get_libdir)/libperl$(get_libname ${PERLSLOT})
249 else
250 # Need to do this, else apps do not link to dynamic version of
251 # the library ...
252 local coredir="/usr/lib/perl5/${PV}/${myarch}${mythreading}/CORE"
253 dodir ${coredir}
254 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/${LIBPERL}
255 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/libperl$(get_libname ${PERLSLOT})
256 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/libperl$(get_libname)
257
258 # Fix for "stupid" modules and programs
259 dodir /usr/lib/perl5/site_perl/${PV}/${myarch}${mythreading}
260
261 make DESTDIR="${D}" \
262 INSTALLMAN1DIR="${D}/usr/share/man/man1" \
263 INSTALLMAN3DIR="${D}/usr/share/man/man3" \
264 install || die "Unable to make install"
265
266 cp -f utils/h2ph utils/h2ph_patched
267
268 LD_LIBRARY_PATH=. ./perl -Ilib utils/h2ph_patched \
269 -a -d ${D}/usr/lib/perl5/${PV}/${myarch}${mythreading} <<EOF
270 asm/termios.h
271 syscall.h
272 syslimits.h
273 syslog.h
274 sys/ioctl.h
275 sys/socket.h
276 sys/time.h
277 wait.h
278 EOF
279
280 # This is to fix a missing c flag for backwards compat
281 for i in `find ${D}/usr/lib/perl5 -iname "Config.pm"`;do
282 sed -e "s:ccflags=':ccflags='-DPERL5 :" \
283 -e "s:cppflags=':cppflags='-DPERL5 :" \
284 ${i} > ${i}.new &&\
285 mv ${i}.new ${i} || die "Sed failed"
286 done
287
288 # A poor fix for the miniperl issues
289 dosed 's:./miniperl:/usr/bin/perl:' /usr/lib/perl5/${PV}/ExtUtils/xsubpp
290 fperms 0444 /usr/lib/perl5/${PV}/ExtUtils/xsubpp
291 dosed 's:./miniperl:/usr/bin/perl:' /usr/bin/xsubpp
292 fperms 0755 /usr/bin/xsubpp
293
294 ./perl installman \
295 --man1dir="${D}/usr/share/man/man1" --man1ext='1' \
296 --man3dir="${D}/usr/share/man/man3" --man3ext='3'
297
298 # This removes ${D} from Config.pm and .packlist
299 for i in `find ${D} -iname "Config.pm"` `find ${D} -iname ".packlist"`;do
300 einfo "Removing ${D} from ${i}..."
301 sed -e "s:${D}::" ${i} > ${i}.new &&\
302 mv ${i}.new ${i} || die "Sed failed"
303 done
304 fi
305
306 dodoc Changes* Artistic Copying README Todo* AUTHORS
307
308 if [ "${PN}" = "perl" ]
309 then
310 # HTML Documentation
311 # We expect errors, warnings, and such with the following.
312
313 dodir /usr/share/doc/${PF}/html
314 ./perl installhtml \
315 --podroot='.' \
316 --podpath='lib:ext:pod:vms' \
317 --recurse \
318 --htmldir="${D}/usr/share/doc/${PF}/html" \
319 --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
320 fi
321 }
322
323 pkg_postinst() {
324
325 # Make sure we do not have stale/invalid libperl.so 's ...
326 if [ -f "${ROOT}usr/$(get_libdir)/libperl$(get_libname)" -a ! -L "${ROOT}usr/$(get_libdir)/libperl$(get_libname)" ]
327 then
328 mv -f ${ROOT}usr/$(get_libdir)/libperl$(get_libname) ${ROOT}usr/$(get_libdir)/libperl$(get_libname).old
329 fi
330
331 # Next bit is to try and setup the /usr/lib/libperl.so symlink
332 # properly ...
333 local libnumber="`ls -1 ${ROOT}usr/$(get_libdir)/libperl$(get_libname ?.*) | grep -v '\.old' | wc -l`"
334 if [ "${libnumber}" -eq 1 ]
335 then
336 # Only this version of libperl is installed, so just link libperl.so
337 # to the *soname* version of it ...
338 ln -snf libperl$(get_libname ${PERLSLOT}) ${ROOT}usr/$(get_libdir)/libperl$(get_libname)
339 else
340 if [ -x "${ROOT}/usr/bin/perl" ]
341 then
342 # OK, we have more than one version .. first try to figure out
343 # if there are already a perl installed, if so, link libperl.so
344 # to that *soname* version of libperl.so ...
345 local perlversion="`${ROOT}/usr/bin/perl -V:version | cut -d\' -f2 | cut -d. -f1,2`"
346
347 cd ${ROOT}usr/$(get_libdir)
348 # Link libperl.so to the *soname* versioned lib ...
349 ln -snf `echo libperl$(get_libname ?.${perlversion}) | cut -d. -f1,2,3` libperl$(get_libname)
350 else
351 local x latest
352
353 # Nope, we are not so lucky ... try to figure out what version
354 # is the latest, and keep fingers crossed ...
355 for x in `ls -1 ${ROOT}usr/$(get_libdir)/libperl$(get_libname ?.*)`
356 do
357 latest="${x}"
358 done
359
360 cd ${ROOT}usr/$(get_libdir)
361 # Link libperl.so to the *soname* versioned lib ...
362 ln -snf `echo ${latest##*/} | cut -d. -f1,2,3` libperl$(get_libname)
363 fi
364 fi
365 }
366

  ViewVC Help
Powered by ViewVC 1.1.20