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