Skip to content

Commit

Permalink
temurin-bin, semeru-bin: init at 17.0.3, adoptopenjdk-bin: remove 13,…
Browse files Browse the repository at this point in the history
… 14, 17

AdoptOpenJDK Hotspot is now Eclipse Temurin and AdoptOpenJDK OpenJ9 is
now IBM Semeru Runtime.

Adds `temurin-bin` and `semeru-bin` packages.

AdoptOpenJDK 13, 14, and 15 is no longer supported.  AdoptOpenJDK 13 and
14 are removed.  AdoptOpenJDK 15 is left only for some packages
depending it.
  • Loading branch information
taku0 committed Sep 12, 2022
1 parent ee9eec3 commit c742218
Show file tree
Hide file tree
Showing 19 changed files with 1,044 additions and 186 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import requests
import sys

releases = ("openjdk8", "openjdk11", "openjdk13", "openjdk14", "openjdk15", "openjdk16", "openjdk17")
# openjdk15 is only for bootstrapping openjdk
releases = ("openjdk8", "openjdk11", "openjdk13", "openjdk14", "openjdk15", "openjdk16")
oses = ("mac", "linux")
types = ("jre", "jdk")
impls = ("hotspot", "openj9")
Expand All @@ -21,7 +22,7 @@
def get_sha256(url):
resp = requests.get(url)
if resp.status_code != 200:
print("error: could not fetch checksum from url {}: code {}".format(url, resp.code), file=sys.stderr)
print("error: could not fetch checksum from url {}: code {}".format(url, resp.status_code), file=sys.stderr)
sys.exit(1)
return resp.text.strip().split(" ")[0]

Expand Down
8 changes: 0 additions & 8 deletions pkgs/development/compilers/adoptopenjdk-bin/jdk17-darwin.nix

This file was deleted.

8 changes: 0 additions & 8 deletions pkgs/development/compilers/adoptopenjdk-bin/jdk17-linux.nix

This file was deleted.

54 changes: 0 additions & 54 deletions pkgs/development/compilers/adoptopenjdk-bin/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -793,60 +793,6 @@
}
}
},
"openjdk17": {
"linux": {
"jdk": {
"hotspot": {
"aarch64": {
"build": "12",
"sha256": "f23d482b2b4ada08166201d1a0e299e3e371fdca5cd7288dcbd81ae82f3a75e3",
"url": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_aarch64_linux_hotspot_17.0.1_12.tar.gz",
"version": "17.0.1"
},
"armv6l": {
"build": "12",
"sha256": "f5945a39929384235e7cb1c57df071b8c7e49274632e2a54e54b2bad05de21a5",
"url": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_arm_linux_hotspot_17.0.1_12.tar.gz",
"version": "17.0.1"
},
"armv7l": {
"build": "12",
"sha256": "f5945a39929384235e7cb1c57df071b8c7e49274632e2a54e54b2bad05de21a5",
"url": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_arm_linux_hotspot_17.0.1_12.tar.gz",
"version": "17.0.1"
},
"packageType": "jdk",
"vmType": "hotspot",
"x86_64": {
"build": "12",
"sha256": "6ea18c276dcbb8522feeebcfc3a4b5cb7c7e7368ba8590d3326c6c3efc5448b6",
"url": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz",
"version": "17.0.1"
}
}
}
},
"mac": {
"jdk": {
"hotspot": {
"aarch64": {
"build": "12",
"sha256": "02073590da24421e119ddebe6b061bf132fa68694c60706f092d32d963822554",
"url": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.1_12.tar.gz",
"version": "17.0.1"
},
"packageType": "jdk",
"vmType": "hotspot",
"x86_64": {
"build": "12",
"sha256": "98a759944a256dbdd4d1113459c7638501f4599a73d06549ac309e1982e2fa70",
"url": "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_mac_hotspot_17.0.1_12.tar.gz",
"version": "17.0.1"
}
}
}
}
},
"openjdk8": {
"linux": {
"jdk": {
Expand Down
85 changes: 85 additions & 0 deletions pkgs/development/compilers/semeru-bin/generate-sources.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/usr/bin/env nix-shell
#!nix-shell --pure -i python3 -p "python3.withPackages (ps: with ps; [ requests ])"

import json
import re
import requests
import sys

feature_versions = (8, 11, 16, 17)
oses = ("mac", "linux")
types = ("jre", "jdk")
impls = ("openj9")

arch_to_nixos = {
"x64": ("x86_64",),
"aarch64": ("aarch64",),
"arm": ("armv6l", "armv7l"),
}

def get_sha256(url):
resp = requests.get(url)
if resp.status_code != 200:
print("error: could not fetch checksum from url {}: code {}".format(url, resp.status_code), file=sys.stderr)
sys.exit(1)
return resp.text.strip().split(" ")[0]

def generate_sources(releases, feature_version, out):
latest_version = None
for release in releases:
if release["prerelease"]: continue
if not re.search("_openj9-", release["name"]): continue

for asset in release["assets"]:
match = re.match("ibm-semeru-open-(?P<image_type>[a-z]*)_(?P<architecture>[a-z0-9]*)_(?P<os>[a-z]*)_(?:(?P<major1>[0-9]*)u(?P<security1>[0-9]*)b(?P<build1>[0-9]*)|(?P<major2>[0-9]*)\\.(?P<minor2>[0-9]*)\\.(?P<security2>[0-9]*)_(?P<build2>[0-9]*))_(?P<jvm_impl>[a-z0-9]*)-[0-9]*\\.[0-9]*\\.[0-9]\\.tar\\.gz$", asset["name"])

if not match: continue
if match["os"] not in oses: continue
if match["image_type"] not in types: continue
if match["jvm_impl"] not in impls: continue
if match["architecture"] not in arch_to_nixos: continue

version = ".".join([
match["major1"] or match["major2"],
match["minor2"] or "0",
match["security1"] or match["security2"]
])
build = match["build1"] or match["build2"]

if latest_version and latest_version != (version, build): continue
latest_version = (version, build)

arch_map = (
out
.setdefault(match["jvm_impl"], {})
.setdefault(match["os"], {})
.setdefault(match["image_type"], {})
.setdefault(feature_version, {
"packageType": match["image_type"],
"vmType": match["jvm_impl"],
})
)

for nixos_arch in arch_to_nixos[match["architecture"]]:
arch_map[nixos_arch] = {
"url": asset["browser_download_url"],
"sha256": get_sha256(asset["browser_download_url"] + ".sha256.txt"),
"version": version,
"build": build,
}

return out


out = {}
for feature_version in feature_versions:
resp = requests.get(f"https://api.github.com/repos/ibmruntimes/semeru{feature_version}-binaries/releases")

if resp.status_code != 200:
print("error: could not fetch data for release {} (code {}) {}".format(feature_version, resp.status_code, resp.content), file=sys.stderr)
sys.exit(1)
generate_sources(resp.json(), f"openjdk{feature_version}", out)

with open("sources.json", "w") as f:
json.dump(out, f, indent=2, sort_keys=True)
f.write('\n')
5 changes: 5 additions & 0 deletions pkgs/development/compilers/semeru-bin/jdk-darwin-base.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
args:
import ../temurin-bin/jdk-darwin-base.nix ({
name-prefix = "semeru";
brand-name = "IBM Semeru Runtime";
} // args)
16 changes: 16 additions & 0 deletions pkgs/development/compilers/semeru-bin/jdk-darwin.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ lib, callPackage }:

let
sources = (lib.importJSON ./sources.json).openj9.mac;
common = opts: callPackage (import ./jdk-darwin-base.nix opts) {};
in
{
jdk-8 = common { sourcePerArch = sources.jdk.openjdk8; };
jre-8 = common { sourcePerArch = sources.jre.openjdk8; };
jdk-11 = common { sourcePerArch = sources.jdk.openjdk11; };
jre-11 = common { sourcePerArch = sources.jre.openjdk11; };
jdk-16 = common { sourcePerArch = sources.jdk.openjdk16; };
jre-16 = common { sourcePerArch = sources.jre.openjdk16; };
jdk-17 = common { sourcePerArch = sources.jdk.openjdk17; };
jre-17 = common { sourcePerArch = sources.jre.openjdk17; };
}
5 changes: 5 additions & 0 deletions pkgs/development/compilers/semeru-bin/jdk-linux-base.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
args:
import ../temurin-bin/jdk-linux-base.nix ({
name-prefix = "semeru";
brand-name = "IBM Semeru Runtime";
} // args)
16 changes: 16 additions & 0 deletions pkgs/development/compilers/semeru-bin/jdk-linux.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{ lib, callPackage }:

let
sources = (lib.importJSON ./sources.json).openj9.linux;
common = opts: callPackage (import ./jdk-linux-base.nix opts) {};
in
{
jdk-8 = common { sourcePerArch = sources.jdk.openjdk8; };
jre-8 = common { sourcePerArch = sources.jre.openjdk8; };
jdk-11 = common { sourcePerArch = sources.jdk.openjdk11; };
jre-11 = common { sourcePerArch = sources.jre.openjdk11; };
jdk-16 = common { sourcePerArch = sources.jdk.openjdk16; };
jre-16 = common { sourcePerArch = sources.jre.openjdk16; };
jdk-17 = common { sourcePerArch = sources.jdk.openjdk17; };
jre-17 = common { sourcePerArch = sources.jre.openjdk17; };
}

0 comments on commit c742218

Please sign in to comment.