summaryrefslogtreecommitdiffstats
path: root/meta/classes-recipe/cpan-base.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes-recipe/cpan-base.bbclass')
-rw-r--r--meta/classes-recipe/cpan-base.bbclass33
1 files changed, 33 insertions, 0 deletions
diff --git a/meta/classes-recipe/cpan-base.bbclass b/meta/classes-recipe/cpan-base.bbclass
new file mode 100644
index 0000000000..1db0a4ded6
--- /dev/null
+++ b/meta/classes-recipe/cpan-base.bbclass
@@ -0,0 +1,33 @@
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#
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)}"