graalvmCEPackages: reorganize each product in its own subdirectory

This commit is contained in:
Thiago Kenji Okada 2023-09-26 18:49:33 +01:00
parent 8374f4d793
commit 3e9ecc840b
11 changed files with 11 additions and 8 deletions

View File

@ -20,9 +20,10 @@ let
"aarch64-darwin" = "macos-aarch64";
"x86_64-darwin" = "macos-x64";
};
version = product: (import (./. + "/hashes-${product}.nix")).version;
source = product: (import (./. + "/hashes-${product}.nix")).${product}.${javaPlatform.${stdenv.system}}
or (import (./. + "/hashes-${product}.nix")).${product}.${javaPlatformForProducts.${stdenv.system}}
hashes = product: (import (./. + "/${product}/hashes.nix"));
version = product: (hashes product).version;
source = product: (hashes product).${product}.${javaPlatform.${stdenv.system}}
or (hashes product).${product}.${javaPlatformForProducts.${stdenv.system}}
or (throw "Unsupported product combination: product=${product} system=${stdenv.system}");
in
rec {
@ -34,22 +35,22 @@ rec {
meta.platforms = builtins.attrNames javaPlatform;
};
graaljs = callPackage ./graaljs.nix {
graaljs = callPackage ./graaljs {
version = version "graaljs";
src = fetchurl (source "graaljs");
};
graalnodejs = callPackage ./graalnodejs.nix {
graalnodejs = callPackage ./graalnodejs {
version = "21";
src = fetchurl (source "graalnodejs");
};
graalpy = callPackage ./graalpy.nix {
graalpy = callPackage ./graalpy {
version = version "graalpy";
src = fetchurl (source "graalpy");
};
truffleruby = callPackage ./truffleruby.nix {
truffleruby = callPackage ./truffleruby {
version = version "truffleruby";
src = fetchurl (source "truffleruby");
};

View File

@ -29,9 +29,11 @@ verlte() {
}
readonly product="${1:-graalvm-ce}"
readonly hashes_nix="hashes-$product.nix"
readonly hashes_nix="$product/hashes.nix"
readonly nixpkgs=../../../../..
mkdir -p "$product"
declare -r -A update_urls=(
[graalvm-ce]="https://api.github.com/repos/graalvm/graalvm-ce-builds/releases/latest"
[graaljs]="https://api.github.com/repos/oracle/graaljs/releases/latest"