blob: 9758065bfcb0dd612f96b153e0fcd58069c79ae9 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001#
2# cpan-base providers various perl related information needed for building
3# cpan modules
4#
Patrick Williams213cb262021-08-07 19:21:33 -05005FILES:${PN} += "${libdir}/perl5 ${datadir}/perl5"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
Patrick Williams213cb262021-08-07 19:21:33 -05008RDEPENDS:${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05009
Brad Bishop6e60e8b2018-02-01 10:27:11 -050010inherit perl-version
Patrick Williamsc124f4f2015-09-15 14:41:29 -050011
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012def is_target(d):
13 if not bb.data.inherits_class('native', d):
14 return "yes"
15 return "no"
16
Brad Bishop19323692019-04-05 15:28:33 -040017PERLLIBDIRS = "${libdir}/perl5"
Patrick Williams213cb262021-08-07 19:21:33 -050018PERLLIBDIRS:class-native = "${libdir}/perl5"
Andrew Geisslerc926e172021-05-07 16:11:35 -050019
20def cpan_upstream_check_pattern(d):
21 for x in (d.getVar('SRC_URI') or '').split(' '):
22 if x.startswith("https://cpan.metacpan.org"):
23 _pattern = x.split('/')[-1].replace(d.getVar('PV'), '(?P<pver>\d+.\d+)')
24 return _pattern
25 return ''
26
27UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}"