about summary refs log tree commit diff
path: root/pkgs/development/compilers/graalvm/community-edition/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/graalvm/community-edition/default.nix')
-rw-r--r--pkgs/development/compilers/graalvm/community-edition/default.nix217
1 files changed, 155 insertions, 62 deletions
diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix
index 17ecd5060ba29..a0d57b75faa2e 100644
--- a/pkgs/development/compilers/graalvm/community-edition/default.nix
+++ b/pkgs/development/compilers/graalvm/community-edition/default.nix
@@ -1,75 +1,168 @@
-{ callPackage, Foundation }:
-/*
-  Add new graal versions and products here and then see update.nix on how to
-  generate the sources.
-*/
+{ lib
+, stdenv
+, callPackage
+, fetchurl
+}:
 
 let
-  mkGraal = opts: callPackage (import ./mkGraal.nix opts) {
-    inherit Foundation;
+  buildGraalvm = callPackage ./buildGraalvm.nix;
+  buildGraalvmProduct = callPackage ./buildGraalvmProduct.nix;
+  javaPlatform = {
+    "aarch64-linux" = "linux-aarch64";
+    "x86_64-linux" = "linux-amd64";
+    "aarch64-darwin" = "darwin-aarch64";
+    "x86_64-darwin" = "darwin-amd64";
   };
+  javaPlatformVersion = javaVersion:
+    "${javaVersion}-${javaPlatform.${stdenv.system} or (throw "Unsupported platform: ${stdenv.system}")}";
+  source = product: javaVersion: (import ./hashes.nix).${product}.${javaPlatformVersion javaVersion}
+    or (throw "Unsupported product combination: product=${product} java=${javaVersion} system=${stdenv.system}");
 
-  /*
-    Looks a bit ugly but makes version update in the update script using sed
-    much easier
+in
+rec {
+  inherit buildGraalvm buildGraalvmProduct;
 
-    Don't change these values! They will be updated by the update script, see ./update.nix.
-  */
-  graalvm11-ce-release-version = "22.3.0";
-  graalvm17-ce-release-version = "22.3.0";
+  ### Java 11 ###
 
-  products = [
-    "graalvm-ce"
-    "native-image-installable-svm"
-  ];
+  # Mostly available for build purposes, not to be exposed at the top level
+  graalvm11-ce-bare = buildGraalvm rec {
+    version = "22.3.1";
+    javaVersion = "11";
+    src = fetchurl (source "graalvm-ce" javaVersion);
+    meta.platforms = builtins.attrNames javaPlatform;
+    products = [ ];
+  };
 
-in
-{
-  inherit mkGraal;
-
-  graalvm11-ce = mkGraal rec {
-    config = {
-      x86_64-darwin = {
-        inherit products;
-        arch = "darwin-amd64";
-      };
-      x86_64-linux = {
-        inherit products;
-        arch = "linux-amd64";
-      };
-      aarch64-darwin = {
-        inherit products;
-        arch = "darwin-aarch64";
-      };
-      aarch64-linux = {
-        inherit products;
-        arch = "linux-aarch64";
-      };
-    };
-    defaultVersion = graalvm11-ce-release-version;
+  graalvm11-ce = graalvm11-ce-bare.override {
+    products = [ native-image-installable-svm-java11 ];
+  };
+
+  # Mostly available for testing, not to be exposed at the top level
+  graalvm11-ce-full = graalvm11-ce-bare.override {
+    products = [
+      js-installable-svm-java11
+      llvm-installable-svm-java11
+      native-image-installable-svm-java11
+      nodejs-installable-svm-java11
+      python-installable-svm-java11
+      ruby-installable-svm-java11
+      wasm-installable-svm-java11
+    ];
+  };
+
+  js-installable-svm-java11 = callPackage ./js-installable-svm.nix rec {
+    javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "js-installable-svm" javaVersion);
+  };
+
+  llvm-installable-svm-java11 = callPackage ./llvm-installable-svm.nix rec {
+    javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "llvm-installable-svm" javaVersion);
+  };
+
+  native-image-installable-svm-java11 = callPackage ./native-image-installable-svm.nix rec {
+    javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "native-image-installable-svm" javaVersion);
+  };
+
+  nodejs-installable-svm-java11 = callPackage ./nodejs-installable-svm.nix rec {
+    javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "nodejs-installable-svm" javaVersion);
+    graalvm-ce = graalvm11-ce-bare;
+  };
+
+  python-installable-svm-java11 = callPackage ./python-installable-svm.nix rec {
+    javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "python-installable-svm" javaVersion);
+  };
+
+  ruby-installable-svm-java11 = callPackage ./ruby-installable-svm.nix rec {
+    javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "ruby-installable-svm" javaVersion);
+    llvm-installable-svm = llvm-installable-svm-java11;
+  };
+
+  wasm-installable-svm-java11 = callPackage ./wasm-installable-svm.nix rec {
     javaVersion = "11";
+    version = "22.3.1";
+    src = fetchurl (source "wasm-installable-svm" javaVersion);
+  };
+
+  ### Java 17 ###
+
+  # Mostly available for build purposes, not to be exposed at the top level
+  graalvm17-ce-bare = buildGraalvm rec {
+    version = "22.3.1";
+    javaVersion = "17";
+    src = fetchurl (source "graalvm-ce" javaVersion);
+    meta.platforms = builtins.attrNames javaPlatform;
+    products = [ ];
+  };
+
+  graalvm17-ce = graalvm17-ce-bare.override {
+    products = [ native-image-installable-svm-java17 ];
+  };
+
+  # Mostly available for testing, not to be exposed at the top level
+  graalvm17-ce-full = graalvm17-ce-bare.override {
+    products = [
+      js-installable-svm-java17
+      llvm-installable-svm-java17
+      native-image-installable-svm-java17
+      nodejs-installable-svm-java17
+      python-installable-svm-java17
+      ruby-installable-svm-java17
+      wasm-installable-svm-java17
+    ];
+  };
+
+  js-installable-svm-java17 = callPackage ./js-installable-svm.nix rec {
+    javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "js-installable-svm" javaVersion);
+  };
+
+  llvm-installable-svm-java17 = callPackage ./llvm-installable-svm.nix rec {
+    javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "llvm-installable-svm" javaVersion);
+  };
+
+  native-image-installable-svm-java17 = callPackage ./native-image-installable-svm.nix rec {
+    javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "native-image-installable-svm" javaVersion);
+  };
+
+  nodejs-installable-svm-java17 = callPackage ./nodejs-installable-svm.nix rec {
+    javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "nodejs-installable-svm" javaVersion);
+    graalvm-ce = graalvm17-ce-bare;
+  };
+
+  python-installable-svm-java17 = callPackage ./python-installable-svm.nix rec {
+    javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "python-installable-svm" javaVersion);
+  };
+
+  ruby-installable-svm-java17 = callPackage ./ruby-installable-svm.nix rec {
+    javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "ruby-installable-svm" javaVersion);
+    llvm-installable-svm = llvm-installable-svm-java17;
   };
 
-  graalvm17-ce = mkGraal rec {
-    config = {
-      x86_64-darwin = {
-        inherit products;
-        arch = "darwin-amd64";
-      };
-      x86_64-linux = {
-        inherit products;
-        arch = "linux-amd64";
-      };
-      aarch64-darwin = {
-        inherit products;
-        arch = "darwin-aarch64";
-      };
-      aarch64-linux = {
-        inherit products;
-        arch = "linux-aarch64";
-      };
-    };
-    defaultVersion = graalvm17-ce-release-version;
+  wasm-installable-svm-java17 = callPackage ./wasm-installable-svm.nix rec {
     javaVersion = "17";
+    version = "22.3.1";
+    src = fetchurl (source "wasm-installable-svm" javaVersion);
   };
 }