[oe] [meta-java][RFC][PATCH 1/7] openjdk-8-native: add meaningful (R)PROVIDES

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

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

The OpenJDK8-native recipe provides a Java SDK, and 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 openjdk-8. This makes
it possible to:
a) add OpenJDK9 and OpenJDK10 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/openjdk-8-native.inc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/recipes-core/openjdk/openjdk-8-native.inc b/recipes-core/openjdk/openjdk-8-native.inc
index 761ddc7..2dd31e7 100644
--- a/recipes-core/openjdk/openjdk-8-native.inc
+++ b/recipes-core/openjdk/openjdk-8-native.inc
@@ -87,3 +87,6 @@ do_install() {
         ln -sf "../lib/jvm/${JDK_DIR}/bin/$tool" ${D}${bindir}/$tool
+PROVIDES = "${@' '.join('virtual/java'+str(x)+'-sdk-native virtual/java'+str(x)+'-runtime-native' for x in range(5,9))}"
+RPROVIDES_${PN} = "${@' '.join('virtual-java'+str(x)+'-sdk-native virtual-java'+str(x)+'-runtime-native' for x in range(5,9))}"

More information about the Openembedded-devel mailing list