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