Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | # |
| 2 | # cpan-base providers various perl related information needed for building |
| 3 | # cpan modules |
| 4 | # |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 5 | FILES:${PN} += "${libdir}/perl5 ${datadir}/perl5" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 6 | |
| 7 | DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 8 | RDEPENDS:${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 9 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 10 | inherit perl-version |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 11 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 12 | def is_target(d): |
| 13 | if not bb.data.inherits_class('native', d): |
| 14 | return "yes" |
| 15 | return "no" |
| 16 | |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 17 | PERLLIBDIRS = "${libdir}/perl5" |
Patrick Williams | 213cb26 | 2021-08-07 19:21:33 -0500 | [diff] [blame] | 18 | PERLLIBDIRS:class-native = "${libdir}/perl5" |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 19 | |
| 20 | def cpan_upstream_check_pattern(d): |
| 21 | for x in (d.getVar('SRC_URI') or '').split(' '): |
| 22 | if x.startswith("https://cpan.metacpan.org"): |
Andrew Geissler | 5199d83 | 2021-09-24 16:47:35 -0500 | [diff] [blame^] | 23 | _pattern = x.split('/')[-1].replace(d.getVar('PV'), r'(?P<pver>\d+.\d+)') |
Andrew Geissler | c926e17 | 2021-05-07 16:11:35 -0500 | [diff] [blame] | 24 | return _pattern |
| 25 | return '' |
| 26 | |
| 27 | UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}" |