blob: 1db0a4ded62be9ee986f3874cb8df0efc85093d5 [file] [log] [blame]
Patrick Williams92b42cb2022-09-03 06:53:57 -05001#
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#
11FILES:${PN} += "${libdir}/perl5 ${datadir}/perl5"
12
13DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}"
14RDEPENDS:${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}"
15
16inherit perl-version
17
18def is_target(d):
19 if not bb.data.inherits_class('native', d):
20 return "yes"
21 return "no"
22
23PERLLIBDIRS = "${libdir}/perl5"
24PERLLIBDIRS:class-native = "${libdir}/perl5"
25
26def 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
33UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}"