Skip to contentSkip to conversation

temurin-jdk-17-bin/temurin-jre-17-bin: Add recipes

PATCH Robert Joslyn 2 participants 4 messages Feb 5, 2023 – Feb 7, 2023 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Sorry, forgot to add Richard L to CC when sending the patch!

Robert

Quoted 156 lines · Robert Joslyn

Add recipes for the Adoptium Temurin JDK/JRE binaries. These recipes support arm, aarch64, ppc64le, and x86-64.

---

.../temurin/temurin-jdk-17-bin_17.0.6+10.bb   | 25 ++++++++
.../temurin/temurin-jre-17-bin_17.0.6+10.bb   | 23 +++++++
recipes-core/temurin/temurin.inc              | 62 +++++++++++++++++++
3 files changed, 110 insertions(+)

create mode 100644 recipes-core/temurin/temurin-jdk-17-bin_17.0.6+10.bb create mode 100644 recipes-core/temurin/temurin-jre-17-bin_17.0.6+10.bb create mode 100644 recipes-core/temurin/temurin.inc

recipes-core/temurin/temurin-jdk-17-bin_17.0.6+10.bb new file +25 -0
new file mode 100644
index 0000000..fe83df5
@@ -0,0 +1,25 @@
+SUMMARY = "Temurin JDK Binaries"
+
+JAVA_TYPE = "jdk"
+JAVA_SHA256:aarch64 = "9e0e88bbd9fa662567d0c1e22d469268c68ac078e9e5fe5a7244f56fec71f55f"
+JAVA_SHA256:arm = "fe4d0c6d5bb8cf7f59f7ff82c0c1fd988bbe5cccf3bc7377dc8ae50740b46c82"
+JAVA_SHA256:powerpc64le = "cb772c3fdf3f9fed56f23a37472acf2b80de20a7113fe09933891c6ef0ecde95"
+JAVA_SHA256:x86-64 = "a0b1b9dd809d51a438f5fa08918f9aca7b2135721097f0858cf29f77a35d4289"
+
+require temurin.inc
+
+S = "${WORKDIR}/jdk-${PV}"
+
+inherit update-alternatives
+
+ALTERNATIVE_PRIORITY = "100"
+ALTERNATIVE:${PN} = "java javac keytool"
+
+ALTERNATIVE_LINK_NAME[java] = "${bindir}/java"
+ALTERNATIVE_TARGET[java] = "${JAVA_HOME}/bin/java"
+
+ALTERNATIVE_LINK_NAME[javac] = "${bindir}/javac"
+ALTERNATIVE_TARGET[javac] = "${JAVA_HOME}/bin/javac"
+
+ALTERNATIVE_LINK_NAME[keytool] = "${bindir}/keytool"
+ALTERNATIVE_TARGET[keytool] = "${JAVA_HOME}/bin/keytool"
recipes-core/temurin/temurin-jre-17-bin_17.0.6+10.bb new file +23 -0
new file mode 100644
index 0000000..2527437
@@ -0,0 +1,23 @@
+SUMMARY = "Temurin JRE Binaries"
+
+JAVA_TYPE = "jre"
+JAVA_SHA256:arm = "bf7ef7ba477dc278f913e64174e76be9ae7f014c767352eae83b3f9581494fce"
+JAVA_SHA256:aarch64 = "3797815cb853616b6415e1b8875cda4eaa004887561ea4ea2090d726b8d8582f"
+JAVA_SHA256:powerpc64le = "f11b86bfd7fa4d7a0d05040ea235102296f03eaf064253f76d7ab94baa0352e3"
+JAVA_SHA256:x86-64 = "fe669935609086e76cb0b829e92808766cbf8cb7bda57a76b47813b08584bfd2"
+
+require temurin.inc
+
+S = "${WORKDIR}/jdk-${PV}-jre"
+
+inherit update-alternatives
+
+# Lower than corresponding JDK
+ALTERNATIVE_PRIORITY = "90"
+
+ALTERNATIVE:${PN} = "java keytool"
+ALTERNATIVE_LINK_NAME[java] = "${bindir}/java"
+ALTERNATIVE_TARGET[java] = "${JAVA_HOME}/bin/java"
+
+ALTERNATIVE_LINK_NAME[keytool] = "${bindir}/keytool"
+ALTERNATIVE_TARGET[keytool] = "${JAVA_HOME}/bin/keytool"
recipes-core/temurin/temurin.inc new file +37 -0
new file mode 100644
index 0000000..a026598
@@ -0,0 +1,62 @@
+HOMEPAGE = "https://adoptium.net"
+LICENSE = "GPL-2.0-with-classpath-exception"
+LIC_FILES_CHKSUM = "file://NOTICE;md5=8fa9e85281110769de025562c085b3a4"
+
+COMPATIBLE_HOST = "(aarch64|arm|powerpc64le|x86_64).*-linux"
+# Binaries are linked with glibc
+COMPATIBLE_HOST:libc-musl = "null"
+
+JAVA_ARCH:aarch64 = "aarch64"
+JAVA_ARCH:arm = "arm"
+JAVA_ARCH:powerpc64le = "ppc64le"
+JAVA_ARCH:x86-64 = "x64"
+
+# Convert PV to forms needed to download the tarball
+PV_MAJOR = "${@d.getVar('PV').split('.')[0]}"
+PV_UNDER = "${@d.getVar('PV').replace('+', '_')}"
+
+SRC_URI = "https://github.com/adoptium/temurin${PV_MAJOR}-binaries/releases/download/jdk-${PV}/OpenJDK${PV_MAJOR}U-${JAVA_TYPE}_${JAVA_ARCH}_linux_hotspot_${PV_UNDER}.tar.gz"
+SRC_URI[sha256sum] = "${JAVA_SHA256}"
+
+# Disable stuff not needed for packaging binaries
+INHIBIT_DEFAULT_DEPS = "1"
+INHIBIT_PACKAGE_STRIP = "1"
+INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
+EXCLUDE_FROM_SHLIBS = "1"
+do_patch[noexec] = "1"
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+JAVA_HOME = "${libdir}/jvm/${BPN}"
+
+do_install() {
+    install -d ${D}${JAVA_HOME}
+    cp -r ${S}/* ${D}${JAVA_HOME}
+}
+
+# The x86-64 binaries assume libraries are in /lib64, but a typical

pure 64-bit
+# Yocto image puts them in /lib. If not building a multilib image, add a

recipes-core/temurin/temurin.inc new file +24 -0
+# symlink from /lib64 to /lib.
+do_install:append:x86-64() {
+    if [ -z "${MULTILIBS}" ]; then
+        ln -s /lib ${D}/lib64
+    fi
+}
+
+FILES:${PN} = "${JAVA_HOME}"
+FILES:${PN}:append:x86-64 = " /lib64"
+
+RDEPENDS:${PN} = " \
+    alsa-lib \
+    freetype \
+    glibc \
+    libx11 \
+    libxext \
+    libxi \
+    libxrender \
+    libxtst \
+    zlib \
+"
+
+# Ignore "doesn't have GNU_HASH (didn't pass LDFLAGS?)" errors
+INSANE_SKIP:${PN} += "ldflags"
Signature · 10 lines
2.39.1


-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#100934): https://lists.openembedded.org/g/openembedded-devel/message/100934
Mute This Topic: https://lists.openembedded.org/mt/96765795/1348415
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#2 lore raw

Am Sun, Feb 05, 2023 at 10:52:59AM -0800 schrieb Robert Joslyn:

Quoted 4 lines

Sorry, forgot to add Richard L to CC when sending the patch!

Robert

Thanks for your work, but I am bit torn here, because one goal of oe was that all packages can be compiled by its own, so we can link against different sets of libc implementations and not repackaging some binary stuff. But in the end I would go with the decision of Richard Leitner.

Quoted 7 lines

Review line 2

Quoted 4 lines · Robert Joslyn

+++ b/recipes-core/temurin/temurin.inc

(quoted diff) +2 -0
@@ -0,0 +1,62 @@
+HOMEPAGE = "https://adoptium.net"
+LICENSE = "GPL-2.0-with-classpath-exception"

There are a lot more licenses involved according to:
https://projects.eclipse.org/projects/adoptium.temurin

Bye Henning

#3 lore raw
Quoted 6 lines · Henning Heinold

Am Sun, Feb 05, 2023 at 10:52:59AM -0800 schrieb Robert Joslyn:

Quoted 2 lines

Sorry, forgot to add Richard L to CC when sending the patch!

Quoted 8 lines
Quoted 2 lines

Robert

Thanks for your work, but I am bit torn here, because one goal of oe was that all packages can be compiled by its own, so we can link against different sets of libc implementations and not repackaging some binary stuff. But in the end I would go with the decision of Richard Leitner.

I agree, I would certainly prefer to build from source. I even run Gentoo so I can build from source on my workstation. But I have only a small need for Java and don’t have the time to get a newer Java building from source in OE (nor an employer willing to pay for it). Since getting it building is non-trivial, and we’re moving away from Java anyway, the easy answer is to grab some trusted binaries and use them until we hopefully migrate fully away from Java.

Posting this to the list is mostly to share the work in the hope it’s useful to others in the same position. Ideally those more invested in Java would spend the time to write proper recipes.

Quoted 11 lines
Quoted 8 lines

Review line 2

Quoted 4 lines · Robert Joslyn

+++ b/recipes-core/temurin/temurin.inc

(quoted diff) +2 -0
@@ -0,0 +1,62 @@
+HOMEPAGE = "https://adoptium.net"
+LICENSE = "GPL-2.0-with-classpath-exception"

There are a lot more licenses involved according to:
https://projects.eclipse.org/projects/adoptium.temurin

Hmm, I was going based on the NOTICE file in the tatrball which says,

This program and the accompanying materials are made available under the terms of the GNU General Public License, version 2, with the Classpath Exception.

Additional information relating to the program and accompanying materials license and usage is available as follows.
* For Eclipse Temurin version 8 see the LICENSE and ASSEMBLY_EXCEPTION files in the top level directory of the installation.
* For Eclipse Temurin version 9 or later see the files under the legal/ directory in the top level directory of the installation.

SPDX-License-Identifier: GPL-2.0 WITH Classpath-exception-2.0

The legal directory in the tarball does have a LICENSE file for each library, but every one is a symlink to the same GPL-2.0 license file with a classpath exception. Maybe the other licenses are used for things that aren’t distributed as part of the binaries?

I could update the recipes to checksum the other LICENSE files to make sure they don’t change (there are 70 of them in the JDK and 50 in the JRE).

Thanks for the review!

Robert

#4 lore raw

Am Mon, Feb 06, 2023 at 07:14:23PM -0800 schrieb Robert Joslyn:

Quoted 24 lines
Quoted 11 lines · Henning Heinold

Am Sun, Feb 05, 2023 at 10:52:59AM -0800 schrieb Robert Joslyn:

Quoted 4 lines

Sorry, forgot to add Richard L to CC when sending the patch!

Robert

There are a lot more licenses involved according to:
https://projects.eclipse.org/projects/adoptium.temurin

Hmm, I was going based on the NOTICE file in the tatrball which says,

This program and the accompanying materials are made available under the terms of the GNU General Public License, version 2, with the Classpath Exception.

Additional information relating to the program and accompanying materials license and usage is available as follows.
* For Eclipse Temurin version 8 see the LICENSE and ASSEMBLY_EXCEPTION files in the top level directory of the installation.
* For Eclipse Temurin version 9 or later see the files under the legal/ directory in the top level directory of the installation.

Quoted 6 lines

SPDX-License-Identifier: GPL-2.0 WITH Classpath-exception-2.0

The legal directory in the tarball does have a LICENSE file for each library, but every one is a symlink to the same GPL-2.0 license file with a classpath exception. Maybe the other licenses are used for things that aren’t distributed as part of the binaries?

I could update the recipes to checksum the other LICENSE files to make sure they don’t change (there are 70 of them in the JDK and 50 in the JRE).

Hm okay I looked, at the openjdk page again and there still is only GPL-2.0 WITH Classpath-exception-2.0 as license. So I think for now this that would overkill to add all links.

Quoted 2 lines

Thanks for the review!

Your are welcome.

Quoted 1 line

Robert

Bye Henning