Skip to content

Commit

Permalink
recipes-core: Include sources into build
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
sebveit committed Jun 7, 2024
1 parent 8766bce commit e626291
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 8 deletions.
13 changes: 11 additions & 2 deletions recipes-core/openjdk-11-jre/openjdk-11-jre_11.0.22+7.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
13 changes: 11 additions & 2 deletions recipes-core/openjdk-17-jre/openjdk-17-jre_17.0.10+7.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
13 changes: 11 additions & 2 deletions recipes-core/openjdk-21-jre/openjdk-21-jre_21.0.2+13.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
13 changes: 11 additions & 2 deletions recipes-core/openjdk-8-jre/openjdk-8-jre_8u402-b06.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down

0 comments on commit e626291

Please sign in to comment.