forked from NixOS/nixpkgs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temurin-bin, semeru-bin: init at 17.0.3, adoptopenjdk-bin: remove 13,…
… 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
Showing
19 changed files
with
1,044 additions
and
186 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; }; | ||
} |
Oops, something went wrong.