Patrick Williams | 92b42cb | 2022-09-03 06:53:57 -0500 | [diff] [blame] | 1 | # |
| 2 | # Copyright OpenEmbedded Contributors |
| 3 | # |
| 4 | # SPDX-License-Identifier: MIT |
| 5 | # |
| 6 | |
| 7 | # |
| 8 | # cpan-base providers various perl related information needed for building |
| 9 | # cpan modules |
| 10 | # |
| 11 | FILES:${PN} += "${libdir}/perl5 ${datadir}/perl5" |
| 12 | |
| 13 | DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" |
| 14 | RDEPENDS:${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" |
| 15 | |
| 16 | inherit perl-version |
| 17 | |
| 18 | def is_target(d): |
| 19 | if not bb.data.inherits_class('native', d): |
| 20 | return "yes" |
| 21 | return "no" |
| 22 | |
| 23 | PERLLIBDIRS = "${libdir}/perl5" |
| 24 | PERLLIBDIRS:class-native = "${libdir}/perl5" |
| 25 | |
| 26 | def cpan_upstream_check_pattern(d): |
| 27 | for x in (d.getVar('SRC_URI') or '').split(' '): |
| 28 | if x.startswith("https://cpan.metacpan.org"): |
| 29 | _pattern = x.split('/')[-1].replace(d.getVar('PV'), r'(?P<pver>\d+.\d+)') |
| 30 | return _pattern |
| 31 | return '' |
| 32 | |
| 33 | UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}" |