All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] protobuf: make python-protobuf dependency optional and default to off
@ 2018-09-26  1:53 Paul Eggleton
  2018-09-26  5:22 ` akuster808
  0 siblings, 1 reply; 2+ messages in thread
From: Paul Eggleton @ 2018-09-26  1:53 UTC (permalink / raw)
  To: openembedded-devel

A dependency on python-protobuf was added in commit
5f6fcfd36272768a3ff9078c07c572cf5dc01ccd for the sole purpose of
providing a ptest, however python-protobuf is in meta-python and thus
this means that meta-oe would depend on meta-python by default (assuming
your distro enables ptest by default), and we don't want that - meta-oe
isn't supposed to depend upon any layer other than openembedded-core.
Luckily we can still have a ptest even without the python support, so
add a PACKAGECONFIG and leave it disabled by default.

Note: the PACKAGECONFIG here is not particularly useful since it's only
about what goes into the -ptest package and thus also the dependency. I
contemplated just using LANG_SUPPORT instead, but PACKAGECONFIG does
have the advantage that it's introspectable and fairly well understood
so in the end I went with it.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb b/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
index f8498c4c8..cf72d9ca7 100644
--- a/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
+++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
@@ -22,10 +22,13 @@ S = "${WORKDIR}/git"
 
 inherit autotools-brokensep pkgconfig ptest
 
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[python] = ",,"
+
 EXTRA_OECONF += "--with-protoc=echo"
 
 TEST_SRC_DIR = "examples"
-LANG_SUPPORT = "cpp python"
+LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
 
 do_compile_ptest() {
 	# Modify makefile to use the cross-compiler
@@ -78,7 +81,7 @@ FILES_${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
 
 RDEPENDS_${PN}-compiler = "${PN}"
 RDEPENDS_${PN}-dev += "${PN}-compiler"
-RDEPENDS_${PN}-ptest = "bash python-protobuf"
+RDEPENDS_${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}"
 
 MIPS_INSTRUCTION_SET = "mips"
 
-- 
2.17.1



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

* Re: [meta-oe][PATCH] protobuf: make python-protobuf dependency optional and default to off
  2018-09-26  1:53 [meta-oe][PATCH] protobuf: make python-protobuf dependency optional and default to off Paul Eggleton
@ 2018-09-26  5:22 ` akuster808
  0 siblings, 0 replies; 2+ messages in thread
From: akuster808 @ 2018-09-26  5:22 UTC (permalink / raw)
  To: Paul Eggleton, openembedded-devel



On 09/25/2018 06:53 PM, Paul Eggleton wrote:
> A dependency on python-protobuf was added in commit
> 5f6fcfd36272768a3ff9078c07c572cf5dc01ccd for the sole purpose of
> providing a ptest, however python-protobuf is in meta-python and thus
> this means that meta-oe would depend on meta-python by default (assuming
> your distro enables ptest by default), and we don't want that - meta-oe
> isn't supposed to depend upon any layer other than openembedded-core.
> Luckily we can still have a ptest even without the python support, so
> add a PACKAGECONFIG and leave it disabled by default.
>
> Note: the PACKAGECONFIG here is not particularly useful since it's only
> about what goes into the -ptest package and thus also the dependency. I
> contemplated just using LANG_SUPPORT instead, but PACKAGECONFIG does
> have the advantage that it's introspectable and fairly well understood
> so in the end I went with it.
thanks. with backport to sumo ?

>
> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
> ---
>  meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb b/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
> index f8498c4c8..cf72d9ca7 100644
> --- a/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
> +++ b/meta-oe/recipes-devtools/protobuf/protobuf_3.6.1.bb
> @@ -22,10 +22,13 @@ S = "${WORKDIR}/git"
>  
>  inherit autotools-brokensep pkgconfig ptest
>  
> +PACKAGECONFIG ??= ""
> +PACKAGECONFIG[python] = ",,"
> +
>  EXTRA_OECONF += "--with-protoc=echo"
>  
>  TEST_SRC_DIR = "examples"
> -LANG_SUPPORT = "cpp python"
> +LANG_SUPPORT = "cpp ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python', '', d)}"
>  
>  do_compile_ptest() {
>  	# Modify makefile to use the cross-compiler
> @@ -78,7 +81,7 @@ FILES_${PN}-lite = "${libdir}/libprotobuf-lite${SOLIBS}"
>  
>  RDEPENDS_${PN}-compiler = "${PN}"
>  RDEPENDS_${PN}-dev += "${PN}-compiler"
> -RDEPENDS_${PN}-ptest = "bash python-protobuf"
> +RDEPENDS_${PN}-ptest = "bash ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python-protobuf', '', d)}"
>  
>  MIPS_INSTRUCTION_SET = "mips"
>  



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

end of thread, other threads:[~2018-09-26  5:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-26  1:53 [meta-oe][PATCH] protobuf: make python-protobuf dependency optional and default to off Paul Eggleton
2018-09-26  5:22 ` akuster808

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.