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

Contents of /sys-devel/libperl/libperl-5.8.1_rc2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Jan 18 06:46:05 2004 UTC (15 years, 9 months ago) by rac
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
5.8.3, housecleaning

1 # Copyright 1999-2003 Gentoo Technologies, Inc.
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /home/cvsroot/gentoo-x86/sys-devel/libperl/libperl-5.8.1_rc2.ebuild,v 1.2 2003/09/05 02:02:21 msterret 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
56 IUSE="berkdb gdbm"
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="`echo ${PV} | cut -d. -f1,2`"
69 MY_P="perl-`echo $PV | sed 's/_rc/-RC/'`"
70 S="${WORKDIR}/${MY_P}"
71 DESCRIPTION="Larry Wall's Practical Extraction and Reporting Language"
72 SRC_URI="http://www.cpan.org/authors/id/J/JH/JHI/${MY_P}.tar.gz"
73 HOMEPAGE="http://www.perl.org"
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 ~arm"
86
87 DEPEND="sys-apps/groff
88 berkdb? ( sys-libs/db )
89 gdbm? ( >=sys-libs/gdbm-1.8.0 )
90 >=sys-apps/portage-2.0.45-r4"
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* 'threads'
100 # in USE if it could break things ...
101 if [ -n "`use threads`" ]
102 then
103 ewarn ""
104 ewarn "PLEASE NOTE: You are compiling perl-5.8 with"
105 ewarn "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 sleep 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=threads 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 sleep 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
140 src_compile() {
141
142 export LC_ALL="C"
143 local myconf=""
144
145 if [ "`use threads`" ]
146 then
147 einfo "using threads"
148 mythreading="-multi"
149 myconf="-Dusethreads ${myconf}"
150 myarch="${CHOST%%-*}-linux-thread"
151 else
152 myarch="${CHOST%%-*}-linux"
153 fi
154
155 if [ "`use gdbm`" ]
156 then
157 myconf="${myconf} -Di_gdbm"
158 fi
159 if [ "`use berkdb`" ]
160 then
161 myconf="${myconf} -Di_db -Di_ndbm"
162 else
163 myconf="${myconf} -Ui_db -Ui_ndbm"
164 fi
165 if [ "`use mips`" ]
166 then
167 # this is needed because gcc 3.3-compiled kernels will hang
168 # the machine trying to run this test - check with `Kumba
169 # <rac@gentoo.org> 2003.06.26
170 myconf="${myconf} -Dd_u32align"
171 fi
172 if [ "`use sparc`" ]
173 then
174 myconf="${myconf} -Ud_longdbl"
175 fi
176 if [ "`use sparc64`" ]
177 then
178 myconf="${myconf} -Ud_longdbl"
179 fi
180
181 if [ "${PN}" = "libperl" ]
182 then
183 rm -f config.sh Policy.sh
184
185 sh Configure -des \
186 -Darchname="${myarch}" \
187 -Dcccdlflags='-fPIC' \
188 -Dccdlflags='-rdynamic' \
189 -Dcc="${CC:-gcc}" \
190 -Dprefix='/usr' \
191 -Dvendorprefix='/usr' \
192 -Dsiteprefix='/usr' \
193 -Dlocincpth=' ' \
194 -Doptimize="${CFLAGS}" \
195 -Duselargefiles \
196 -Duseshrplib \
197 -Dman3ext='3pm' \
198 -Dlibperl="${LIBPERL}" \
199 -Dd_dosuid \
200 -Dd_semctl_semun \
201 -Dcf_by='Gentoo' \
202 -Ud_csh \
203 ${myconf} || die
204
205 emake -f Makefile depend || die "Couldn't make libperl.so depends"
206 emake -f Makefile ${LIBPERL} || die "Unable to make libperl.so"
207 mv ${LIBPERL} ${WORKDIR}
208 else
209 cat > config.over <<EOF
210 installprefix=${D}/usr
211 installarchlib=\`echo \$installarchlib | sed "s!\$prefix!\$installprefix!"\`
212 installbin=\`echo \$installbin | sed "s!\$prefix!\$installprefix!"\`
213 installman1dir=\`echo \$installman1dir | sed "s!\$prefix!\$installprefix!"\`
214 installman3dir=\`echo \$installman3dir | sed "s!\$prefix!\$installprefix!"\`
215 installman1dir=\`echo \$installman1dir | sed "s!/share/share/!/share/!"\`
216 installman3dir=\`echo \$installman3dir | sed "s!/share/share/!/share/!"\`
217 installman1dir=\`echo \$installman1dir | sed "s!/usr/man/!/usr/share/man/!"\`
218 installman3dir=\`echo \$installman3dir | sed "s!/usr/man/!/usr/share/man/!"\`
219 man1ext=1
220 man3ext=3pm
221 installprivlib=\`echo \$installprivlib | sed "s!\$prefix!\$installprefix!"\`
222 installscript=\`echo \$installscript | sed "s!\$prefix!\$installprefix!"\`
223 installsitelib=\`echo \$installsitelib | sed "s!\$prefix!\$installprefix!"\`
224 installsitearch=\`echo \$installsitearch | sed "s!\$prefix!\$installprefix!"\`
225 EOF
226 sleep 10
227 sh Configure -des \
228 -Darchname="${myarch}" \
229 -Dcc="${CC:-gcc}" \
230 -Dprefix='/usr' \
231 -Dvendorprefix='/usr' \
232 -Dsiteprefix='/usr' \
233 -Dlocincpth=' ' \
234 -Doptimize="${CFLAGS}" \
235 -Duselargefiles \
236 -Dd_dosuid \
237 -Dd_semctl_semun \
238 -Dscriptdir=/usr/bin \
239 -Dman3ext='3pm' \
240 -Dcf_by='Gentoo' \
241 -Ud_csh \
242 ${myconf} || die "Unable to configure"
243
244 MAKEOPTS="${MAKEOPTS} -j1" emake || die "Unable to make"
245
246 emake -i test CCDLFLAGS=
247 fi
248 }
249
250 src_install() {
251
252 export LC_ALL="C"
253
254 if [ "${PN}" = "libperl" ]
255 then
256 dolib.so ${WORKDIR}/${LIBPERL}
257 preplib
258 else
259 # Need to do this, else apps do not link to dynamic version of
260 # the library ...
261 local coredir="/usr/lib/perl5/${PV}/${myarch}${mythreading}/CORE"
262 dodir ${coredir}
263 dosym ../../../../${LIBPERL} ${coredir}/${LIBPERL}
264 dosym ../../../../${LIBPERL} ${coredir}/libperl.so.${PERLSLOT}
265 dosym ../../../../${LIBPERL} ${coredir}/libperl.so
266
267 # Fix for "stupid" modules and programs
268 dodir /usr/lib/perl5/site_perl/${PV}/${myarch}${mythreading}
269
270 make DESTDIR="${D}" \
271 INSTALLMAN1DIR="${D}/usr/share/man/man1" \
272 INSTALLMAN3DIR="${D}/usr/share/man/man3" \
273 install || die "Unable to make install"
274
275 cp -f utils/h2ph utils/h2ph_patched
276 epatch ${FILESDIR}/perl-5.8.0-RC2-special-h2ph-not-failing-on-machine_ansi_header.patch
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
305 ./perl installman \
306 --man1dir="${D}/usr/share/man/man1" --man1ext='1' \
307 --man3dir="${D}/usr/share/man/man3" --man3ext='3'
308
309 # This removes ${D} from Config.pm and .packlist
310 for i in `find ${D} -iname "Config.pm"` `find ${D} -iname ".packlist"`;do
311 einfo "Removing ${D} from ${i}..."
312 sed -e "s:${D}::" ${i} > ${i}.new &&\
313 mv ${i}.new ${i} || die "Sed failed"
314 done
315 fi
316
317 dodoc Changes* Artistic Copying README Todo* AUTHORS
318
319 if [ "${PN}" = "perl" ]
320 then
321 # HTML Documentation
322 # We expect errors, warnings, and such with the following.
323
324 dodir /usr/share/doc/${PF}/html
325 ./perl installhtml \
326 --podroot='.' \
327 --podpath='lib:ext:pod:vms' \
328 --recurse \
329 --htmldir="${D}/usr/share/doc/${PF}/html" \
330 --libpods='perlfunc:perlguts:perlvar:perlrun:perlop'
331 fi
332 }
333
334 pkg_postinst() {
335
336 # Make sure we do not have stale/invalid libperl.so 's ...
337 if [ -f "${ROOT}usr/lib/libperl.so" -a ! -L "${ROOT}usr/lib/libperl.so" ]
338 then
339 mv -f ${ROOT}usr/lib/libperl.so ${ROOT}usr/lib/libperl.so.old
340 fi
341
342 # Next bit is to try and setup the /usr/lib/libperl.so symlink
343 # properly ...
344 local libnumber="`ls -1 ${ROOT}usr/lib/libperl.so.?.* | grep -v '\.old' | wc -l`"
345 if [ "${libnumber}" -eq 1 ]
346 then
347 # Only this version of libperl is installed, so just link libperl.so
348 # to the *soname* version of it ...
349 ln -snf libperl.so.${PERLSLOT} ${ROOT}usr/lib/libperl.so
350 else
351 if [ -x "${ROOT}/usr/bin/perl" ]
352 then
353 # OK, we have more than one version .. first try to figure out
354 # if there are already a perl installed, if so, link libperl.so
355 # to that *soname* version of libperl.so ...
356 local perlversion="`${ROOT}/usr/bin/perl -V:version | cut -d\' -f2 | cut -d. -f1,2`"
357
358 cd ${ROOT}usr/lib
359 # Link libperl.so to the *soname* versioned lib ...
360 ln -snf `echo libperl.so.?.${perlversion} | cut -d. -f1,2,3` libperl.so
361 else
362 local x latest
363
364 # Nope, we are not so lucky ... try to figure out what version
365 # is the latest, and keep fingers crossed ...
366 for x in `ls -1 ${ROOT}usr/lib/libperl.so.?.*`
367 do
368 latest="${x}"
369 done
370
371 cd ${ROOT}usr/lib
372 # Link libperl.so to the *soname* versioned lib ...
373 ln -snf `echo ${latest##*/} | cut -d. -f1,2,3` libperl.so
374 fi
375 fi
376 }
377
378

  ViewVC Help
Powered by ViewVC 1.1.20