blob: 1fc3f0bcb03234e97d4f1364602a579ae5941bef [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#
Brad Bishop19323692019-04-05 15:28:33 -04005FILES_${PN} += "${libdir}/perl5 ${datadir}/perl5"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05006
7DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
8RDEPENDS_${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
9
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"
18PERLLIBDIRS_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)}"