Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH] package.bbclass: Fix broken dev package dependency.
@ 2024-06-24  9:56 Sreejith Ravi
  2024-06-24 11:07 ` [OE-core] " Alexander Kanavin
  0 siblings, 1 reply; 11+ messages in thread
From: Sreejith Ravi @ 2024-06-24  9:56 UTC (permalink / raw)
  To: openembedded-core


[-- Attachment #1.1: Type: text/plain, Size: 1548 bytes --]

Currently, the process_pkgconfig() would process only the "Requires" key field and ignore "Requires.private" while generating the dev dependency chain.

Example: usr/lib/pkgconfig/libical.pc
----------
Libs: -L${libdir} -lical -licalss -licalvcal
Libs.private: -lpthread
Requires.private: icu-i18n
----------
Depends field generated for libical-dev
Depends: glib-2.0-dev, libical (= 3.0.7-r0)
------------

When trying to resolve the build time dependency with libical package using “-dev” ipk generated, it will throw the below error.
-----------
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-i18n', required by 'libical', not found
-----------

This patch will add the packages listed in "Requires.private" to the dependency chain.

-------
Depends field generated with this change for libical-dev
Depends: glib-2.0-dev, icu-dev, libical (= 3.0.7-r0)
-------

Other examples of packages generated with broken dev dependency.

libflac-dev : https://packages.debian.org/sid/libflac-dev
Without patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++
with patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++, libogg-dev

libglib2.0-dev : https://packages.debian.org/buster/libglib2.0-dev
without patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev
with patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev,
util-linux-dev, zlib-dev

[-- Attachment #1.2: Type: text/html, Size: 1750 bytes --]

[-- Attachment #2: 0001-package.bbclass-Fix-broken-dev-package-dependency.patch --]
[-- Type: application/octet-stream, Size: 2666 bytes --]

From b559be82ffc16a012d40d5f15722ef0bb840ee9e Mon Sep 17 00:00:00 2001
From: Sreejith Ravi <sreejit.ravi087@gmail.com>
Date: Mon, 24 Jun 2024 10:18:10 +0100
Subject: [PATCH] package.bbclass: Fix broken dev package dependency.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently, the process_pkgconfig() would process only the
"Requires" key field and ignore "Requires.private" while
generating the dev dependency chain.

Example: usr/lib/pkgconfig/libical.pc
----------
Libs: -L${libdir} -lical -licalss -licalvcal
Libs.private: -lpthread
Requires.private: icu-i18n
----------
Depends field generated for libical-dev
Depends: glib-2.0-dev, libical (= 3.0.7-r0)
------------

When trying to resolve the build time dependency with libical
package using “-dev” ipk generated, it will throw the below error.
-----------
Package icu-i18n was not found in the pkg-config search path.
Perhaps you should add the directory containing `icu-i18n.pc'
to the PKG_CONFIG_PATH environment variable
Package 'icu-i18n', required by 'libical', not found
-----------

This patch will add the packages listed in "Requires.private"
to the dependency chain.

-------
Depends field generated with this change for libical-dev
Depends: glib-2.0-dev, icu-dev, libical (= 3.0.7-r0)
-------

Other examples of packages generated with broken dev dependency.

libflac-dev : https://packages.debian.org/sid/libflac-dev
Without patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++
with patch:
Depends: flac (= 1.3.3-r0), libflac, libflac++, libogg-dev

libglib2.0-dev : https://packages.debian.org/buster/libglib2.0-dev
without patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev
with patch:
Depends: libffi-dev, libglib-2.0-0 (= 1:2.62.6-r0), libpcre-dev,
         util-linux-dev, zlib-dev

Signed-off-by: Sreejith Ravi <sreejit.ravi087@gmail.com>
---
 meta/classes/package.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 67351b2510..084fe428e5 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -2182,7 +2182,7 @@ python package_do_pkgconfig () {
                         if m:
                             hdr = m.group(1)
                             exp = pd.expand(m.group(2))
-                            if hdr == 'Requires':
+                            if hdr == 'Requires' or hdr == 'Requires.private':
                                 pkgconfig_needed[pkg] += exp.replace(',', ' ').split()
                                 continue
                         m = var_re.match(l)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-06-24 13:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-24  9:56 [PATCH] package.bbclass: Fix broken dev package dependency Sreejith Ravi
2024-06-24 11:07 ` [OE-core] " Alexander Kanavin
2024-06-24 11:20   ` Sreejith Ravi
2024-06-24 11:27     ` Alexander Kanavin
2024-06-24 12:23       ` Sreejith Ravi
2024-06-24 12:36         ` [OE-core] " Alexander Kanavin
2024-06-24 12:47           ` Sreejith Ravi
2024-06-24 12:53             ` [OE-core] " Alexander Kanavin
2024-06-24 13:02               ` Sreejith Ravi
2024-06-24 13:26                 ` [OE-core] " Alexander Kanavin
2024-06-24 13:34                   ` Sreejith Ravi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox