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.nix71
1 files changed, 66 insertions, 5 deletions
diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix
index f53e9a03896..6f42bfcc453 100644
--- a/pkgs/development/compilers/graalvm/community-edition/default.nix
+++ b/pkgs/development/compilers/graalvm/community-edition/default.nix
@@ -1,17 +1,60 @@
-{ lib, callPackage, Foundation }:
+{ callPackage, Foundation }:
+/*
+  Add new graal versions and products here and then see update.nix on how to
+  generate the sources.
+*/
 
 let
   mkGraal = opts: callPackage (import ./mkGraal.nix opts) {
     inherit Foundation;
   };
+
+  /*
+    Looks a bit ugly but makes version update in the update script using sed
+    much easier
+  */
+  graalvm11-ce-release-version = "22.0.0.2";
+  graalvm17-ce-release-version = "22.0.0.2";
+  graalvm11-ce-dev-version = "22.2.0-dev-20220401_1942";
+  graalvm17-ce-dev-version = "22.2.0-dev-20220401_1942";
+
+  commonProducts = [
+    "graalvm-ce"
+    "native-image-installable-svm"
+    "ruby-installable-svm"
+    "wasm-installable-svm"
+  ];
+
 in
 {
   inherit mkGraal;
 
   graalvm11-ce = mkGraal rec {
-    version = "22.0.0.2";
+    config = {
+      x86_64-darwin = {
+        arch = "darwin-amd64";
+        products = commonProducts ++ [ "python-installable-svm" ];
+      };
+      x86_64-linux = {
+        arch = "linux-amd64";
+        products = commonProducts ++ [ "python-installable-svm" ];
+      };
+      aarch64-darwin = {
+        arch = "darwin-aarch64";
+        products = [
+          "graalvm-ce"
+          "native-image-installable-svm"
+        ];
+        version = graalvm11-ce-dev-version;
+      };
+      aarch64-linux = {
+        arch = "linux-aarch64";
+        products = commonProducts;
+      };
+    };
+    defaultVersion = graalvm11-ce-release-version;
     javaVersion = "11";
-    platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
+    platforms = builtins.attrNames config;
   };
 
   # TODO: fix aarch64-linux, failing during Native Image compilation
@@ -20,8 +63,26 @@ in
   # directory"/tmp/SVM-4194439592488143713"): error=0, Failed to exec spawn
   # helper: pid: 19865, exit value: 1"
   graalvm17-ce = mkGraal rec {
-    version = "22.0.0.2";
+    config = {
+      x86_64-darwin = {
+        arch = "darwin-amd64";
+        products = commonProducts ++ [ "python-installable-svm" ];
+      };
+      x86_64-linux = {
+        arch = "linux-amd64";
+        products = commonProducts ++ [ "python-installable-svm" ];
+      };
+      aarch64-darwin = {
+        arch = "darwin-aarch64";
+        products = [
+          "graalvm-ce"
+          "native-image-installable-svm"
+        ];
+        version = graalvm17-ce-dev-version;
+      };
+    };
+    defaultVersion = graalvm17-ce-release-version;
     javaVersion = "17";
-    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    platforms = builtins.attrNames config;
   };
 }