[oe] [meta-java][RFC][PATCH 4/7] openjre-8: add meaningful (R)PROVIDES

André Draszik git at andred.net
Fri Jul 27 13:29:20 UTC 2018


From: André Draszik <andre.draszik at jci.com>

Then OpenJRE8 recipe provides a Java Runtime. It
is compatible with Java versions 5 through 8 (including), so add
appropriate (R)PROVIDES, so that recipes depending on it can can specify
that virtual dependency, rather than hard-coding to openjre-8. This makes
it possible to:
a) add OpenJRE9 and OpenJRE10 recipes in the future without much disruption
b) use a different provider than OpenJDK, e.g. Oracle Java, or Zulu Java

This is the approach taken by e.g. Debian.

Signed-off-by: André Draszik <andre.draszik at jci.com>
---
 recipes-core/openjdk/openjre-8_172b11.bb | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/recipes-core/openjdk/openjre-8_172b11.bb b/recipes-core/openjdk/openjre-8_172b11.bb
index 220dc01..eac5e5e 100644
--- a/recipes-core/openjdk/openjre-8_172b11.bb
+++ b/recipes-core/openjdk/openjre-8_172b11.bb
@@ -33,10 +33,10 @@ FILES_${PN}-doc_append = "\
     ${JRE_HOME}/THIRD_PARTY_README \
 "
 
-RPROVIDES_${PN} = "java2-vm"
-PROVIDES_${PN} = "java2-vm"
-RPROVIDES_${PN} = "java2-runtime"
-PROVIDES_${PN} = "java2-runtime"
+PROVIDES = "java2-vm java2-runtime"
+PROVIDES += "${@' '.join('virtual/java'+str(x)+'-runtime' for x in range(5,9))}"
+RPROVIDES_${PN} = "java2-vm java2-runtime"
+RPROVIDES_${PN} += "${@' '.join('virtual-java'+str(x)+'-runtime' for x in range(5,9))}"
 
 inherit update-alternatives
 
-- 
2.18.0




More information about the Openembedded-devel mailing list