diff options
Diffstat (limited to 'meta/classes-recipe/cpan-base.bbclass')
-rw-r--r-- | meta/classes-recipe/cpan-base.bbclass | 33 |
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 | # | ||
11 | FILES:${PN} += "${libdir}/perl5 ${datadir}/perl5" | ||
12 | |||
13 | DEPENDS += "${@["perl", "perl-native"][(bb.data.inherits_class('native', d))]}" | ||
14 | RDEPENDS:${PN} += "${@["perl", ""][(bb.data.inherits_class('native', d))]}" | ||
15 | |||
16 | inherit perl-version | ||
17 | |||
18 | def is_target(d): | ||
19 | if not bb.data.inherits_class('native', d): | ||
20 | return "yes" | ||
21 | return "no" | ||
22 | |||
23 | PERLLIBDIRS = "${libdir}/perl5" | ||
24 | PERLLIBDIRS:class-native = "${libdir}/perl5" | ||
25 | |||
26 | def 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 | |||
33 | UPSTREAM_CHECK_REGEX ?= "${@cpan_upstream_check_pattern(d)}" | ||