8000 jdk: current LTS (meta over jdk-25); add jdk-25 (Temurin 25) and jdk-21 (Temurin 21) by bryan-minimal · Pull Request #897 · gominimal/pkgs · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 93 additions & 0 deletions packages/jdk-21/build.ncl
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
let { Attrs, BuildSpec, Local, OutputBin, OutputData, OutputLib, Source, Test, .. } = import "minimal.ncl" in
let { target, .. } = import "config.ncl" in
let base = import "../base/build.ncl" in
let alsa-lib = import "../alsa-lib/build.ncl" in
let glibc = import "../glibc/build.ncl" in
let zlib = import "../zlib/build.ncl" in

let version = "21.0.12.1" in
let build_num = "1" in
let dl_base = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-%{version}+%{build_num}" in

let { amd64_sha256, arm64_sha256 } = {
amd64_sha256 = "ce79869e1307ed8ee1e2baa86a412b1eb5b75d10a01006d788a6f968bcfaee94",
arm64_sha256 = "23e37e026f12f3e706f18938ff611db3032d075b09d0879a25d06718c773e223",
}
in

# Eclipse Temurin 21, the previous Java LTS. This was `jdk` until `jdk`
# became the current LTS (jdk-25); kept for projects pinned to 21.
{
name = "jdk-21",
build_deps = [
{ file = "build.sh" } | Local,
match {
{ arch = 'Amd64, .. } =>
{
url = "%{dl_base}/OpenJDK21U-jdk_x64_linux_hotspot_%{version}_%{build_num}.tar.gz",
sha256 = amd64_sha256,
} | Source,
{ arch = 'Arm64, .. } =>
{
url = "%{dl_base}/OpenJDK21U-jdk_aarch64_linux_hotspot_%{version}_%{build_num}.tar.gz",
sha256 = arm64_sha256,
} | Source,
} target,
base,
],
runtime_deps = [
alsa-lib,
glibc,
zlib,
],

cmd = "./build.sh",
build_args = {
include version,
include build_num,
},

outputs = {
bins = { glob = "usr/bin/*" } | OutputBin,

jvm_bins = { glob = "usr/lib/jvm/bin/*" } | OutputBin,
jvm_libs = { glob = "usr/lib/jvm/lib/**/*.so*" } | OutputLib,
jvm_libdata = { glob = "usr/lib/jvm/lib/**", allow_executable = true } | OutputData,

jvm_data = { glob = "usr/lib/jvm/{jmod,conf,legal}/**" } | OutputData,
jvm_includes = { glob = "usr/lib/jvm/include/**" } | OutputData,
},

attrs =
{
upstream_version = version,
license_spdx = "GPL-2.0-only WITH Classpath-exception-2.0",
source_provenance = {
category = 'GithubRepo,
owner = "adoptium",
repo = "temurin21-binaries",
},
} | Attrs,

tests = {
java_version =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "java -version 2>&1 | grep -q '21'"],
],
} | Test,

javac_compile =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "echo 'public class Hi { public static void main(String[] a) { System.out.println(\"ok\"); } }' > Hi.java"],
["/bin/javac", "Hi.java"],
["/bin/bash", "-c", "java Hi | grep -q '^ok$'"],
],
} | Test,
},
} | BuildSpec
8 changes: 5 additions & 3 deletions packages/jdk/build.sh → packages/jdk-21/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ mkdir -p $OUTPUT_DIR/usr/{bin,lib/jvm}
# Install the JDK
cp -r . $OUTPUT_DIR/usr/lib/jvm/

# Symlink key binaries
for bin in java javac jar jlink jmod jpackage jshell keytool; do
ln -sv ../lib/jvm/bin/$bin $OUTPUT_DIR/usr/bin/$bin
# Put every JDK tool on PATH (jdb, jcmd, jfr, jstack, jmap, javap, jdeps,
# javadoc, ... -- not just the eight that used to be listed here).
for path in "$OUTPUT_DIR"/usr/lib/jvm/bin/*; do
bin=$(basename "$path")
ln -sv "../lib/jvm/bin/$bin" "$OUTPUT_DIR/usr/bin/$bin"
done
95 changes: 95 additions & 0 deletions packages/jdk-25/build.ncl
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
let { Attrs, BuildSpec, Local, OutputBin, OutputData, OutputLib, Source, Test, .. } = import "minimal.ncl" in
let { target, .. } = import "config.ncl" in
let base = import "../base/build.ncl" in
let alsa-lib = import "../alsa-lib/build.ncl" in
let glibc = import "../glibc/build.ncl" in
let zlib = import "../zlib/build.ncl" in

let version = "25.0.4.1" in
let build_num = "1" in
let dl_base = "https://github.com/adoptium/temurin25-binaries/releases/download/jdk-%{version}+%{build_num}" in

let { amd64_sha256, arm64_sha256 } = {
amd64_sha256 = "dbb698396d478e7fa2b1e50f4103324b2a99b90569ee27c33f2261f9215cf41e",
arm64_sha256 = "69df11a02cfa3ef7d7ca645e03edce6778ec090e100f6ae2b42097865730ac52",
}
in

# Eclipse Temurin 25, the current Java LTS (Adoptium's prebuilt OpenJDK
# binaries). A separate package from `jdk` (Temurin 21, the previous LTS) so
# projects pick a line explicitly and neither moves under the other. Same
# layout and outputs as packages/jdk.
{
name = "jdk-25",
build_deps = [
{ file = "build.sh" } | Local,
match {
{ arch = 'Amd64, .. } =>
{
url = "%{dl_base}/OpenJDK25U-jdk_x64_linux_hotspot_%{version}_%{build_num}.tar.gz",
sha256 = amd64_sha256,
} | Source,
{ arch = 'Arm64, .. } =>
{
url = "%{dl_base}/OpenJDK25U-jdk_aarch64_linux_hotspot_%{version}_%{build_num}.tar.gz",
sha256 = arm64_sha256,
} | Source,
} target,
base,
],
runtime_deps = [
alsa-lib,
glibc,
zlib,
],

cmd = "./build.sh",
build_args = {
include version,
include build_num,
},

outputs = {
bins = { glob = "usr/bin/*" } | OutputBin,

jvm_bins = { glob = "usr/lib/jvm/bin/*" } | OutputBin,
jvm_libs = { glob = "usr/lib/jvm/lib/**/*.so*" } | OutputLib,
jvm_libdata = { glob = "usr/lib/jvm/lib/**", allow_executable = true } | OutputData,

jvm_data = { glob = "usr/lib/jvm/{jmod,conf,legal}/**" } | OutputData,
jvm_includes = { glob = "usr/lib/jvm/include/**" } | OutputData,
},

attrs =
{
upstream_version = version,
license_spdx = "GPL-2.0-only WITH Classpath-exception-2.0",
source_provenance = {
category = 'GithubRepo,
owner = "adoptium",
repo = "temurin25-binaries",
},
} | Attrs,

tests = {
java_version =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "java -version 2>&1 | grep -q 'version \"25'"],
],
} | Test,

javac_compile =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "echo 'public class Hi { public static void main(String[] a) { System.out.println(\"ok\"); } }' > Hi.java"],
["/bin/javac", "Hi.java"],
["/bin/bash", "-c", "java Hi | grep -q '^ok$'"],
],
} | Test,
},
} | BuildSpec
23 changes: 23 additions & 0 deletions packages/jdk-25/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/sh
set -ex

case $(uname -m) in
x86_64) PLATFORM="x64" ;;
aarch64) PLATFORM="aarch64" ;;
*) echo "unsupported architecture: $(uname -m)" >&2; exit 1 ;;
esac

tar -xof "OpenJDK25U-jdk_${PLATFORM}_linux_hotspot_${MINIMAL_ARG_VERSION}_${MINIMAL_ARG_BUILD_NUM}.tar.gz"
cd "jdk-${MINIMAL_ARG_VERSION}+${MINIMAL_ARG_BUILD_NUM}"

mkdir -p $OUTPUT_DIR/usr/{bin,lib/jvm}

# Install the JDK
cp -r . $OUTPUT_DIR/usr/lib/jvm/

