From c7a94e1bc3d5a8d3ba6211176488d52a9d2d86d1 Mon Sep 17 00:00:00 2001 From: Sebastian Veit Date: Wed, 29 May 2024 11:17:04 +0200 Subject: [PATCH] recipes-core: Include sources into build The GPL-2.0-with-classpath-exception license requires to also distribute the source code. The recipes of the JREs has been adapted in this way. The sources are getting downloaded and placed into your deploy folder, which might be situated under build/tmp-glibc/deploy. Please take a look in the documentation [1] to figure out how to meet the requirement in your specific build setup. [1] https://docs.yoctoproject.org/dev-manual/licenses.html Signed-off-by: Sebastian Veit --- .../openjdk-11-jre/openjdk-11-jre_11.0.22+7.bb | 13 +++++++++++-- .../openjdk-17-jre/openjdk-17-jre_17.0.10+7.bb | 13 +++++++++++-- .../openjdk-21-jre/openjdk-21-jre_21.0.2+13.bb | 13 +++++++++++-- .../openjdk-8-jre/openjdk-8-jre_8u402-b06.bb | 13 +++++++++++-- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/recipes-core/openjdk-11-jre/openjdk-11-jre_11.0.22+7.bb b/recipes-core/openjdk-11-jre/openjdk-11-jre_11.0.22+7.bb index 50c17e3..4a1c56e 100644 --- a/recipes-core/openjdk-11-jre/openjdk-11-jre_11.0.22+7.bb +++ b/recipes-core/openjdk-11-jre/openjdk-11-jre_11.0.22+7.bb @@ -58,8 +58,17 @@ API_JVM_IMPL = "hotspot" API_HEAP_SIZE ?= "normal" API_VENDOR = "eclipse" -SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" -SRC_URI[sha256sum] = "${JVM_CHECKSUM}" +SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};name=binary;downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" +SRC_URI[binary.sha256sum] = "${JVM_CHECKSUM}" + +# Provide sources of the JVM because of its license. +ADAPTED_PV_SRC = "" +python () { + import re + d.setVar('ADAPTED_PV_SRC', d.getVar('PV').replace('+', '_')) +} +SRC_URI:append = " https://github.com/adoptium/temurin11-binaries/releases/download/${API_RELEASE_NAME}/OpenJDK11U-jdk-sources_${ADAPTED_PV_SRC}.tar.gz;name=sources;downloadfilename=${BPN}-sources-${PV}.tar.gz;unpack=false" +SRC_URI[sources.sha256sum] = "727a596a0ca94c4afea649a9d5331b8d50cb34f0ed95548498edab6c2027a3d6" libdir_jre = "${libdir}/jvm/openjdk-11-jre" diff --git a/recipes-core/openjdk-17-jre/openjdk-17-jre_17.0.10+7.bb b/recipes-core/openjdk-17-jre/openjdk-17-jre_17.0.10+7.bb index 55fa0ee..1978c33 100644 --- a/recipes-core/openjdk-17-jre/openjdk-17-jre_17.0.10+7.bb +++ b/recipes-core/openjdk-17-jre/openjdk-17-jre_17.0.10+7.bb @@ -58,8 +58,17 @@ API_JVM_IMPL = "hotspot" API_HEAP_SIZE ?= "normal" API_VENDOR = "eclipse" -SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" -SRC_URI[sha256sum] = "${JVM_CHECKSUM}" +SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};name=binary;downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" +SRC_URI[binary.sha256sum] = "${JVM_CHECKSUM}" + +# Provide sources of the JVM because of its license. +ADAPTED_PV_SRC = "" +python () { + import re + d.setVar('ADAPTED_PV_SRC', d.getVar('PV').replace('+', '_')) +} +SRC_URI:append = " https://github.com/adoptium/temurin17-binaries/releases/download/${API_RELEASE_NAME}/OpenJDK17U-jdk-sources_${ADAPTED_PV_SRC}.tar.gz;name=sources;downloadfilename=${BPN}-sources-${PV}.tar.gz;unpack=false" +SRC_URI[sources.sha256sum] = "111988b009f6856c717a1a55753bd72048adfd637ed8f232aaf6d96ec329a9d4" libdir_jre = "${libdir}/jvm/openjdk-17-jre" diff --git a/recipes-core/openjdk-21-jre/openjdk-21-jre_21.0.2+13.bb b/recipes-core/openjdk-21-jre/openjdk-21-jre_21.0.2+13.bb index 1e10317..b50729f 100644 --- a/recipes-core/openjdk-21-jre/openjdk-21-jre_21.0.2+13.bb +++ b/recipes-core/openjdk-21-jre/openjdk-21-jre_21.0.2+13.bb @@ -44,8 +44,17 @@ API_JVM_IMPL = "hotspot" API_HEAP_SIZE ?= "normal" API_VENDOR = "eclipse" -SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" -SRC_URI[sha256sum] = "${JVM_CHECKSUM}" +SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};name=binary;downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" +SRC_URI[binary.sha256sum] = "${JVM_CHECKSUM}" + +# Provide sources of the JVM because of its license. +ADAPTED_PV_SRC = "" +python () { + import re + d.setVar('ADAPTED_PV_SRC', d.getVar('PV').replace('+', '_')) +} +SRC_URI:append = " https://github.com/adoptium/temurin21-binaries/releases/download/${API_RELEASE_NAME}/OpenJDK21U-jdk-sources_${ADAPTED_PV_SRC}.tar.gz;name=sources;downloadfilename=${BPN}-sources-${PV}.tar.gz;unpack=false" +SRC_URI[sources.sha256sum] = "b23e3f90cbe8e83b69a7ce0db6ffd9849967f77b335567f3d732e3e2eb11ec17" libdir_jre = "${libdir}/jvm/openjdk-21-jre" diff --git a/recipes-core/openjdk-8-jre/openjdk-8-jre_8u402-b06.bb b/recipes-core/openjdk-8-jre/openjdk-8-jre_8u402-b06.bb index fa9de2a..e5882be 100644 --- a/recipes-core/openjdk-8-jre/openjdk-8-jre_8u402-b06.bb +++ b/recipes-core/openjdk-8-jre/openjdk-8-jre_8u402-b06.bb @@ -58,8 +58,17 @@ API_JVM_IMPL = "hotspot" API_HEAP_SIZE ?= "normal" API_VENDOR = "eclipse" -SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" -SRC_URI[sha256sum] = "${JVM_CHECKSUM}" +SRC_URI = "https://api.adoptium.net/v3/binary/version/${API_RELEASE_NAME}/${API_OS}/${API_ARCH}/${API_IMAGE_TYPE}/${API_JVM_IMPL}/${API_HEAP_SIZE}/${API_VENDOR};name=binary;downloadfilename=${BPN}-${API_ARCH}-${PV}.tar.gz;subdir=${BPN}-${PV};striplevel=1" +SRC_URI[binary.sha256sum] = "${JVM_CHECKSUM}" + +# Provide sources of the JVM because of its license. +ADAPTED_PV_SRC = "" +python () { + import re + d.setVar('ADAPTED_PV_SRC', d.getVar('PV').replace('-', '')) +} +SRC_URI:append = " https://github.com/adoptium/temurin8-binaries/releases/download/${API_RELEASE_NAME}/OpenJDK8U-jdk-sources_${ADAPTED_PV_SRC}.tar.gz;name=sources;downloadfilename=${BPN}-sources-${PV}.tar.gz;unpack=false" +SRC_URI[sources.sha256sum] = "60d79189dc23f3e983ba2f3c327f1ffd1da2e6b0305233b39145da66851a2aa9" libdir_jre = "${libdir}/jvm/openjdk-8-jre"