[meta-oe][PATCH 1/3] rrdtool: Fix do_configure by exporting ABS_TOP_BUILDDIR for perl bindings

Khem Raj <[email protected]>
Newsgroups org.openembedded.lists.openembedded-devel
Message-ID <[email protected]>
1.10.3 grew a third branch in bindings/perl-shared/Makefile.PL: when
ABS_TOP_BUILDDIR is unset it assumes a standalone build, pkg-config
probes for an installed librrd and dies.

| pkg-config could not find librrd. Is rrdtool installed?
| Try: brew install rrdtool (macOS) or apt install librrd-dev (Debian/Ubuntu)

bindings/Makefile.am always passes ABS_TOP_SRCDIR, ABS_TOP_BUILDDIR and
ABS_SRCDIR when it runs Makefile.PL, but do_configure re-runs it by hand
to redo the perl bindings and did not. Export them there too so the
in-tree branch is taken and RRDs links against -L${B}/src/.libs -lrrd.

Verified on aarch64 for qemuarm64: do_configure fails before the change
with the error above, and do_compile and do_package succeed after.

Signed-off-by: Khem Raj <[email protected]>
---
 meta-oe/recipes-extended/rrdtool/rrdtool_1.10.3.bb | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/meta-oe/recipes-extended/rrdtool/rrdtool_1.10.3.bb b/meta-oe/recipes-extended/rrdtool/rrdtool_1.10.3.bb
index a434927b23..656cee7ffa 100644
--- a/meta-oe/recipes-extended/rrdtool/rrdtool_1.10.3.bb
+++ b/meta-oe/recipes-extended/rrdtool/rrdtool_1.10.3.bb
@@ -97,9 +97,14 @@ do_configure() {
         ${B}/bindings/Makefile

     #redo the perl bindings
+    # perl-shared/Makefile.PL only links against the in-tree librrd when
+    # ABS_TOP_BUILDDIR is set, which is what bindings/Makefile.am does. Without
+    # it the standalone branch pkg-config probes for an installed librrd and
+    # dies with "pkg-config could not find librrd", so export them here too.
     (
     cd ${S}/bindings/perl-shared;
-    perl Makefile.PL INSTALLDIRS="vendor" INSTALLPRIVLIB="abc";
+    ABS_TOP_SRCDIR="${S}" ABS_TOP_BUILDDIR="${B}" ABS_SRCDIR="${S}/bindings/perl-shared" \
+        perl Makefile.PL INSTALLDIRS="vendor" INSTALLPRIVLIB="abc";

     cd ../../bindings/perl-piped;
     perl Makefile.PL INSTALLDIRS="vendor";
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.