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

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

  ViewVC Help
Powered by ViewVC 1.1.20