From e626291375c5aafe71d7e83794d5bc95b914a685 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 9e41f75..f010c6e 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}" -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}" +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" S = "${WORKDIR}/${BPN}-${PV}/jdk-11.0.22+7-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 db1a09b..5c8dad9 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}" -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}" +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" S = "${WORKDIR}/${BPN}-${PV}/jdk-17.0.10+7-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 f33f451..b3a1024 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}" -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}" +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" S = "${WORKDIR}/${BPN}-${PV}/jdk-${PV}-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 2690bff..4663cec 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 @@ -61,8 +61,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}" -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}" +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" S = "${WORKDIR}/${BPN}-${PV}/${JVM_SUBDIR}"