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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20