All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs
@ 2019-12-10  9:35 kai.kang
  2019-12-10  9:35 ` [PATCH 2/2] glew/curl: specify exclusive " kai.kang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kai.kang @ 2019-12-10  9:35 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

There are mutually exclusive PACKAGECONFIGs in recipes. Though it
declares that package configs are exclusive, it can't prevent users to
set them at same time. Extend PACKAGECONFIG to support specifying
conflicted package configs.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/classes/base.bbclass | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
index 31457f9f12..ef3afdf964 100644
--- a/meta/classes/base.bbclass
+++ b/meta/classes/base.bbclass
@@ -390,7 +390,7 @@ python () {
     # These take the form:
     #
     # PACKAGECONFIG ??= "<default options>"
-    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends"
+    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends,foo_conflict_packageconfig"
     pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
     if pkgconfigflags:
         pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
@@ -437,8 +437,8 @@ python () {
         for flag, flagval in sorted(pkgconfigflags.items()):
             items = flagval.split(",")
             num = len(items)
-            if num > 5:
-                bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend can be specified!"
+            if num > 6:
+                bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend,conflict_packageconfig can be specified!"
                     % (d.getVar('PN'), flag))
 
             if flag in pkgconfig:
@@ -452,6 +452,20 @@ python () {
                     extraconf.append(items[0])
             elif num >= 2 and items[1]:
                     extraconf.append(items[1])
+
+            if num >= 6 and items[5]:
+                conflicts = set(items[5].split())
+                invalid = conflicts.difference(set(pkgconfigflags.keys()))
+                if invalid:
+                    bb.error("%s: PACKAGECONFIG[%s] Invalid conflict package config%s '%s' specified."
+                        % (d.getVar('PN'), flag, 's' if len(invalid) > 1 else '', ' '.join(invalid)))
+
+                if flag in pkgconfig:
+                    intersec = conflicts.intersection(set(pkgconfig))
+                    if intersec:
+                        bb.fatal("%s: PACKAGECONFIG[%s] Conflict package config%s '%s' set in PACKAGECONFIG."
+                            % (d.getVar('PN'), flag, 's' if len(intersec) > 1 else '', ' '.join(intersec)))
+
         appendVar('DEPENDS', extradeps)
         appendVar('RDEPENDS_${PN}', extrardeps)
         appendVar('RRECOMMENDS_${PN}', extrarrecs)
-- 
2.17.1



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

* [PATCH 2/2] glew/curl: specify exclusive package configs
  2019-12-10  9:35 [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs kai.kang
@ 2019-12-10  9:35 ` kai.kang
  2019-12-10 11:48 ` [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict " Andreas Müller
  2019-12-24  2:27 ` Kang Kai
  2 siblings, 0 replies; 4+ messages in thread
From: kai.kang @ 2019-12-10  9:35 UTC (permalink / raw)
  To: openembedded-core

From: Kai Kang <kai.kang@windriver.com>

Specify exclusive package configs for glew and curl to make sure that
conflict package configs will NOT set at same time.

Signed-off-by: Kai Kang <kai.kang@windriver.com>
---
 meta/recipes-graphics/glew/glew_2.1.0.bb | 4 ++--
 meta/recipes-support/curl/curl_7.67.0.bb | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/meta/recipes-graphics/glew/glew_2.1.0.bb b/meta/recipes-graphics/glew/glew_2.1.0.bb
index f6f43406f8..edcbdc0a7a 100644
--- a/meta/recipes-graphics/glew/glew_2.1.0.bb
+++ b/meta/recipes-graphics/glew/glew_2.1.0.bb
@@ -22,8 +22,8 @@ REQUIRED_DISTRO_FEATURES = "opengl"
 PACKAGECONFIG ?= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'opengl', 'egl-gles2', d)}"
 
 # The opengl and egl-XXX options are exclusive, enable only one.
-PACKAGECONFIG[opengl] = "SYSTEM='linux',,virtual/libx11 virtual/libgl libglu libxext libxi libxmu"
-PACKAGECONFIG[egl-gles2] = "SYSTEM='linux-egl' GLEW_NO_GLU='-DGLEW_NO_GLU' LDFLAGS.GL='-lEGL -lGLESv2',,virtual/egl virtual/libgles2"
+PACKAGECONFIG[opengl] = "SYSTEM='linux',,virtual/libx11 virtual/libgl libglu libxext libxi libxmu,,,egl-gles2"
+PACKAGECONFIG[egl-gles2] = "SYSTEM='linux-egl' GLEW_NO_GLU='-DGLEW_NO_GLU' LDFLAGS.GL='-lEGL -lGLESv2',,virtual/egl virtual/libgles2,,,opengl"
 
 CFLAGS += "-D_GNU_SOURCE"
 # Override SYSTEM (via PACKAGECONFIG_CONFARGS) to avoid calling config.guess,
diff --git a/meta/recipes-support/curl/curl_7.67.0.bb b/meta/recipes-support/curl/curl_7.67.0.bb
index e08e08ed4a..e42bd5835e 100644
--- a/meta/recipes-support/curl/curl_7.67.0.bb
+++ b/meta/recipes-support/curl/curl_7.67.0.bb
@@ -20,7 +20,7 @@ PACKAGECONFIG_class-native = "ipv6 proxy ssl threaded-resolver verbose zlib"
 PACKAGECONFIG_class-nativesdk = "ipv6 proxy ssl threaded-resolver verbose zlib"
 
 # 'ares' and 'threaded-resolver' are mutually exclusive
-PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares"
+PACKAGECONFIG[ares] = "--enable-ares,--disable-ares,c-ares,,,threaded-resolver"
 PACKAGECONFIG[brotli] = "--with-brotli,--without-brotli,brotli"
 PACKAGECONFIG[builtinmanual] = "--enable-manual,--disable-manual"
 PACKAGECONFIG[dict] = "--enable-dict,--disable-dict,"
@@ -45,7 +45,7 @@ PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openss
 PACKAGECONFIG[nss] = "--with-nss,--without-nss,nss"
 PACKAGECONFIG[telnet] = "--enable-telnet,--disable-telnet,"
 PACKAGECONFIG[tftp] = "--enable-tftp,--disable-tftp,"
-PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver"
+PACKAGECONFIG[threaded-resolver] = "--enable-threaded-resolver,--disable-threaded-resolver,,,,ares"
 PACKAGECONFIG[verbose] = "--enable-verbose,--disable-verbose"
 PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib"
 
-- 
2.17.1



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

* Re: [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs
  2019-12-10  9:35 [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs kai.kang
  2019-12-10  9:35 ` [PATCH 2/2] glew/curl: specify exclusive " kai.kang
@ 2019-12-10 11:48 ` Andreas Müller
  2019-12-24  2:27 ` Kang Kai
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Müller @ 2019-12-10 11:48 UTC (permalink / raw)
  To: Kang Kai; +Cc: Patches and discussions about the oe-core layer

On Tue, Dec 10, 2019 at 10:36 AM <kai.kang@windriver.com> wrote:
>
> From: Kai Kang <kai.kang@windriver.com>
>
> There are mutually exclusive PACKAGECONFIGs in recipes. Though it
> declares that package configs are exclusive, it can't prevent users to
> set them at same time. Extend PACKAGECONFIG to support specifying
> conflicted package configs.
>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
Did not test but I like it. Think there are more places exclusion can
be useful e.g meta-qt5/qtbase

Andreas


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

* Re: [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs
  2019-12-10  9:35 [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs kai.kang
  2019-12-10  9:35 ` [PATCH 2/2] glew/curl: specify exclusive " kai.kang
  2019-12-10 11:48 ` [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict " Andreas Müller
@ 2019-12-24  2:27 ` Kang Kai
  2 siblings, 0 replies; 4+ messages in thread
From: Kang Kai @ 2019-12-24  2:27 UTC (permalink / raw)
  To: openembedded-core

On 2019/12/10 下午5:35, kai.kang@windriver.com wrote:
> From: Kai Kang <kai.kang@windriver.com>
>
> There are mutually exclusive PACKAGECONFIGs in recipes. Though it
> declares that package configs are exclusive, it can't prevent users to
> set them at same time. Extend PACKAGECONFIG to support specifying
> conflicted package configs.

Ping.


>
> Signed-off-by: Kai Kang <kai.kang@windriver.com>
> ---
>   meta/classes/base.bbclass | 20 +++++++++++++++++---
>   1 file changed, 17 insertions(+), 3 deletions(-)
>
> diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass
> index 31457f9f12..ef3afdf964 100644
> --- a/meta/classes/base.bbclass
> +++ b/meta/classes/base.bbclass
> @@ -390,7 +390,7 @@ python () {
>       # These take the form:
>       #
>       # PACKAGECONFIG ??= "<default options>"
> -    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends"
> +    # PACKAGECONFIG[foo] = "--enable-foo,--disable-foo,foo_depends,foo_runtime_depends,foo_runtime_recommends,foo_conflict_packageconfig"
>       pkgconfigflags = d.getVarFlags("PACKAGECONFIG") or {}
>       if pkgconfigflags:
>           pkgconfig = (d.getVar('PACKAGECONFIG') or "").split()
> @@ -437,8 +437,8 @@ python () {
>           for flag, flagval in sorted(pkgconfigflags.items()):
>               items = flagval.split(",")
>               num = len(items)
> -            if num > 5:
> -                bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend can be specified!"
> +            if num > 6:
> +                bb.error("%s: PACKAGECONFIG[%s] Only enable,disable,depend,rdepend,rrecommend,conflict_packageconfig can be specified!"
>                       % (d.getVar('PN'), flag))
>   
>               if flag in pkgconfig:
> @@ -452,6 +452,20 @@ python () {
>                       extraconf.append(items[0])
>               elif num >= 2 and items[1]:
>                       extraconf.append(items[1])
> +
> +            if num >= 6 and items[5]:
> +                conflicts = set(items[5].split())
> +                invalid = conflicts.difference(set(pkgconfigflags.keys()))
> +                if invalid:
> +                    bb.error("%s: PACKAGECONFIG[%s] Invalid conflict package config%s '%s' specified."
> +                        % (d.getVar('PN'), flag, 's' if len(invalid) > 1 else '', ' '.join(invalid)))
> +
> +                if flag in pkgconfig:
> +                    intersec = conflicts.intersection(set(pkgconfig))
> +                    if intersec:
> +                        bb.fatal("%s: PACKAGECONFIG[%s] Conflict package config%s '%s' set in PACKAGECONFIG."
> +                            % (d.getVar('PN'), flag, 's' if len(intersec) > 1 else '', ' '.join(intersec)))
> +
>           appendVar('DEPENDS', extradeps)
>           appendVar('RDEPENDS_${PN}', extrardeps)
>           appendVar('RRECOMMENDS_${PN}', extrarrecs)


-- 
Kai Kang



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

end of thread, other threads:[~2019-12-24  2:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10  9:35 [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict package configs kai.kang
2019-12-10  9:35 ` [PATCH 2/2] glew/curl: specify exclusive " kai.kang
2019-12-10 11:48 ` [PATCH 1/2] base.bbclass: extend PACKAGECONFIG for conflict " Andreas Müller
2019-12-24  2:27 ` Kang Kai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.