perl_5.32.0.bb 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. SUMMARY = "Perl scripting language"
  2. HOMEPAGE = "http://www.perl.org/"
  3. SECTION = "devel"
  4. LICENSE = "Artistic-1.0 | GPL-1.0+"
  5. LIC_FILES_CHKSUM = "file://Copying;md5=5b122a36d0f6dc55279a0ebc69f3c60b \
  6. file://Artistic;md5=71a4d5d9acc18c0952a6df2218bb68da \
  7. "
  8. SRC_URI = "https://www.cpan.org/src/5.0/perl-${PV}.tar.gz;name=perl \
  9. https://github.com/arsv/perl-cross/releases/download/1.3.4/perl-cross-1.3.4.tar.gz;name=perl-cross \
  10. file://perl-rdepends.txt \
  11. file://0001-configure_tool.sh-do-not-quote-the-argument-to-comma.patch \
  12. file://0001-ExtUtils-MakeMaker-add-LDFLAGS-when-linking-binary-m.patch \
  13. file://0001-Somehow-this-module-breaks-through-the-perl-wrapper-.patch \
  14. file://errno_ver.diff \
  15. file://native-perlinc.patch \
  16. file://0001-perl-cross-add-LDFLAGS-when-linking-libperl.patch \
  17. file://perl-dynloader.patch \
  18. file://0001-configure_path.sh-do-not-hardcode-prefix-lib-as-libr.patch \
  19. file://0002-Constant-Fix-up-shebang.patch \
  20. file://determinism.patch \
  21. file://perl-cross-makefile.patch \
  22. "
  23. SRC_URI_append_class-native = " \
  24. file://perl-configpm-switch.patch \
  25. "
  26. SRC_URI_append_class-target = " \
  27. file://encodefix.patch \
  28. "
  29. SRC_URI[perl.sha256sum] = "efeb1ce1f10824190ad1cadbcccf6fdb8a5d37007d0100d2d9ae5f2b5900c0b4"
  30. SRC_URI[perl-cross.sha256sum] = "755aa0ca8141a942188a269564f86c3c82349f82c346ed5c992495d7f35138ba"
  31. S = "${WORKDIR}/perl-${PV}"
  32. inherit upstream-version-is-even update-alternatives
  33. DEPENDS += "zlib virtual/crypt"
  34. PERL_LIB_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}.0"
  35. PACKAGECONFIG ??= "bdb gdbm"
  36. PACKAGECONFIG[bdb] = ",-Ui_db,db"
  37. PACKAGECONFIG[gdbm] = ",-Ui_gdbm,gdbm"
  38. # Don't generate comments in enc2xs output files. They are not reproducible
  39. export ENC2XS_NO_COMMENTS = "1"
  40. do_unpack_append() {
  41. bb.build.exec_func('do_copy_perlcross', d)
  42. }
  43. do_copy_perlcross() {
  44. cp -rfp ${WORKDIR}/perl-cross*/* ${S}
  45. }
  46. do_configure_class-target() {
  47. ./configure --prefix=${prefix} --libdir=${libdir} \
  48. --target=${TARGET_SYS} \
  49. -Duseshrplib \
  50. -Dsoname=libperl.so.5 \
  51. -Dvendorprefix=${prefix} \
  52. -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
  53. ${PACKAGECONFIG_CONFARGS}
  54. #perl.c uses an ARCHLIB_EXP define to generate compile-time code that
  55. #adds the archlibexp path to @INC during run-time initialization of a
  56. #new perl interpreter.
  57. #Because we've changed this value in a temporary way to make it
  58. #possible to use ExtUtils::Embed in the target build (the temporary
  59. #value in config.sh gets re-stripped out during packaging), the
  60. #ARCHLIB_EXP value that gets generated still uses the temporary version
  61. #instead of the original expected version (i.e. becauses it's in the
  62. #generated config.h, it doesn't get stripped out during packaging like
  63. #the others in config.sh).
  64. sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
  65. }
  66. do_configure_class-nativesdk() {
  67. ./configure --prefix=${prefix} \
  68. --target=${TARGET_SYS} \
  69. -Duseshrplib \
  70. -Dsoname=libperl.so.5 \
  71. -Dvendorprefix=${prefix} \
  72. -Darchlibexp=${STAGING_LIBDIR}/perl5/${PV}/${TARGET_ARCH}-linux \
  73. ${PACKAGECONFIG_CONFARGS}
  74. # See the comment above
  75. sed -i -e "s,${STAGING_LIBDIR},${libdir},g" config.h
  76. }
  77. do_configure_class-native() {
  78. ./configure --prefix=${prefix} \
  79. -Dbin=${bindir}/perl-native \
  80. -Duseshrplib \
  81. -Dsoname=libperl.so.5 \
  82. -Dvendorprefix=${prefix} \
  83. -Ui_xlocale \
  84. ${PACKAGECONFIG_CONFARGS}
  85. }
  86. do_configure_append() {
  87. if [ -n "$SOURCE_DATE_EPOCH" ]; then
  88. PERL_BUILD_DATE="$(${PYTHON} -c "\
  89. from datetime import datetime, timezone; \
  90. print(datetime.fromtimestamp($SOURCE_DATE_EPOCH, timezone.utc).strftime('%a %b %d %H:%M:%S %Y')) \
  91. ")"
  92. echo "#define PERL_BUILD_DATE \"$PERL_BUILD_DATE\"" >> config.h
  93. fi
  94. }
  95. do_compile() {
  96. oe_runmake
  97. # This isn't generated reliably so delete and re-generate.
  98. # https://github.com/arsv/perl-cross/issues/86
  99. if [ -e pod/perltoc.pod ]; then
  100. bbnote Rebuilding perltoc.pod
  101. rm -f pod/perltoc.pod
  102. oe_runmake pod/perltoc.pod
  103. fi
  104. }
  105. do_install() {
  106. oe_runmake 'DESTDIR=${D}' install
  107. install -d ${D}${libdir}/perl5
  108. install -d ${D}${libdir}/perl5/${PV}/
  109. install -d ${D}${libdir}/perl5/${PV}/ExtUtils/
  110. # Save native config
  111. install config.sh ${D}${libdir}/perl5
  112. install lib/Config.pm ${D}${libdir}/perl5/${PV}/
  113. install lib/ExtUtils/typemap ${D}${libdir}/perl5/${PV}/ExtUtils/
  114. # Fix up shared library
  115. rm ${D}/${libdir}/perl5/${PV}/*/CORE/libperl.so
  116. ln -sf ../../../../libperl.so.${PERL_LIB_VER} $(echo ${D}/${libdir}/perl5/${PV}/*/CORE)/libperl.so
  117. # Try to catch Bug #13946
  118. if [ -e ${D}/${libdir}/perl5/${PV}/Storable.pm ]; then
  119. bbfatal 'non-arch specific Storable.pm found! See https://bugzilla.yoctoproject.org/show_bug.cgi?id=13946'
  120. fi
  121. }
  122. do_install_append_class-target() {
  123. # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
  124. ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
  125. # This contains host-specific information used for building miniperl (a helper executable built with host compiler)
  126. # and therefore isn't reproducible. I believe the file isn't actually needed on target.
  127. rm ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/xconfig.h
  128. }
  129. do_install_append_class-nativesdk() {
  130. # This is used to substitute target configuration when running native perl via perl-configpm-switch.patch
  131. ln -s Config_heavy.pl ${D}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy-target.pl
  132. create_wrapper ${D}${bindir}/perl \
  133. PERL5LIB='$PERL5LIB:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/site_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/vendor_perl/${PV}:${SDKPATHNATIVE}/${libdir_nativesdk}/perl5/${PV}'
  134. }
  135. do_install_append_class-native () {
  136. # Those wrappers mean that perl installed from sstate (which may change
  137. # path location) works and that in the nativesdk case, the SDK can be
  138. # installed to a different location from the one it was built for.
  139. create_wrapper ${D}${bindir}/perl-native/perl PERL5LIB='$PERL5LIB:${STAGING_LIBDIR}/perl5/site_perl/${PV}:${STAGING_LIBDIR}/perl5/vendor_perl/${PV}:${STAGING_LIBDIR}/perl5/${PV}'
  140. # Use /usr/bin/env nativeperl for the perl script.
  141. for f in `grep -Il '#! *${bindir}/perl' ${D}/${bindir}/*`; do
  142. sed -i -e 's|${bindir}/perl|/usr/bin/env nativeperl|' $f
  143. done
  144. }
  145. PACKAGE_PREPROCESS_FUNCS += "perl_package_preprocess"
  146. perl_package_preprocess () {
  147. # Fix up installed configuration
  148. sed -i -e "s,${D},,g" \
  149. -e "s,${DEBUG_PREFIX_MAP},,g" \
  150. -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
  151. -e "s,-isystem${STAGING_INCDIR} ,,g" \
  152. -e "s,${STAGING_LIBDIR},${libdir},g" \
  153. -e "s,${STAGING_BINDIR},${bindir},g" \
  154. -e "s,${STAGING_INCDIR},${includedir},g" \
  155. -e "s,${STAGING_BINDIR_NATIVE}/perl-native/,${bindir}/,g" \
  156. -e "s,${STAGING_BINDIR_NATIVE}/,,g" \
  157. -e "s,${STAGING_BINDIR_TOOLCHAIN}/${TARGET_PREFIX},${bindir},g" \
  158. -e 's:${RECIPE_SYSROOT}::g' \
  159. ${PKGD}${bindir}/h2xs.perl \
  160. ${PKGD}${bindir}/h2ph.perl \
  161. ${PKGD}${bindir}/pod2man.perl \
  162. ${PKGD}${bindir}/pod2text.perl \
  163. ${PKGD}${bindir}/pod2usage.perl \
  164. ${PKGD}${bindir}/podchecker.perl \
  165. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/config.h \
  166. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/perl.h \
  167. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/CORE/pp.h \
  168. ${PKGD}${libdir}/perl5/${PV}/Config.pm \
  169. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
  170. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pod \
  171. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_git.pl \
  172. ${PKGD}${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config_heavy.pl \
  173. ${PKGD}${libdir}/perl5/${PV}/ExtUtils/Liblist/Kid.pm \
  174. ${PKGD}${libdir}/perl5/${PV}/FileCache.pm \
  175. ${PKGD}${libdir}/perl5/${PV}/pod/*.pod \
  176. ${PKGD}${libdir}/perl5/config.sh
  177. }
  178. inherit update-alternatives
  179. ALTERNATIVE_PRIORITY = "100"
  180. ALTERNATIVE_${PN}-misc = "corelist cpan enc2xs encguess h2ph h2xs instmodsh json_pp libnetcfg \
  181. piconv pl2pm pod2html pod2man pod2text pod2usage podchecker \
  182. prove ptar ptardiff ptargrep shasum splain xsubpp zipdetails"
  183. ALTERNATIVE_LINK_NAME[corelist] = "${bindir}/corelist"
  184. ALTERNATIVE_LINK_NAME[cpan] = "${bindir}/cpan"
  185. ALTERNATIVE_LINK_NAME[enc2xs] = "${bindir}/enc2xs"
  186. ALTERNATIVE_LINK_NAME[encguess] = "${bindir}/encguess"
  187. ALTERNATIVE_LINK_NAME[h2ph] = "${bindir}/h2ph"
  188. ALTERNATIVE_LINK_NAME[h2xs] = "${bindir}/h2xs"
  189. ALTERNATIVE_LINK_NAME[instmodsh] = "${bindir}/instmodsh"
  190. ALTERNATIVE_LINK_NAME[json_pp] = "${bindir}/json_pp"
  191. ALTERNATIVE_LINK_NAME[libnetcfg] = "${bindir}/libnetcfg"
  192. ALTERNATIVE_LINK_NAME[piconv] = "${bindir}/piconv"
  193. ALTERNATIVE_LINK_NAME[pl2pm] = "${bindir}/pl2pm"
  194. ALTERNATIVE_LINK_NAME[pod2html] = "${bindir}/pod2html"
  195. ALTERNATIVE_LINK_NAME[pod2man] = "${bindir}/pod2man"
  196. ALTERNATIVE_LINK_NAME[pod2text] = "${bindir}/pod2text"
  197. ALTERNATIVE_LINK_NAME[pod2usage] = "${bindir}/pod2usage"
  198. ALTERNATIVE_LINK_NAME[podchecker] = "${bindir}/podchecker"
  199. ALTERNATIVE_LINK_NAME[prove] = "${bindir}/prove"
  200. ALTERNATIVE_LINK_NAME[ptar] = "${bindir}/ptar"
  201. ALTERNATIVE_LINK_NAME[ptardiff] = "${bindir}/ptardiff"
  202. ALTERNATIVE_LINK_NAME[ptargrep] = "${bindir}/ptargrep"
  203. ALTERNATIVE_LINK_NAME[shasum] = "${bindir}/shasum"
  204. ALTERNATIVE_LINK_NAME[splain] = "${bindir}/splain"
  205. ALTERNATIVE_LINK_NAME[xsubpp] = "${bindir}/xsubpp"
  206. ALTERNATIVE_LINK_NAME[zipdetails] = "${bindir}/zipdetails"
  207. require perl-ptest.inc
  208. FILES_${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/libperl.so* \
  209. ${libdir}/perl5/site_perl \
  210. ${libdir}/perl5/${PV}/Config.pm \
  211. ${libdir}/perl5/${PV}/${TARGET_ARCH}-linux/Config.pm \
  212. ${libdir}/perl5/${PV}/*/Config_git.pl \
  213. ${libdir}/perl5/${PV}/*/Config_heavy-target.pl \
  214. ${libdir}/perl5/config.sh \
  215. ${libdir}/perl5/${PV}/strict.pm \
  216. ${libdir}/perl5/${PV}/warnings.pm \
  217. ${libdir}/perl5/${PV}/warnings \
  218. ${libdir}/perl5/${PV}/vars.pm \
  219. ${libdir}/perl5/site_perl \
  220. ${libdir}/perl5/${PV}/ExtUtils/MANIFEST.SKIP \
  221. ${libdir}/perl5/${PV}/ExtUtils/xsubpp \
  222. ${libdir}/perl5/${PV}/ExtUtils/typemap \
  223. "
  224. RPROVIDES_${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
  225. perl-module-warnings-register"
  226. FILES_${PN}-staticdev_append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a"
  227. FILES_${PN}-dev_append = " ${libdir}/perl5/${PV}/*/CORE"
  228. FILES_${PN}-doc_append = " ${libdir}/perl5/${PV}/Unicode/Collate/*.txt \
  229. ${libdir}/perl5/${PV}/*/.packlist \
  230. ${libdir}/perl5/${PV}/Encode/encode.h \
  231. "
  232. PACKAGES += "${PN}-misc"
  233. FILES_${PN}-misc = "${bindir}/*"
  234. PACKAGES += "${PN}-pod"
  235. FILES_${PN}-pod = "${libdir}/perl5/${PV}/pod \
  236. ${libdir}/perl5/${PV}/*.pod \
  237. ${libdir}/perl5/${PV}/*/*.pod \
  238. ${libdir}/perl5/${PV}/*/*/*.pod \
  239. ${libdir}/perl5/${PV}/*/*/*/*.pod \
  240. "
  241. PACKAGES += "${PN}-module-cpan ${PN}-module-unicore"
  242. FILES_${PN}-module-cpan += "${libdir}/perl5/${PV}/CPAN \
  243. "
  244. FILES_${PN}-module-unicore += "${libdir}/perl5/${PV}/unicore"
  245. ALTERNATIVE_PRIORITY = "40"
  246. ALTERNATIVE_${PN}-doc = "Thread.3"
  247. ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
  248. # Create a perl-modules package recommending all the other perl
  249. # packages (actually the non modules packages and not created too)
  250. ALLOW_EMPTY_${PN}-modules = "1"
  251. PACKAGES += "${PN}-modules "
  252. PACKAGESPLITFUNCS_prepend = "split_perl_packages "
  253. python split_perl_packages () {
  254. libdir = d.expand('${libdir}/perl5/${PV}')
  255. do_split_packages(d, libdir, r'.*/auto/([^.]*)/[^/]*\.(so|ld|ix|al)', '${PN}-module-%s', 'perl module %s', recursive=True, match_path=True, prepend=False)
  256. do_split_packages(d, libdir, r'.*linux/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
  257. do_split_packages(d, libdir, r'Module/([^\/]*)\.pm', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
  258. do_split_packages(d, libdir, r'Module/([^\/]*)/.*', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
  259. do_split_packages(d, libdir, r'.*linux/([^\/].*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
  260. do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|.*linux\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
  261. # perl-modules should recommend every perl module, and only the
  262. # modules. Don't attempt to use the result of do_split_packages() as some
  263. # modules are manually split (eg. perl-module-unicore).
  264. packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split())
  265. d.setVar(d.expand("RRECOMMENDS_${PN}-modules"), ' '.join(packages))
  266. # Read the pre-generated dependency file, and use it to set module dependecies
  267. for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():
  268. splitline = line.split()
  269. if bb.data.inherits_class('native', d):
  270. module = splitline[0] + '-native'
  271. depends = "perl-native"
  272. else:
  273. module = splitline[0].replace("RDEPENDS_perl", "RDEPENDS_${PN}")
  274. depends = splitline[2].strip('"').replace("perl-module", "${PN}-module")
  275. d.appendVar(d.expand(module), " " + depends)
  276. }
  277. python() {
  278. if d.getVar('CLASSOVERRIDE') == "class-target":
  279. d.setVar("PACKAGES_DYNAMIC", "^${MLPREFIX}perl-module-.*(?<!native)$")
  280. elif d.getVar('CLASSOVERRIDE') == "class-native":
  281. d.setVar("PACKAGES_DYNAMIC", "^perl-module-.*-native$")
  282. elif d.getVar('CLASSOVERRIDE') == "class-nativesdk":
  283. d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*")
  284. }
  285. RDEPENDS_${PN}-misc += "perl perl-modules"
  286. RDEPENDS_${PN}-pod += "perl"
  287. BBCLASSEXTEND = "native nativesdk"
  288. SSTATE_SCAN_FILES += "*.pm *.pod *.h *.pl *.sh"
  289. do_create_rdepends_inc() {
  290. cd ${WORKDIR}
  291. cat <<'EOPREAMBLE' > ${WORKDIR}/perl-rdepends.inc
  292. # Some additional dependencies that the above doesn't manage to figure out
  293. RDEPENDS_${PN}-module-file-spec += "${PN}-module-file-spec-unix"
  294. RDEPENDS_${PN}-module-math-bigint += "${PN}-module-math-bigint-calc"
  295. RDEPENDS_${PN}-module-thread-queue += "${PN}-module-attributes"
  296. RDEPENDS_${PN}-module-overload += "${PN}-module-overloading"
  297. # Generated depends list beyond this line
  298. EOPREAMBLE
  299. test -e packages-split.new && rm -rf packages-split.new
  300. cp -r packages-split packages-split.new && cd packages-split.new
  301. find . -name \*.pm | xargs sed -i '/^=head/,/^=cut/d'
  302. egrep -r "^\s*(\<use .*|\<require .*);?" perl-module-* --include="*.pm" | \
  303. sed "s/\/.*\.pm: */ += /g;s/[\"\']//g;s/;.*/\"/g;s/+= .*\(require\|use\)\> */+= \"perl-module-/g;s/CPANPLUS::.*/cpanplus/g;s/CPAN::.*/cpan/g;s/::/-/g;s/ [^+\"].*//g;s/_/-/g;s/\.pl\"$/\"/;s/\"\?\$/\"/;s/(//;" | tr [:upper:] [:lower:] | \
  304. awk '{if ($3 != "\x22"$1"\x22"){ print $0}}'| \
  305. grep -v -e "\-vms\-" -e module-5 -e "^$" -e "\\$" -e your -e tk -e autoperl -e html -e http -e parse-cpan -e perl-ostype -e ndbm-file -e module-mac -e fcgi -e lwp -e dbd -e dbix | \
  306. sort -u | \
  307. sed 's/^/RDEPENDS_/;s/perl-module-/${PN}-module-/g;s/module-\(module-\)/\1/g;s/\(module-load\)-conditional/\1/g;s/encode-configlocal/&-pm/;' | \
  308. egrep -wv '=>|module-a|module-apache.?|module-apr|module-authen-sasl|module-b-asmdata|module-convert-ebcdic|module-devel-size|module-digest-perl-md5|module-dumpvalue|module-extutils-constant-aaargh56hash|module-extutils-xssymset|module-file-bsdglob|module-for|module-it|module-io-socket-inet6|module-io-socket-ssl|module-io-string|module-ipc-system-simple|module-lexical|module-local-lib|metadata|module-modperl-util|module-pluggable-object|module-test-builder-io-scalar|module-test2|module-text-unidecode|module-unicore|module-win32|objects\sload|syscall.ph|systeminfo.ph|%s' | \
  309. egrep -wv '=>|module-algorithm-diff|module-carp|module-c<extutils-mm-unix>|module-encode-hanextra|module-extutils-makemaker-version-regex|module-file-spec|module-io-compress-lzma|module-locale-maketext-lexicon|module-log-agent|module-meta-notation|module-net-localcfg|module-net-ping-external|module-b-deparse|module-scalar-util|module-some-module|module-symbol|module-uri|module-win32api-file' >> ${WORKDIR}/perl-rdepends.generated
  310. cp ${WORKDIR}/perl-rdepends.generated ${THISDIR}/files/perl-rdepends.txt
  311. }
  312. # bitbake perl -c create_rdepends_inc
  313. addtask do_create_rdepends_inc
  314. SYSROOT_PREPROCESS_FUNCS += "perl_sysroot_create_wrapper"
  315. perl_sysroot_create_wrapper () {
  316. mkdir -p ${SYSROOT_DESTDIR}${bindir}
  317. # Create a wrapper that /usr/bin/env perl will use to get perl-native.
  318. # This MUST live in the normal bindir.
  319. cat > ${SYSROOT_DESTDIR}${bindir}/nativeperl << EOF
  320. #!/bin/sh
  321. realpath=\`readlink -fn \$0\`
  322. exec \`dirname \$realpath\`/perl-native/perl "\$@"
  323. EOF
  324. chmod 0755 ${SYSROOT_DESTDIR}${bindir}/nativeperl
  325. cat ${SYSROOT_DESTDIR}${bindir}/nativeperl
  326. }