From: Tim Orling <tim.orling@konsulko.com>
To: openembedded-core@lists.openembedded.org
Cc: Tim Orling <tim.orling@konsulko.com>
Subject: [PATCH 1/5] perl-generators-native: add recipe for 1.16
Date: Sun, 29 Nov 2026 17:13:57 -0800 [thread overview]
Message-ID: <20261130011401.68860-2-tim.orling@konsulko.com> (raw)
In-Reply-To: <20261130011401.68860-1-tim.orling@konsulko.com>
rpm 4.20 dropped its perl.prov/perl.req generators, so pkgdata lost the
perl(Module::Name) FILERPROVIDES mapping Perl modules to packages. Add
Fedora's generators, which now maintain those scripts, to restore them.
Only provides are enabled, as before rpm 4.20: generated requires
include optional dependencies which package_rpm would turn into hard
Requires. perl.req is still installed for later dependency checking,
patched to work without Fedora::VSP and to optionally report indented
"require" statements (PERL_REQ_INDENTED_REQUIRE), which in perl itself
are mostly lazy loads. The scripts run with the host perl.
AI-Generated: Uses Claude Code (Claude Opus 5.5)
Signed-off-by: Tim Orling <tim.orling@konsulko.com>
---
meta/conf/distro/include/maintainers.inc | 1 +
.../rpm/perl-generators-native_1.16.bb | 38 +++++++++++++++++
...01-perl.req-make-Fedora-VSP-optional.patch | 42 +++++++++++++++++++
...q-optionally-report-indented-require.patch | 34 +++++++++++++++
4 files changed, 115 insertions(+)
create mode 100644 meta/recipes-devtools/rpm/perl-generators-native_1.16.bb
create mode 100644 meta/recipes-devtools/rpm/perl-generators/0001-perl.req-make-Fedora-VSP-optional.patch
create mode 100644 meta/recipes-devtools/rpm/perl-generators/0002-perl.req-optionally-report-indented-require.patch
diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 62de04001e..446b48291c 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -598,6 +598,7 @@ RECIPE_MAINTAINER:pn-pciutils = "Ajay Mahajan <ajay.mahajan@windriver.com>"
RECIPE_MAINTAINER:pn-pcmanfm = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-perf = "Bruce Ashfield <bruce.ashfield@gmail.com>"
RECIPE_MAINTAINER:pn-perl = "Unassigned <unassigned@yoctoproject.org>"
+RECIPE_MAINTAINER:pn-perl-generators-native = "Tim Orling <tim.orling@konsulko.com>"
RECIPE_MAINTAINER:pn-perlcross = "Unassigned <unassigned@yoctoproject.org>"
RECIPE_MAINTAINER:pn-picolibc = "Alejandro Hernandez <alejandro@enedino.org>"
RECIPE_MAINTAINER:pn-picolibc-helloworld = "Alejandro Hernandez <alejandro@enedino.org>"
diff --git a/meta/recipes-devtools/rpm/perl-generators-native_1.16.bb b/meta/recipes-devtools/rpm/perl-generators-native_1.16.bb
new file mode 100644
index 0000000000..f00aabe362
--- /dev/null
+++ b/meta/recipes-devtools/rpm/perl-generators-native_1.16.bb
@@ -0,0 +1,38 @@
+SUMMARY = "RPM Perl dependency generators"
+DESCRIPTION = "perl.prov and perl.req scripts, and rpm fileattrs, which \
+generate perl(Module::Name) Provides and Requires for Perl modules and \
+scripts. These were part of rpm until 4.20 and are now maintained \
+separately by Fedora."
+HOMEPAGE = "https://github.com/jplesnik/generators"
+SECTION = "devel"
+LICENSE = "GPL-1.0-or-later"
+LIC_FILES_CHKSUM = "file://template/bin/perl.req;beginline=3;endline=5;md5=7e481c192a18a8dbf8ed22f568489e1e"
+
+SRC_URI = "https://jplesnik.fedorapeople.org/generators/generators-${PV}.tar.gz \
+ file://0001-perl.req-make-Fedora-VSP-optional.patch \
+ file://0002-perl.req-optionally-report-indented-require.patch \
+ "
+SRC_URI[sha256sum] = "36cf8c16ec969826217ff7458535a29714cb471dadba1672a303034d029a6e64"
+
+S = "${UNPACKDIR}/generators-${PV}"
+
+inherit native
+
+# Scripts only, run with the host perl (HOSTTOOLS)
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+do_install() {
+ install -d ${D}${libdir}/rpm/fileattrs
+ for f in perl.prov perl.req; do
+ sed -e 's/__PERL_NS__/perl/' -e 's/__PERL_SUFFIX__//' \
+ -e '1s|^#!/usr/bin/perl|#!/usr/bin/env perl|' \
+ ${S}/template/bin/$f > ${D}${libdir}/rpm/$f
+ chmod 0755 ${D}${libdir}/rpm/$f
+ done
+
+ # Provides only: generated Requires include optional dependencies, which
+ # would become hard rpm Requires via FILERDEPENDS
+ sed -e 's/__PERL_SUFFIX__//' -e '/__perllib_requires/d' \
+ ${S}/template/fileattrs/perllib.attr > ${D}${libdir}/rpm/fileattrs/perllib.attr
+}
diff --git a/meta/recipes-devtools/rpm/perl-generators/0001-perl.req-make-Fedora-VSP-optional.patch b/meta/recipes-devtools/rpm/perl-generators/0001-perl.req-make-Fedora-VSP-optional.patch
new file mode 100644
index 0000000000..ef259cd60e
--- /dev/null
+++ b/meta/recipes-devtools/rpm/perl-generators/0001-perl.req-make-Fedora-VSP-optional.patch
@@ -0,0 +1,42 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+Date: Fri, 27 Nov 2026 00:00:00 -0800
+Subject: [PATCH] perl.req: make Fedora::VSP optional
+
+Fedora::VSP only normalizes "use 5.010" style perl version requirements,
+which OE strips anyway (filedeprunner in meta/lib/oe/package.py). Load
+it only if available and otherwise skip the perl version requirement, to
+avoid carrying a recipe for it.
+
+This patch was generated with the help of an AI tool (Claude Code).
+
+Upstream-Status: Inappropriate [OE-specific: avoids Fedora::VSP dependency]
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ template/bin/perl.req | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/template/bin/perl.req b/template/bin/perl.req
+index 67a4f7a..eeed626 100755
+--- a/template/bin/perl.req
++++ b/template/bin/perl.req
+@@ -24,7 +24,8 @@ my $perl_ns = "__PERL_NS__";
+
+ $HAVE_VERSION = 0;
+ eval { require version; $HAVE_VERSION = 1; };
+-use Fedora::VSP ();
++$HAVE_VSP = 0;
++eval { require Fedora::VSP; $HAVE_VSP = 1; };
+
+ use File::Basename;
+ my $dir = dirname($0);
+@@ -335,6 +336,9 @@ sub process_file {
+ # if module is a number then both require and use interpret that
+ # to mean that a particular version of perl is specified
+
++ # Without Fedora::VSP the version cannot be normalized; drop the
++ # perl version requirement rather than treating it as a module.
++ $HAVE_VSP || next;
+ my $rpm_ver = Fedora::VSP::vsp($1);
+ if (defined $rpm_ver) {
+ add_perlreq("$rpm_ver");
diff --git a/meta/recipes-devtools/rpm/perl-generators/0002-perl.req-optionally-report-indented-require.patch b/meta/recipes-devtools/rpm/perl-generators/0002-perl.req-optionally-report-indented-require.patch
new file mode 100644
index 0000000000..e6836104d3
--- /dev/null
+++ b/meta/recipes-devtools/rpm/perl-generators/0002-perl.req-optionally-report-indented-require.patch
@@ -0,0 +1,34 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Tim Orling <tim.orling@konsulko.com>
+Date: Fri, 27 Nov 2026 00:00:00 -0800
+Subject: [PATCH] perl.req: optionally report indented require
+
+perl.req skips indented "require" statements as optional, but in perl's
+own modules they are mostly lazy loads needed at runtime (e.g. IO::File
+requiring Fcntl). Report them when PERL_REQ_INDENTED_REQUIRE is set.
+
+This patch was generated with the help of an AI tool (Claude Code).
+
+Upstream-Status: Inappropriate [OE-specific: used to generate perl-rdepends.txt]
+Signed-off-by: Tim Orling <tim.orling@konsulko.com>
+---
+ template/bin/perl.req | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/template/bin/perl.req b/template/bin/perl.req
+index eeed626..20f8c19 100755
+--- a/template/bin/perl.req
++++ b/template/bin/perl.req
+@@ -280,9 +280,10 @@ sub process_file {
+ # we only consider require statements that are flushed against
+ # the left edge. any other require statements give too many
+ # false positives, as they are usually inside of an if statement
+- # as a fallback module or a rarely used option
++ # as a fallback module or a rarely used option. Setting
++ # PERL_REQ_INDENTED_REQUIRE reports them anyway (for lazy loads).
+
+- ($whitespace ne "" && $statement eq "require") && next;
++ ($whitespace ne "" && $statement eq "require" && !$ENV{PERL_REQ_INDENTED_REQUIRE}) && next;
+
+ # if there is some interpolation of variables just skip this
+ # dependency, we do not want
--
2.56.1
next prev parent reply other threads:[~2026-11-30 1:14 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 1:13 [PATCH 0/5] perl: generate module dependencies with perl.req Tim Orling
2026-11-30 1:13 ` Tim Orling [this message]
2026-11-30 1:13 ` [PATCH 2/5] classes/package: add perl-generators-native to PACKAGE_DEPENDS Tim Orling
2026-11-30 1:13 ` [PATCH 3/5] classes/insane: add perl-rdeps QA check Tim Orling
2026-11-30 1:14 ` [PATCH 4/5] perl: do not install unicore/TestNorm.pl Tim Orling
2026-11-30 1:14 ` [PATCH 5/5] perl: generate perl-rdepends.txt with perl.req Tim Orling
2026-11-30 10:08 ` [OE-core] " Mathieu Dubois-Briand
2026-11-30 13:50 ` [OE-core] [PATCH 0/5] perl: generate module dependencies " Mathieu Dubois-Briand
2026-11-30 17:18 ` [PATCH v2 0/8] " Tim Orling
2026-11-30 17:18 ` [PATCH v2 1/8] perl-generators-native: add recipe for 1.16 Tim Orling
2026-11-30 17:18 ` [PATCH v2 2/8] classes/package_rpm: disable rpmbuild's perllib provides generator Tim Orling
2026-11-30 17:18 ` [PATCH v2 3/8] classes/package: add perl-generators-native to PACKAGE_DEPENDS Tim Orling
2026-11-30 17:18 ` [PATCH v2 4/8] classes/insane: add perl-rdeps QA check Tim Orling
2026-11-30 17:18 ` [PATCH v2 5/8] perl: do not install unicore/TestNorm.pl Tim Orling
2026-11-30 17:18 ` [PATCH v2 6/8] libxml-sax-base-perl: add perl-module-base to ptest RDEPENDS Tim Orling
2026-11-30 17:18 ` [PATCH v2 7/8] libtimedate-perl: add perl-module-base to RDEPENDS Tim Orling
2026-11-30 17:18 ` [PATCH v2 8/8] perl: generate perl-rdepends.txt with perl.req Tim Orling
2026-12-01 2:40 ` [PATCH 0/3] perl recipes: add missing RDEPENDS found by loading modules Tim Orling
2026-12-01 2:40 ` [PATCH 1/3] libtimedate-perl: add perl-module-utf8 to RDEPENDS Tim Orling
2026-12-01 2:40 ` [PATCH 2/3] libxml-namespacesupport-perl: add perl-module-constant " Tim Orling
2026-12-01 2:40 ` [PATCH 3/3] libxml-perl: add libxml-parser-perl " Tim Orling
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261130011401.68860-2-tim.orling@konsulko.com \
--to=tim.orling@konsulko.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox