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

Contents of /sys-devel/libperl/libperl-5.8.4-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.21 - (show annotations) (download)
Wed Jun 29 22:13:08 2005 UTC (14 years, 3 months ago) by mcummings
Branch: MAIN
CVS Tags: HEAD
Changes since 1.20: +1 -1 lines
FILE REMOVED
Perl 5.8.6 unmasking; perl 5.8.7 being added
(Portage version: 2.0.51.22-r1)

1 # Copyright 1999-2005 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.4-r1.ebuild,v 1.20 2005/06/23 01:19:34 agriffis 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
58
59 # Perl has problems compiling with -Os in your flags
60 use elibc_uclibc || replace-flags "-Os" "-O2"
61 # This flag makes compiling crash in interesting ways
62 filter-flags "-malign-double"
63
64 # The slot of this binary compat version of libperl.so
65 PERLSLOT="1"
66
67 SHORT_PV="${PV%.*}"
68 MY_P="perl-${PV/_rc/-RC}"
69 S="${WORKDIR}/${MY_P}"
70 DESCRIPTION="Larry Wall's Practical Extraction and Reporting Language"
71 SRC_URI="ftp://ftp.cpan.org/pub/CPAN/src/${MY_P}.tar.gz"
72 HOMEPAGE="http://www.perl.org"
73 RESTRICT="test"
74
75 if [ "${PN}" = "libperl" ]
76 then
77 SLOT="${PERLSLOT}"
78 else
79 SLOT="0"
80 fi
81
82 LIBPERL="libperl.so.${PERLSLOT}.${SHORT_PV}"
83
84 LICENSE="Artistic GPL-2"
85 KEYWORDS="x86 ppc sparc mips alpha arm hppa amd64 ia64 ~ppc64 s390 sh"
86
87 DEPEND="!elibc_uclibc? ( sys-apps/groff )
88 berkdb? ( sys-libs/db )
89 gdbm? ( >=sys-libs/gdbm-1.8.0 )"
90
91 RDEPEND="
92 berkdb? ( sys-libs/db )
93 gdbm? ( >=sys-libs/gdbm-1.8.0 )"
94
95 PDEPEND=">=dev-lang/perl-${PV}"
96
97 pkg_setup() {
98
99 # I think this should rather be displayed if you *have* 'ithreads'
100 # in USE if it could break things ...
101 if use ithreads
102 then
103 ewarn ""
104 ewarn "PLEASE NOTE: You are compiling perl-5.8 with"
105 ewarn "interpreter-level threading enabled."
106 ewarn "Threading is not supported by all applications "
107 ewarn "that compile against perl. You use threading at "
108 ewarn "your own discretion. "
109 ewarn ""
110 epause 10
111 else
112 ewarn ""
113 ewarn "PLEASE NOTE: If you want to compile perl-5.8 with"
114 ewarn "threading enabled , you must restart this emerge"
115 ewarn "with USE=ithreads emerge...."
116 ewarn "Threading is not supported by all applications "
117 ewarn "that compile against perl. You use threading at "
118 ewarn "your own discretion. "
119 ewarn ""
120 epause 10
121 fi
122 }
123
124 src_unpack() {
125
126 unpack ${A}
127
128 # Fix the build scripts to create libperl with a soname of ${SLOT}.
129 # We basically add:
130 #
131 # -Wl,-soname -Wl,libperl.so.`echo $(LIBPERL) | cut -d. -f3`
132 #
133 # to the line that links libperl.so, and then set LIBPERL to:
134 #
135 # LIBPERL=libperl.so.${SLOT}.`echo ${PV} | cut -d. -f1,2`
136 #
137 cd ${S}; epatch ${FILESDIR}/${P}-create-libperl-soname.patch
138
139 # uclibc support - dragonheart 2004.06.16
140 cd ${S}; epatch ${FILESDIR}/${P}-uclibc.patch
141
142 # Configure makes an unwarranted assumption that /bin/ksh is a
143 # good shell. This patch makes it revert to using /bin/sh unless
144 # /bin/ksh really is executable. Should fix bug 42665.
145 # rac 2004.06.09
146 cd ${S}; epatch ${FILESDIR}/${P}-noksh.patch
147
148 }
149
150 src_compile() {
151
152 export LC_ALL="C"
153 local myconf=""
154
155 if use ithreads
156 then
157 einfo "using ithreads"
158 mythreading="-multi"
159 myconf="-Dusethreads ${myconf}"
160 myarch="${CHOST%%-*}-linux-thread"
161 else
162 myarch="${CHOST%%-*}-linux"
163 fi
164
165 if use gdbm
166 then
167 myconf="${myconf} -Di_gdbm"
168 fi
169 if use berkdb
170 then
171 myconf="${myconf} -Di_db -Di_ndbm"
172 else
173 myconf="${myconf} -Ui_db -Ui_ndbm"
174 fi
175 if use mips
176 then
177 # this is needed because gcc 3.3-compiled kernels will hang
178 # the machine trying to run this test - check with `Kumba
179 # <rac@gentoo.org> 2003.06.26
180 myconf="${myconf} -Dd_u32align"
181 fi
182
183 if use debug
184 then
185 CFLAGS="${CFLAGS} -g"
186 fi
187
188 if use sparc
189 then
190 myconf="${myconf} -Ud_longdbl"
191 fi
192
193 if [ "${PN}" = "libperl" ]
194 then
195 rm -f config.sh Policy.sh
196
197 sh Configure -des \
198 -Darchname="${myarch}" \
199 -Dcccdlflags='-fPIC' \
200 -Dccdlflags='-rdynamic' \
201 -Dcc="${CC:-gcc}" \
202 -Dprefix='/usr' \
203 -Dvendorprefix='/usr' \
204 -Dsiteprefix='/usr' \
205 -Dlocincpth=' ' \
206 -Doptimize="${CFLAGS}" \
207 -Duselargefiles \
208 -Duseshrplib \
209 -Dman3ext='3pm' \
210 -Dlibperl="${LIBPERL}" \
211 -Dd_dosuid \
212 -Dd_semctl_semun \
213 -Dcf_by='Gentoo' \
214 -Ud_csh \
215 ${myconf} || die
216
217 emake -f Makefile depend || die "Couldn't make libperl.so depends"
218 emake -f Makefile ${LIBPERL} || die "Unable to make libperl.so"
219 mv ${LIBPERL} ${WORKDIR}
220 else
221 cat > config.over <<EOF
222 installprefix=${D}/usr
223 installarchlib=\`echo \$installarchlib | sed "s!\$prefix!\$installprefix!"\`
224 installbin=\`echo \$installbin | sed "s!\$prefix!\$installprefix!"\`
225 installman1dir=\`echo \$installman1dir | sed "s!\$prefix!\$installprefix!"\`
226 installman3dir=\`echo \$installman3dir | sed "s!\$prefix!\$installprefix!"\`
227 installman1dir=\`echo \$installman1dir | sed "s!/share/share/!/share/!"\`
228 installman3dir=\`echo \$installman3dir | sed "s!/share/share/!/share/!"\`
229 installman1dir=\`echo \$installman1dir | sed "s!/usr/man/!/usr/share/man/!"\`
230 installman3dir=\`echo \$installman3dir | sed "s!/usr/man/!/usr/share/man/!"\`
231 man1ext=1
232 man3ext=3pm
233 installprivlib=\`echo \$installprivlib | sed "s!\$prefix!\$installprefix!"\`
234 installscript=\`echo \$installscript | sed "s!\$prefix!\$installprefix!"\`
235 installsitelib=\`echo \$installsitelib | sed "s!\$prefix!\$installprefix!"\`
236 installsitearch=\`echo \$installsitearch | sed "s!\$prefix!\$installprefix!"\`
237 EOF
238 sleep 10
239 sh Configure -des \
240 -Darchname="${myarch}" \
241 -Dcc="${CC:-gcc}" \
242 -Dprefix='/usr' \
243 -Dvendorprefix='/usr' \
244 -Dsiteprefix='/usr' \
245 -Dlocincpth=' ' \
246 -Doptimize="${CFLAGS}" \
247 -Duselargefiles \
248 -Dd_dosuid \
249 -Dd_semctl_semun \
250 -Dscriptdir=/usr/bin \
251 -Dman3ext='3pm' \
252 -Dcf_by='Gentoo' \
253 -Ud_csh \
254 ${myconf} || die "Unable to configure"
255
256 MAKEOPTS="${MAKEOPTS} -j1" emake || die "Unable to make"
257
258 emake -i test CCDLFLAGS=
259 fi
260 }
261
262 src_install() {
263
264 export LC_ALL="C"
265
266 if [ "${PN}" = "libperl" ]
267 then
268 dolib.so ${WORKDIR}/${LIBPERL}
269 preplib
270 else
271 # Need to do this, else apps do not link to dynamic version of
272 # the library ...
273 local coredir="/usr/lib/perl5/${PV}/${myarch}${mythreading}/CORE"
274 dodir ${coredir}
275 dosym ../../../../${LIBPERL} ${coredir}/${LIBPERL}
276 dosym ../../../../${LIBPERL} ${coredir}/libperl.so.${PERLSLOT}
277 dosym ../../../../${LIBPERL} ${coredir}/libperl.so
278
279 # Fix for "stupid" modules and programs
280 dodir /usr/lib/perl5/site_perl/${PV}/${myarch}${mythreading}
281
282 make DESTDIR="${D}" \
283 INSTALLMAN1DIR="${D}/usr/share/man/man1" \
284 INSTALLMAN3DIR="${D}/usr/share/man/man3" \
285 install || die "Unable to make install"
286
287 cp -f utils/h2ph utils/h2ph_patched
288
289 LD_LIBRARY_PATH=. ./perl -Ilib utils/h2ph_patched \
290 -a -d ${D}/usr/lib/perl5/${PV}/${myarch}${mythreading} <<EOF
291 asm/termios.h
292 syscall.h
293 syslimits.h
294 syslog.h
295 sys/ioctl.h
296 sys/socket.h
297 sys/time.h
298 wait.h
299 EOF
300
301 # This is to fix a missing c flag for backwards compat
302 for i in `find ${D}/usr/lib/perl5 -iname "Config.pm"`;do
303 sed -e "s:ccflags=':ccflags='-DPERL5 :" \
304 -e "s:cppflags=':cppflags='-DPERL5 :" \
305 ${i} > ${i}.new &&\
306 mv ${i}.new ${i} || die "Sed failed"
307 done
308
309 # A poor fix for the miniperl issues
310 dosed 's:./miniperl:/usr/bin/perl:' /usr/lib/perl5/${PV}/ExtUtils/xsubpp
311 fperms 0444 /usr/lib/perl5/${PV}/ExtUtils/xsubpp
312 dosed 's:./miniperl:/usr/bin/perl:' /usr/bin/xsubpp
313 fperms 0755 /usr/bin/xsubpp
314
315 ./perl installman \
316 --man1dir="${D}/usr/share/man/man1" --man1ext='1' \
317 --man3dir="${D}/usr/share/man/man3" --man3ext='3'
318
319 # This removes ${D} from Config.pm and .packlist
320 for i in `find ${D} -iname "Config.pm"` `find ${D} -iname ".packlist"`;do
321 einfo "Removing ${D} from ${i}..."
322 sed -e "s:${D}::" ${i} > ${i}.new &&\
323 mv ${i}.new ${i} || die "Sed failed"
324 done
325 fi
326
327 dodoc Changes* Artistic Copying README Todo* AUTHORS
328
329 if [ "${PN}" = "perl" ]
330 then
331 # HTML Documentation
332 # We expect errors, warnings, and such with the following.
333
334 dodir /usr/share/doc/${PF}/html
335 ./perl installhtml \
336 --podroot='.' \
337 --podpath='lib:ext:pod:vms' \
338 --recurse \
339 --htmldir="${D}/usr/share/doc/${PF}/html" \
340 --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
341 fi
342 }
343
344 pkg_postinst() {
345
346 # Make sure we do not have stale/invalid libperl.so 's ...
347 if [ -f "${ROOT}usr/lib/libperl.so" -a ! -L "${ROOT}usr/lib/libperl.so" ]
348 then
349 mv -f ${ROOT}usr/lib/libperl.so ${ROOT}usr/lib/libperl.so.old
350 fi
351
352 # Next bit is to try and setup the /usr/lib/libperl.so symlink
353 # properly ...
354 local libnumber="`ls -1 ${ROOT}usr/lib/libperl.so.?.* | grep -v '\.old' | wc -l`"
355 if [ "${libnumber}" -eq 1 ]
356 then
357 # Only this version of libperl is installed, so just link libperl.so
358 # to the *soname* version of it ...
359 ln -snf libperl.so.${PERLSLOT} ${ROOT}usr/lib/libperl.so
360 else
361 if [ -x "${ROOT}/usr/bin/perl" ]
362 then
363 # OK, we have more than one version .. first try to figure out
364 # if there are already a perl installed, if so, link libperl.so
365 # to that *soname* version of libperl.so ...
366 local perlversion="`${ROOT}/usr/bin/perl -V:version | cut -d\' -f2 | cut -d. -f1,2`"
367
368 cd ${ROOT}usr/lib
369 # Link libperl.so to the *soname* versioned lib ...
370 ln -snf `echo libperl.so.?.${perlversion} | cut -d. -f1,2,3` libperl.so
371 else
372 local x latest
373
374 # Nope, we are not so lucky ... try to figure out what version
375 # is the latest, and keep fingers crossed ...
376 for x in `ls -1 ${ROOT}usr/lib/libperl.so.?.*`
377 do
378 latest="${x}"
379 done
380
381 cd ${ROOT}usr/lib
382 # Link libperl.so to the *soname* versioned lib ...
383 ln -snf `echo ${latest##*/} | cut -d. -f1,2,3` libperl.so
384 fi
385 fi
386 }
387

  ViewVC Help
Powered by ViewVC 1.1.20