diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2018-12-19 10:11:17 +0100 |
---|---|---|
committer | Frederik Rietdijk <fridh@fridh.nl> | 2018-12-19 10:11:17 +0100 |
commit | a9e654e1bd4fff55e54a49aebcd700da3cf7594e (patch) | |
tree | 1d97558cb6bf37a9b96d0722c8bfac079c34246a /pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py | |
parent | a06b90a7dc683f303f2135c8dc849616a11b161a (diff) | |
download | nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.tar nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.tar.gz nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.tar.bz2 nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.tar.lz nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.tar.xz nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.tar.zst nixpkgs-a9e654e1bd4fff55e54a49aebcd700da3cf7594e.zip |
Revert "adoptopenjdk: autogenerate sources + add support for aarch64 (#52454)"
This reverts commit f2dfe8b9e61a17a68190e11e6d1153a264144605, reversing changes made to e116aa1d4b2d52b12f9d810f45b80eebbbd0a2c9. The `openj9` attribute is missing for `jre` in case of `mac`. This missing attribute is now blocking the channels from updating. cc @bennofs
Diffstat (limited to 'pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py')
-rwxr-xr-x | pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py | 69 |
1 files changed, 0 insertions, 69 deletions
diff --git a/pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py b/pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py deleted file mode 100755 index 66e1abd05e9..00000000000 --- a/pkgs/development/compilers/adoptopenjdk-bin/generate-sources.py +++ /dev/null @@ -1,69 +0,0 @@ -#!/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 - -releases = ["openjdk11"] -oses = ["mac", "linux"] -types = ["jre", "jdk"] -impls = ["hotspot", "openj9"] - -arch_to_nixos = { - "x64": "x86_64", - "aarch64": "aarch64", -} - -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) - sys.exit(1) - return resp.text.strip().split(" ")[0] - -RE_RELEASE_NAME = re.compile(r'[^-]+-([0-9.]+)\+([0-9]+)') # example release name: jdk-11.0.1+13 -def generate_sources(release, assets): - out = {} - for asset in assets: - if asset["os"] not in oses: continue - if asset["binary_type"] not in types: continue - if asset["openjdk_impl"] not in impls: continue - if asset["heap_size"] != "normal": continue - if asset["architecture"] not in arch_to_nixos: continue - - version, build = RE_RELEASE_NAME.match(asset["release_name"]).groups() - - type_map = out.setdefault(asset["os"], {}) - impl_map = type_map.setdefault(asset["binary_type"], {}) - arch_map = impl_map.setdefault(asset["openjdk_impl"], { - "version": version, - "build": build, - "packageType": asset["binary_type"], - "vmType": asset["openjdk_impl"], - }) - - if arch_map["version"] != version or arch_map["build"] != build: - print("error: architectures have different latest versions ({}+{} vs {}+{})".format( - arch_map["version"], arch_map["build"], version, build - ), file=sys.stderr) - sys.exit(1) - - arch_map[arch_to_nixos[asset["architecture"]]] = { - "url": asset["binary_link"], - "sha256": get_sha256(asset["checksum_link"]), - } - - return out - -out = {} -for release in releases: - resp = requests.get("https://api.adoptopenjdk.net/v2/latestAssets/releases/" + release) - if resp.status_code != 200: - print("error: could not fetch data for release {} (code {})".format(release, resp.code), file=sys.stderr) - sys.exit(1) - out[release] = generate_sources(release, resp.json()) - -with open("sources.json", "w") as f: - json.dump(out, f, indent=2, sort_keys=True) |