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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.23 - (show annotations) (download)
Mon Dec 5 16:08:50 2005 UTC (13 years, 10 months ago) by mcummings
Branch: MAIN
CVS Tags: HEAD
Changes since 1.22: +1 -1 lines
FILE REMOVED
Bug 113930, case statement for non-linux. Also cleaned out 5.8.5 versions since we don't have perl ebuilds for them either.
(Portage version: 2.0.53_rc6)

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

  ViewVC Help
Powered by ViewVC 1.1.20