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

Contents of /sys-devel/libperl/libperl-5.8.8_rc1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Feb 7 15:21:25 2006 UTC (13 years, 8 months ago) by mcummings
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +1 -1 lines
FILE REMOVED
libperl 5.8.8, shiny and new.
(Portage version: 2.1_pre3-r1)

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.8_rc1.ebuild,v 1.3 2006/01/24 17:13:55 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/authors/id/N/NW/NWCLARK/${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 fi
107 }
108
109 src_unpack() {
110
111 unpack ${A}
112
113 # Fix the build scripts to create libperl with a soname of ${SLOT}.
114 # We basically add:
115 #
116 # -Wl,-soname -Wl,libperl.so.`echo $(LIBPERL) | cut -d. -f3`
117 #
118 # to the line that links libperl.so, and then set LIBPERL to:
119 #
120 # LIBPERL=libperl.so.${SLOT}.`echo ${PV} | cut -d. -f1,2`
121 #
122 cd ${S};
123 use userland_Darwin || epatch ${FILESDIR}/${PN}-create-libperl-soname.patch
124
125 # uclibc support - dragonheart 2004.06.16
126 # Now upstreamed - MPC 2005.06.28
127 #cd ${S}; epatch ${FILESDIR}/${PN}-uclibc.patch
128
129 # Configure makes an unwarranted assumption that /bin/ksh is a
130 # good shell. This patch makes it revert to using /bin/sh unless
131 # /bin/ksh really is executable. Should fix bug 42665.
132 # rac 2004.06.09
133 cd ${S}; epatch ${FILESDIR}/${PN}-noksh.patch
134
135 # we need the same @INC-inversion magic here we do in perl
136 cd ${S}; epatch ${FILESDIR}/${P}-reorder-INC.patch
137 }
138
139 src_compile() {
140 # Perl has problems compiling with -Os in your flags
141 # some arches and -O do not mix :)
142 use arm && replace-flags -O? -O1
143 use ppc && replace-flags -O? -O1
144 use ia64 && replace-flags -O? -O1
145 # Perl has problems compiling with -Os in your flags with glibc
146 use elibc_uclibc || replace-flags "-Os" "-O2"
147 # This flag makes compiling crash in interesting ways
148 filter-flags "-malign-double"
149 # Fixes bug #97645
150 use ppc && filter-flags -mpowerpc-gpopt
151
152 export LC_ALL="C"
153 local myconf=""
154
155 case ${CHOST} in
156 *-freebsd*) osname="freebsd" ;;
157 *-netbsd*) osname="netbsd" ;;
158 *-openbsd*) osname="openbsd" ;;
159 *-darwin*) osname="darwin" ;;
160
161 *) osname="linux" ;;
162 esac
163
164 if use ithreads
165 then
166 einfo "using ithreads"
167 mythreading="-multi"
168 myconf="-Dusethreads ${myconf}"
169 myarch=$(get_abi_CHOST)
170 myarch="${myarch%%-*}-${osname}-thread"
171 else
172 myarch=$(get_abi_CHOST)
173 myarch="${myarch%%-*}-${osname}"
174 fi
175
176 local inclist=$(for v in $PERL_OLDVERSEN; do echo -n "$v $v/$myarch$mythreading "; done)
177
178 # allow either gdbm to provide ndbm (in <gdbm/ndbm.h>) or db1
179
180 myndbm='U'
181 mygdbm='U'
182 mydb='U'
183
184 if use gdbm
185 then
186 mygdbm='D'
187 myndbm='D'
188 fi
189 if use berkdb
190 then
191 mydb='D'
192 has_version '=sys-libs/db-1*' && myndbm='D'
193 fi
194
195 myconf="${myconf} -${myndbm}i_ndbm -${mygdbm}i_gdbm -${mydb}i_db"
196
197 if use mips
198 then
199 # this is needed because gcc 3.3-compiled kernels will hang
200 # the machine trying to run this test - check with `Kumba
201 # <rac@gentoo.org> 2003.06.26
202 myconf="${myconf} -Dd_u32align"
203 fi
204
205 if use debug
206 then
207 CFLAGS="${CFLAGS} -g"
208 fi
209
210 if use sparc
211 then
212 myconf="${myconf} -Ud_longdbl"
213 fi
214
215 if use alpha && "$(tc-getCC)" == "ccc"
216 then
217 ewarn "Perl will not be built with berkdb support, use gcc if you needed it..."
218 myconf="${myconf} -Ui_db -Ui_ndbm"
219 fi
220
221 rm -f config.sh Policy.sh
222
223 [ -n "${ABI}" ] && myconf="${myconf} -Dusrinc=$(get_ml_incdir)"
224
225 [[ ${ELIBC} == "FreeBSD" ]] && myconf="${myconf} -Dlibc=/usr/lib/libc.a"
226
227 if [[ $(get_libdir) != "lib" ]] ; then
228 myconf="${myconf} -Dlibpth='/usr/local/$(get_libdir) /$(get_libdir) \
229 /usr/$(get_libdir)'"
230 fi
231
232 sh Configure -des \
233 -Darchname="${myarch}" \
234 -Dcccdlflags='-fPIC' \
235 -Dccdlflags='-rdynamic' \
236 -Dcc="$(tc-getCC)" \
237 -Dprefix='/usr' \
238 -Dvendorprefix='/usr' \
239 -Dsiteprefix='/usr' \
240 -Dlocincpth=' ' \
241 -Doptimize="${CFLAGS}" \
242 -Duselargefiles \
243 -Duseshrplib \
244 -Dman3ext='3pm' \
245 -Dlibperl="${LIBPERL}" \
246 -Dd_dosuid \
247 -Dd_semctl_semun \
248 -Dcf_by='Gentoo' \
249 -Ud_csh \
250 ${myconf} || die "Unable to configure"
251
252 emake -j1 -f Makefile depend || die "Couldn't make libperl$(get_libname) depends"
253 emake -j1 -f Makefile LIBPERL=${LIBPERL} ${LIBPERL} || die "Unable to make libperl$(get_libname)"
254 mv ${LIBPERL} ${WORKDIR}
255 }
256
257 src_install() {
258
259 export LC_ALL="C"
260
261 if [ "${PN}" = "libperl" ]
262 then
263 dolib.so ${WORKDIR}/${LIBPERL}
264 dosym ${LIBPERL} /usr/$(get_libdir)/libperl$(get_libname ${PERLSLOT})
265 else
266 # Need to do this, else apps do not link to dynamic version of
267 # the library ...
268 local coredir="/usr/lib/perl5/${PV}/${myarch}${mythreading}/CORE"
269 dodir ${coredir}
270 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/${LIBPERL}
271 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/libperl$(get_libname ${PERLSLOT})
272 dosym ../../../../../$(get_libdir)/${LIBPERL} ${coredir}/libperl$(get_libname)
273
274 # Fix for "stupid" modules and programs
275 dodir /usr/lib/perl5/site_perl/${PV}/${myarch}${mythreading}
276
277 make DESTDIR="${D}" \
278 INSTALLMAN1DIR="${D}/usr/share/man/man1" \
279 INSTALLMAN3DIR="${D}/usr/share/man/man3" \
280 install || die "Unable to make install"
281
282 cp -f utils/h2ph utils/h2ph_patched
283
284 LD_LIBRARY_PATH=. ./perl -Ilib utils/h2ph_patched \
285 -a -d ${D}/usr/lib/perl5/${PV}/${myarch}${mythreading} <<EOF
286 asm/termios.h
287 syscall.h
288 syslimits.h
289 syslog.h
290 sys/ioctl.h
291 sys/socket.h
292 sys/time.h
293 wait.h
294 EOF
295
296 # This is to fix a missing c flag for backwards compat
297 for i in `find ${D}/usr/lib/perl5 -iname "Config.pm"`;do
298 sed -e "s:ccflags=':ccflags='-DPERL5 :" \
299 -e "s:cppflags=':cppflags='-DPERL5 :" \
300 ${i} > ${i}.new &&\
301 mv ${i}.new ${i} || die "Sed failed"
302 done
303
304 # A poor fix for the miniperl issues
305 dosed 's:./miniperl:/usr/bin/perl:' /usr/lib/perl5/${PV}/ExtUtils/xsubpp
306 fperms 0444 /usr/lib/perl5/${PV}/ExtUtils/xsubpp
307 dosed 's:./miniperl:/usr/bin/perl:' /usr/bin/xsubpp
308 fperms 0755 /usr/bin/xsubpp
309
310 ./perl installman \
311 --man1dir="${D}/usr/share/man/man1" --man1ext='1' \
312 --man3dir="${D}/usr/share/man/man3" --man3ext='3'
313
314 # This removes ${D} from Config.pm and .packlist
315 for i in `find ${D} -iname "Config.pm"` `find ${D} -iname ".packlist"`;do
316 einfo "Removing ${D} from ${i}..."
317 sed -e "s:${D}::" ${i} > ${i}.new &&\
318 mv ${i}.new ${i} || die "Sed failed"
319 done
320 fi
321
322 dodoc Changes* Artistic Copying README Todo* AUTHORS
323
324 if [ "${PN}" = "perl" ]
325 then
326 # HTML Documentation
327 # We expect errors, warnings, and such with the following.
328
329 dodir /usr/share/doc/${PF}/html
330 ./perl installhtml \
331 --podroot='.' \
332 --podpath='lib:ext:pod:vms' \
333 --recurse \
334 --htmldir="${D}/usr/share/doc/${PF}/html" \
335 --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
336 fi
337 }
338
339 pkg_postinst() {
340
341 # Make sure we do not have stale/invalid libperl.so 's ...
342 if [ -f "${ROOT}usr/$(get_libdir)/libperl$(get_libname)" -a ! -L "${ROOT}usr/$(get_libdir)/libperl$(get_libname)" ]
343 then
344 mv -f ${ROOT}usr/$(get_libdir)/libperl$(get_libname) ${ROOT}usr/$(get_libdir)/libperl$(get_libname).old
345 fi
346
347 # Next bit is to try and setup the /usr/lib/libperl.so symlink
348 # properly ...
349 local libnumber="`ls -1 ${ROOT}usr/$(get_libdir)/libperl$(get_libname ?.*) | grep -v '\.old' | wc -l`"
350 if [ "${libnumber}" -eq 1 ]
351 then
352 # Only this version of libperl is installed, so just link libperl.so
353 # to the *soname* version of it ...
354 ln -snf libperl$(get_libname ${PERLSLOT}) ${ROOT}usr/$(get_libdir)/libperl$(get_libname)
355 else
356 if [ -x "${ROOT}/usr/bin/perl" ]
357 then
358 # OK, we have more than one version .. first try to figure out
359 # if there are already a perl installed, if so, link libperl.so
360 # to that *soname* version of libperl.so ...
361 local perlversion="`${ROOT}/usr/bin/perl -V:version | cut -d\' -f2 | cut -d. -f1,2`"
362
363 cd ${ROOT}usr/$(get_libdir)
364 # Link libperl.so to the *soname* versioned lib ...
365 ln -snf `echo libperl$(get_libname ?.${perlversion}) | cut -d. -f1,2,3` libperl$(get_libname)
366 else
367 local x latest
368
369 # Nope, we are not so lucky ... try to figure out what version
370 # is the latest, and keep fingers crossed ...
371 for x in `ls -1 ${ROOT}usr/$(get_libdir)/libperl$(get_libname ?.*)`
372 do
373 latest="${x}"
374 done
375
376 cd ${ROOT}usr/$(get_libdir)
377 # Link libperl.so to the *soname* versioned lib ...
378 ln -snf `echo ${latest##*/} | cut -d. -f1,2,3` libperl$(get_libname)
379 fi
380 fi
381 }
382

  ViewVC Help
Powered by ViewVC 1.1.20