Updated some recipes
[openembedded.git] / recipes / perl / perl_5.8.8.bb
1 DESCRIPTION = "Perl is a popular scripting language."
2 HOMEPAGE = "http://www.perl.org/"
3 SECTION = "devel/perl"
4 LICENSE = "Artistic|GPL"
5 PRIORITY = "optional"
6 # We need gnugrep (for -I)
7 DEPENDS = "virtual/db perl-native grep-native"
8 PR = "r34"
9
10 # Major part of version
11 PVM = "5.8"
12
13 SRC_URI[perl588targz.md5sum] = "b8c118d4360846829beb30b02a6b91a7"
14 SRC_URI[perl588targz.sha256sum] = "e15d499321e003d12ed183601e37ee7ba5f64b278d1de30149ce01bd4a3f234d"
15
16 SRC_URI = "http://ftp.funet.fi/pub/CPAN/src/5.0/perl-5.8.8.tar.gz;name=perl588targz \
17         file://Makefile.patch \
18         file://Makefile.SH.patch \
19         file://makedepend-dash.patch \
20         file://installperl.patch \
21         file://perl-dynloader.patch \
22         file://perl-moreconfig.patch \
23         file://letgcc-find-errno.patch \
24         file://generate-sh.patch \
25         file://perl-5.8.8-gcc-4.2.patch \
26         file://09_fix_installperl.patch \
27         file://52_debian_extutils_hacks.patch \
28         file://53_debian_mod_paths.patch \
29         file://54_debian_perldoc-r.patch \
30         file://58_debian_cpan_config_path.patch \
31         file://60_debian_libnet_config_path.patch \
32         file://62_debian_cpan_definstalldirs.patch \
33         file://64_debian_enc2xs_inc.patch \
34         file://asm-pageh-fix.patch \
35         file://shared-ldflags.patch \
36         file://config.sh \
37         file://config.sh-32 \
38         file://config.sh-32-le \
39         file://config.sh-32-be \
40         file://config.sh-64 \
41         file://config.sh-64-le \
42         file://config.sh-64-be"
43
44 inherit siteinfo
45
46 # Where to find the native perl
47 HOSTPERL = "${STAGING_BINDIR_NATIVE}/perl${PV}"
48
49 # Where to find .so files - use the -native versions not those from the target build
50 export PERLHOSTLIB = "${STAGING_LIBDIR_NATIVE}/perl/${PV}/"
51
52 # LDFLAGS for shared libraries
53 export LDDLFLAGS = "${LDFLAGS} -shared"
54
55 do_configure() {
56         # Make hostperl in build directory be the native perl
57         ln -sf ${HOSTPERL} hostperl
58
59         # Do out work in the cross subdir
60         cd Cross
61
62         # Generate configuration
63         rm -f config.sh-${TARGET_ARCH}-${TARGET_OS}
64         for i in ${WORKDIR}/config.sh \
65                  ${WORKDIR}/config.sh-${@siteinfo_get_bits(d)} \
66                  ${WORKDIR}/config.sh-${@siteinfo_get_bits(d)}-${@siteinfo_get_endianess(d)}; do
67             cat $i >> config.sh-${TARGET_ARCH}-${TARGET_OS}
68         done
69
70         # Fixups for uclibc
71         if [ "${TARGET_OS}" = "linux-uclibc" -o "${TARGET_OS}" = "linux-uclibceabi" ]; then
72                 sed -i -e "s,\(d_crypt_r=\)'define',\1'undef',g" \
73                        -e "s,\(d_futimes=\)'define',\1'undef',g" \
74                        -e "s,\(crypt_r_proto=\)'\w+',\1'0',g" \
75                        -e "s,\(d_getnetbyname_r=\)'define',\1'undef',g" \
76                        -e "s,\(getnetbyname_r_proto=\)'\w+',\1'0',g" \
77                        -e "s,\(d_getnetbyaddr_r=\)'define',\1'undef',g" \
78                        -e "s,\(getnetbyaddr_r_proto=\)'\w+',\1'0',g" \
79                        -e "s,\(d_getnetent_r=\)'define',\1'undef',g" \
80                        -e "s,\(getnetent_r_proto=\)'\w+',\1'0',g" \
81                        -e "s,\(d_sockatmark=\)'define',\1'undef',g" \
82                        -e "s,\(d_sockatmarkproto=\)'\w+',\1'0',g" \
83                     config.sh-${TARGET_ARCH}-${TARGET_OS}
84         fi
85
86         # Update some paths in the configuration
87         sed -i -e 's,@DESTDIR@,${D},g' \
88                -e 's,@ARCH@,${TARGET_ARCH}-${TARGET_OS},g' \
89                -e "s%/usr/include/%${STAGING_INCDIR}/%g" \
90                -e 's,/usr/,${exec_prefix}/,g' \
91             config.sh-${TARGET_ARCH}-${TARGET_OS}
92
93         if test "${MACHINE}" != "native"; then
94             # These are strewn all over the source tree
95             for foo in `grep -I -m1 \/usr\/include\/.*\\.h ${WORKDIR}/* -r | cut -f 1 -d ":"` ; do
96                 echo Fixing: $foo
97                 sed -e "s%/usr/include/%${STAGING_INCDIR}/%g" -i $foo
98             done
99         fi
100
101         rm -f config
102         echo "ARCH = ${TARGET_ARCH}" > config
103         echo "OS = ${TARGET_OS}" >> config
104 }
105 do_compile() {
106         if test "${MACHINE}" != "native"; then
107             sed -i -e 's|/usr/include|${STAGING_INCDIR}|g' \
108                    -e 's|$Config{cppflags}||' ext/Errno/Errno_pm.PL
109         fi
110         cd Cross
111         oe_runmake perl LD="${TARGET_SYS}-gcc"
112 }
113 do_install() {
114         oe_runmake install
115         # Add perl pointing at current version
116         ln -sf perl${PV} ${D}${bindir}/perl
117
118         # Fix up versioned directories
119         mv ${D}/${libdir}/perl/${PVM} ${D}/${libdir}/perl/${PV}
120         mv ${D}/${datadir}/perl/${PVM} ${D}/${datadir}/perl/${PV}
121         ln -sf ${PV} ${D}/${libdir}/perl/${PVM}
122         ln -sf ${PV} ${D}/${datadir}/perl/${PVM}
123
124         # Remove unwanted file
125         rm -f ${D}/${libdir}/perl/${PV}/.packlist
126
127         # Fix up shared library
128         mv -f ${D}/${libdir}/perl/${PV}/CORE/libperl.so ${D}/${libdir}/libperl.so.${PV}
129         ln -sf libperl.so.${PV} ${D}/${libdir}/libperl.so.5
130
131         # Fix up installed configuration
132         if test "${MACHINE}" != "native"; then
133             sed -i -e "s,${D},,g" \
134                    -e "s,-isystem${STAGING_INCDIR} ,,g" \
135                    -e "s,${STAGING_LIBDIR},${libdir},g" \
136                    -e "s,${STAGING_BINDIR},${bindir},g" \
137                    -e "s,${STAGING_INCDIR},${includedir},g" \
138                    -e "s,${CROSS_DIR}${base_bindir}/,,g" \
139                 ${D}${bindir}/h2xs \
140                 ${D}${bindir}/h2ph \
141                 ${D}${datadir}/perl/${PV}/pod/*.pod \
142                 ${D}${datadir}/perl/${PV}/cacheout.pl \
143                 ${D}${datadir}/perl/${PV}/FileCache.pm \
144                 ${D}${libdir}/perl/${PV}/Config.pm \
145                 ${D}${libdir}/perl/${PV}/Config_heavy.pl \
146                 ${D}${libdir}/perl/${PV}/CORE/perl.h \
147                 ${D}${libdir}/perl/${PV}/CORE/pp.h
148         fi
149 }
150 do_stage() {
151         install -d ${STAGING_LIBDIR_NATIVE}/perl/${PV} \
152                    ${STAGING_LIBDIR}/perl/${PV}/CORE \
153                    ${STAGING_DATADIR}/perl/${PV}/ExtUtils
154         # target config, used by cpan.bbclass to extract version information
155         install config.sh ${STAGING_LIBDIR}/perl/
156         # target configuration, used by native perl when cross-compiling
157         install lib/Config_heavy.pl ${STAGING_LIBDIR_NATIVE}/perl/${PV}/Config_heavy-target.pl
158         # target configuration
159         install lib/Config.pm       ${STAGING_LIBDIR}/perl/${PV}/
160         install lib/ExtUtils/typemap ${STAGING_DATADIR}/perl/${PV}/ExtUtils/
161         # perl shared library headers
162         for i in av.h embed.h gv.h keywords.h op.h perlio.h pp.h regexp.h \
163                  uconfig.h XSUB.h cc_runtime.h embedvar.h handy.h opnames.h \
164                  perliol.h pp_proto.h regnodes.h unixish.h config.h EXTERN.h \
165                  hv.h malloc_ctl.h pad.h perlsdio.h proto.h scope.h utf8.h \
166                  cop.h fakesdio.h INTERN.h mg.h patchlevel.h perlsfio.h \
167                  reentr.h sv.h utfebcdic.h cv.h fakethr.h intrpvar.h \
168                  nostdio.h perlapi.h perlvars.h reentr.inc thrdvar.h util.h \
169                  dosish.h form.h iperlsys.h opcode.h perl.h perly.h regcomp.h \
170                  thread.h warnings.h; do
171             install $i ${STAGING_LIBDIR}/perl/${PV}/CORE
172         done
173 }
174
175 PACKAGES = "perl-dbg perl perl-misc perl-lib perl-dev perl-pod perl-doc"
176 FILES_${PN} = "${bindir}/perl ${bindir}/perl${PV}"
177 FILES_${PN}-lib = "${libdir}/libperl.so* ${libdir}/perl/${PVM} ${datadir}/perl/${PVM}"
178 FILES_${PN}-dev = "${libdir}/perl/${PV}/CORE"
179 FILES_${PN}-pod = "${datadir}/perl/${PV}/pod \
180                    ${datadir}/perl/${PV}/*/*.pod \
181                    ${datadir}/perl/${PV}/*/*/*.pod \
182                    ${libdir}/perl/${PV}/*.pod"
183 FILES_perl-misc = "${bindir}/*"
184 FILES_${PN}-dbg += "${libdir}/perl/${PV}/auto/*/.debug \
185                     ${libdir}/perl/${PV}/auto/*/*/.debug \
186                     ${libdir}/perl/${PV}/auto/*/*/*/.debug \
187                     ${datadir}/perl/${PV}/auto/*/.debug \
188                     ${datadir}/perl/${PV}/auto/*/*/.debug \
189                     ${datadir}/perl/${PV}/auto/*/*/*/.debug \
190                     ${libdir}/perl/${PV}/CORE/.debug"
191 FILES_${PN}-doc = "${datadir}/perl/${PV}/*/*.txt \
192                    ${datadir}/perl/${PV}/*/*/*.txt \
193                    ${datadir}/perl/${PV}/Net/*.eg \
194                    ${datadir}/perl/${PV}/CGI/eg \
195                    ${datadir}/perl/${PV}/ExtUtils/PATCHING \
196                    ${datadir}/perl/${PV}/ExtUtils/NOTES \
197                    ${datadir}/perl/${PV}/ExtUtils/typemap \
198                    ${datadir}/perl/${PV}/ExtUtils/MANIFEST.SKIP \
199                    ${datadir}/perl/${PV}/CPAN/SIGNATURE \
200                    ${datadir}/perl/${PV}/CPAN/PAUSE2003.pub \
201                    ${datadir}/perl/${PV}/B/assemble \
202                    ${datadir}/perl/${PV}/B/makeliblinks \
203                    ${datadir}/perl/${PV}/B/disassemble \
204                    ${datadir}/perl/${PV}/B/cc_harness \
205                    ${datadir}/perl/${PV}/ExtUtils/xsubpp \
206                    ${datadir}/perl/${PV}/Encode/encode.h \
207                    ${datadir}/perl/${PV}/unicore/mktables \
208                    ${datadir}/perl/${PV}/unicore/mktables.lst \
209                    ${datadir}/perl/${PV}/unicore/version"
210
211 RPROVIDES_perl-lib = "perl-lib"
212
213 # Create a perl-modules package recommending all the other perl
214 # packages (actually the non modules packages and not created too)
215 ALLOW_EMPTY_perl-modules = "1"
216 PACKAGES_append = " perl-modules "
217 RRECOMMENDS_perl-modules = "${@bb.data.getVar('PACKAGES', d, 1).replace('perl-modules ', '').replace('perl-dbg ', '').replace('perl-misc ', '').replace('perl-dev ', '').replace('perl-pod ', '').replace('perl-doc ', '')}"
218
219 python populate_packages_prepend () {
220         libdir = bb.data.expand('${libdir}/perl/${PV}', d)
221         do_split_packages(d, libdir, 'auto/(.*)(?!\.debug)/', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True)
222         do_split_packages(d, libdir, '(.*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True)
223         datadir = bb.data.expand('${datadir}/perl/${PV}', d)
224         do_split_packages(d, datadir, 'auto/(.*)(?!\.debug)/', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True)
225         do_split_packages(d, datadir, '(.*)\.(pm|pl|e2x)', 'perl-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True)
226 }
227
228 PACKAGES_DYNAMIC = "perl-module-*"
229
230 require perl-rdepends_${PV}.inc
231 require perl-rprovides.inc
232
233 PARALLEL_MAKE = ""