1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

perl: Fix perl-module-* being ignored via COMPLEMENTARY_GLOB

When perl-modules is added via COMPLEMENTARY_GLOB, all perl-module-*
packages recommended by perl-modules are ignored due to the defined
behavior of COMPLEMENTARY_GLOB.

This patch changes the relationship between perl-modules and all of its
perl-module-* from RRECOMMENDS to RDEPENDS. This makes sense as
perl-modules should represent the collection of all optional
perl-module-* packages. After this patch, perl-modules itself is being
RRECOMMENDED instead of the individual perl-module-* packages
perl-modules represents.

(From OE-Core rev: 738fa7ee2dadf7b4b96fc1e86dbde106d3b86ec3)

Signed-off-by: William Lyu <William.Lyu@windriver.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
William Lyu
2024-01-24 08:32:34 -08:00
committed by Richard Purdie
parent b219e0c9ff
commit ba3a8dd470
+11 -8
View File
@@ -273,7 +273,7 @@ FILES:${PN} = "${bindir}/perl ${bindir}/perl.real ${bindir}/perl${PV} ${libdir}/
${libdir}/perl5/${PV}/ExtUtils/typemap \ ${libdir}/perl5/${PV}/ExtUtils/typemap \
" "
RPROVIDES:${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \ RPROVIDES:${PN} += "perl-module-strict perl-module-vars perl-module-config perl-module-warnings \
perl-module-warnings-register" perl-module-warnings-register perl-module-config-git"
FILES:${PN}-staticdev:append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a" FILES:${PN}-staticdev:append = " ${libdir}/perl5/${PV}/*/CORE/libperl.a"
@@ -306,8 +306,8 @@ ALTERNATIVE_PRIORITY = "40"
ALTERNATIVE:${PN}-doc = "Thread.3" ALTERNATIVE:${PN}-doc = "Thread.3"
ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3" ALTERNATIVE_LINK_NAME[Thread.3] = "${mandir}/man3/Thread.3"
# Create a perl-modules package recommending all the other perl # Create a perl-modules package that represents the collection of all the
# packages (actually the non modules packages and not created too) # other perl packages (actually the non modules packages and not created too).
ALLOW_EMPTY:${PN}-modules = "1" ALLOW_EMPTY:${PN}-modules = "1"
PACKAGES += "${PN}-modules " PACKAGES += "${PN}-modules "
@@ -322,11 +322,13 @@ python split_perl_packages () {
do_split_packages(d, libdir, r'.*linux/([^\/].*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) do_split_packages(d, libdir, r'.*linux/([^\/].*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|.*linux\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False) do_split_packages(d, libdir, r'(^(?!(CPAN\/|CPANPLUS\/|Module\/|unicore\/|.*linux\/)[^\/]).*)\.(pm|pl|e2x)', '${PN}-module-%s', 'perl module %s', recursive=True, allow_dirs=False, match_path=True, prepend=False)
# perl-modules should recommend every perl module, and only the # perl-modules should runtime-depend on every perl module, and only the
# modules. Don't attempt to use the result of do_split_packages() as some # modules. Don't attempt to use the result of do_split_packages() as some
# modules are manually split (eg. perl-module-unicore). # modules are manually split (eg. perl-module-unicore). Also, the split
packages = filter(lambda p: 'perl-module-' in p, d.getVar('PACKAGES').split()) # packages should not include packages defined in RPROVIDES:${PN}.
d.setVar(d.expand("RRECOMMENDS:${PN}-modules"), ' '.join(packages)) perl_sub_pkgs = d.getVar(d.expand("RPROVIDES:${PN}")).split()
packages = filter(lambda p: 'perl-module-' in p and p not in perl_sub_pkgs, d.getVar('PACKAGES').split())
d.setVar(d.expand("RDEPENDS:${PN}-modules"), ' '.join(packages))
# Read the pre-generated dependency file, and use it to set module dependecies # Read the pre-generated dependency file, and use it to set module dependecies
for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines(): for line in open(d.expand("${WORKDIR}") + '/perl-rdepends.txt').readlines():
@@ -352,7 +354,8 @@ python() {
d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*") d.setVar("PACKAGES_DYNAMIC", "^nativesdk-perl-module-.*")
} }
RDEPENDS:${PN}-misc += "perl perl-modules" RDEPENDS:${PN}-misc += "perl"
RRECOMMENDS:${PN}-misc += "perl-modules"
RDEPENDS:${PN}-pod += "perl" RDEPENDS:${PN}-pod += "perl"
BBCLASSEXTEND = "native nativesdk" BBCLASSEXTEND = "native nativesdk"