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