# Put every JDK tool on PATH (jdb, jcmd, jfr, jstack, jmap, javap, jdeps,
# javadoc, ... -- not just the eight that used to be listed here).
for path in "$OUTPUT_DIR"/usr/lib/jvm/bin/*; do
bin=$(basename "$path")
ln -sv "../lib/jvm/bin/$bin" "$OUTPUT_DIR/usr/bin/$bin"
done
95 changes: 9 additions & 86 deletions packages/jdk/build.ncl
Original file line number Diff line number Diff line change
@@ -1,91 +1,14 @@
let { Attrs, BuildSpec, Local, OutputBin, OutputData, OutputLib, Source, Test, .. } = import "minimal.ncl" in
let { target, .. } = import "config.ncl" in
let base = import "../base/build.ncl" in
let alsa-lib = import "../alsa-lib/build.ncl" in
let glibc = import "../glibc/build.ncl" in
let zlib = import "../zlib/build.ncl" in

let version = "21.0.12.1" in
let build_num = "1" in
let dl_base = "https://github.com/adoptium/temurin21-binaries/releases/download/jdk-%{version}+%{build_num}" in

let { amd64_sha256, arm64_sha256 } = {
amd64_sha256 = "ce79869e1307ed8ee1e2baa86a412b1eb5b75d10a01006d788a6f968bcfaee94",
arm64_sha256 = "23e37e026f12f3e706f18938ff611db3032d075b09d0879a25d06718c773e223",
}
in

let { BuildSpec, .. } = import "minimal.ncl" in
let jdk-25 = import "../jdk-25/build.ncl" in
# `jdk` is the CURRENT Java LTS: a meta-package over the versioned line
# (same shape as `toolchain`). Projects that need a specific line depend on
# jdk-21 / jdk-25 / jdk-27 directly; when the next LTS lands, this one moves.
{
name = "jdk",
build_deps = [
{ file = "build.sh" } | Local,
match {
{ arch = 'Amd64, .. } =>
{
url = "%{dl_base}/OpenJDK21U-jdk_x64_linux_hotspot_%{version}_%{build_num}.tar.gz",
sha256 = amd64_sha256,
} | Source,
{ arch = 'Arm64, .. } =>
{
url = "%{dl_base}/OpenJDK21U-jdk_aarch64_linux_hotspot_%{version}_%{build_num}.tar.gz",
sha256 = arm64_sha256,
} | Source,
} target,
base,
],
build_deps = [],
runtime_deps = [
alsa-lib,
glibc,
zlib,
jdk-25,
],

cmd = "./build.sh",
build_args = {
include version,
include build_num,
},

outputs = {
bins = { glob = "usr/bin/*" } | OutputBin,

jvm_bins = { glob = "usr/lib/jvm/bin/*" } | OutputBin,
jvm_libs = { glob = "usr/lib/jvm/lib/**/*.so*" } | OutputLib,
jvm_libdata = { glob = "usr/lib/jvm/lib/**", allow_executable = true } | OutputData,

jvm_data = { glob = "usr/lib/jvm/{jmod,conf,legal}/**" } | OutputData,
jvm_includes = { glob = "usr/lib/jvm/include/**" } | OutputData,
},

attrs =
{
upstream_version = version,
license_spdx = "GPL-2.0-only WITH Classpath-exception-2.0",
source_provenance = {
category = 'GithubRepo,
owner = "adoptium",
repo = "temurin21-binaries",
},
} | Attrs,

tests = {
java_version =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "java -version 2>&1 | grep -q '21'"],
],
} | Test,

javac_compile =
{
class = 'Standalone,
test_deps = [base],
cmds = [
["/bin/bash", "-c", "echo 'public class Hi { public static void main(String[] a) { System.out.println(\"ok\"); } }' > Hi.java"],
["/bin/javac", "Hi.java"],
["/bin/bash", "-c", "java Hi | grep -q '^ok$'"],
],
} | Test,
},
cmd = "",
outputs = {},
} | BuildSpec
13 changes: 11 additions & 2 deletions stacks/gradle/stack.ncl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
let { stack, .. } = import "minimal.ncl" in
stack {
name = "gradle",
build_packages = ["gradle", "jdk", "base", "curl"],
runtime_packages = ["jdk"],
# Pinned to the current LTS line (jdk-25), not the `jdk` meta, so a project's
# Java does not move when the meta next rolls to a new LTS.
build_packages = ["gradle", "jdk-25", "base", "curl"],
runtime_packages = ["jdk-25"],
build_env_vars = {
JAVA_HOME = "/usr/lib/jvm",
},
Expand All @@ -15,5 +17,12 @@ stack {
{
file_regexes."settings.gradle" = "*",
},
# Kotlin DSL: `gradle init`'s default since Gradle 8.2.
{
file_regexes."build.gradle.kts" = "*",
},
{
file_regexes."settings.gradle.kts" = "*",
},
],
}
6 changes: 4 additions & 2 deletions stacks/maven/stack.ncl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
let { stack, .. } = import "minimal.ncl" in
stack {
name = "maven",
build_packages = ["maven", "jdk", "base", "curl"],
runtime_packages = ["jdk"],
# Pinned to the current LTS line (jdk-25), not the `jdk` meta, so a project's
# Java does not move when the meta next rolls to a new LTS.
build_packages = ["maven", "jdk-25", "base", "curl"],
runtime_packages = ["jdk-25"],
build_env_vars = {
JAVA_HOME = "/usr/lib/jvm",
MAVEN_OPTS = "-Dmaven.repo.local=/state/m2/repository",
Expand Down
Loading
0