diff options
author | Thiago Kenji Okada <thiagokokada@gmail.com> | 2023-09-27 14:43:24 +0100 |
---|---|---|
committer | Thiago Kenji Okada <thiagokokada@gmail.com> | 2023-09-27 16:22:24 +0100 |
commit | 924991888a04516a437175e9ca38f1b64f0fb069 (patch) | |
tree | 899edc8b997c56a187dacd7c1e5159e18782d5e1 | |
parent | 55d52249a78efa4bab99a9b2d617ec35d0bc9143 (diff) | |
download | nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.tar nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.tar.gz nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.tar.bz2 nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.tar.lz nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.tar.xz nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.tar.zst nixpkgs-924991888a04516a437175e9ca38f1b64f0fb069.zip |
graalvmCEPackages: refactor
12 files changed, 50 insertions, 56 deletions
diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index e855bd2a7da..4c3c1641548 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -4,41 +4,18 @@ , fetchurl }: -let +{ buildGraalvm = callPackage ./buildGraalvm.nix; + buildGraalvmProduct = callPackage ./buildGraalvmProduct.nix; - hashes = product: (import (./. + "/${product}/hashes.nix")); - version = product: (hashes product).version; - platforms = product: builtins.attrNames (hashes product).${product}; - source = product: (hashes product).${product}.${stdenv.system} - or (throw "Unsupported product combination: product=${product} system=${stdenv.system}"); -in -rec { - inherit buildGraalvm buildGraalvmProduct; - graalvm-ce = buildGraalvm { - version = version "graalvm-ce"; - src = fetchurl (source "graalvm-ce"); - meta.platforms = platforms "graalvm-ce"; - }; + graalvm-ce = callPackage ./graalvm-ce { }; - graaljs = callPackage ./graaljs { - version = version "graaljs"; - src = fetchurl (source "graaljs"); - }; + graaljs = callPackage ./graaljs { }; - graalnodejs = callPackage ./graalnodejs { - version = "21"; - src = fetchurl (source "graalnodejs"); - }; + graalnodejs = callPackage ./graalnodejs { }; - graalpy = callPackage ./graalpy { - version = version "graalpy"; - src = fetchurl (source "graalpy"); - }; + graalpy = callPackage ./graalpy { }; - truffleruby = callPackage ./truffleruby { - version = version "truffleruby"; - src = fetchurl (source "truffleruby"); - }; + truffleruby = callPackage ./truffleruby { }; } diff --git a/pkgs/development/compilers/graalvm/community-edition/graaljs/default.nix b/pkgs/development/compilers/graalvm/community-edition/graaljs/default.nix index 00aafa51d7c..0a7f04052bb 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graaljs/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graaljs/default.nix @@ -1,10 +1,12 @@ -{ graalvmCEPackages -, src -, version +{ stdenv +, fetchurl +, graalvmCEPackages }: graalvmCEPackages.buildGraalvmProduct { - inherit src version; + src = fetchurl (import ./hashes.nix).hashes.${stdenv.system}; + version = (import ./hashes.nix).version; + product = "js-installable-svm"; doInstallCheck = true; diff --git a/pkgs/development/compilers/graalvm/community-edition/graaljs/hashes.nix b/pkgs/development/compilers/graalvm/community-edition/graaljs/hashes.nix index 8dab59fe1da..7be76a1cb6e 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graaljs/hashes.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graaljs/hashes.nix @@ -1,7 +1,7 @@ -# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script +# Generated by ./update.sh script { "version" = "23.1.0"; - "graaljs" = { + "hashes" = { "aarch64-linux" = { sha256 = "09q88nsbz0lrl866x3hqxm3hb5wpn4x5rp6pk69x1v6xzl58wzq2"; url = "https://github.com/oracle/graaljs/releases/download/graal-23.1.0/graaljs-community-23.1.0-linux-aarch64.tar.gz"; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalnodejs/default.nix b/pkgs/development/compilers/graalvm/community-edition/graalnodejs/default.nix index cc38253657c..fb6d1595bbf 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalnodejs/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graalnodejs/default.nix @@ -1,10 +1,12 @@ -{ graalvmCEPackages -, src -, version +{ stdenv +, fetchurl +, graalvmCEPackages }: graalvmCEPackages.buildGraalvmProduct { - inherit src version; + src = fetchurl (import ./hashes.nix).hashes.${stdenv.system}; + version = (import ./hashes.nix).version; + product = "nodejs-installable-svm"; doInstallCheck = true; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalnodejs/hashes.nix b/pkgs/development/compilers/graalvm/community-edition/graalnodejs/hashes.nix index 0874c37ca99..516098f8b40 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalnodejs/hashes.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graalnodejs/hashes.nix @@ -1,7 +1,7 @@ -# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script +# Generated by ./update.sh script { "version" = "23.1.0"; - "graalnodejs" = { + "hashes" = { "aarch64-linux" = { sha256 = "056x616pp0b25wsryzrfrfnjaxr3444fc3hmv8jspl4pjxjrais2"; url = "https://github.com/oracle/graaljs/releases/download/graal-23.1.0/graalnodejs-community-23.1.0-linux-aarch64.tar.gz"; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalpy/default.nix b/pkgs/development/compilers/graalvm/community-edition/graalpy/default.nix index 3526f9fc0b3..e2b28500f7f 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalpy/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graalpy/default.nix @@ -1,10 +1,12 @@ -{ graalvmCEPackages -, src -, version +{ stdenv +, fetchurl +, graalvmCEPackages }: graalvmCEPackages.buildGraalvmProduct { - inherit src version; + src = fetchurl (import ./hashes.nix).hashes.${stdenv.system}; + version = (import ./hashes.nix).version; + product = "graalpy"; doInstallCheck = true; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalpy/hashes.nix b/pkgs/development/compilers/graalvm/community-edition/graalpy/hashes.nix index 21dfb4db4d0..ecebf6f3457 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalpy/hashes.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graalpy/hashes.nix @@ -1,7 +1,7 @@ -# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script +# Generated by ./update.sh script { "version" = "23.1.0"; - "graalpy" = { + "hashes" = { "aarch64-linux" = { sha256 = "0n0zz86h7jsqgdiyj6vj7qw57ny40jpmfvylyxq70riy86a4zp67"; url = "https://github.com/oracle/graalpython/releases/download/graal-23.1.0/graalpy-community-23.1.0-linux-aarch64.tar.gz"; diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix new file mode 100644 index 00000000000..a514fe80624 --- /dev/null +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/default.nix @@ -0,0 +1,10 @@ +{ stdenv +, fetchurl +, graalvmCEPackages +}: + +graalvmCEPackages.buildGraalvm { + src = fetchurl (import ./hashes.nix).hashes.${stdenv.system}; + version = (import ./hashes.nix).version; + meta.platforms = builtins.attrNames (import ./hashes.nix).hashes; +} diff --git a/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/hashes.nix b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/hashes.nix index ece96612877..f757e1b797b 100644 --- a/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/hashes.nix +++ b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/hashes.nix @@ -1,7 +1,7 @@ -# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script +# Generated by ./update.sh script { "version" = "21.0.0"; - "graalvm-ce" = { + "hashes" = { "aarch64-linux" = { sha256 = "199h3d6zayw28xlyggldap6nafh5fnpfbshs0rsf94dfgv7r4kmv"; url = "https://github.com/graalvm/graalvm-ce-builds/releases/download/jdk-21.0.0/graalvm-community-jdk-21.0.0_linux-aarch64_bin.tar.gz"; diff --git a/pkgs/development/compilers/graalvm/community-edition/truffleruby/default.nix b/pkgs/development/compilers/graalvm/community-edition/truffleruby/default.nix index bb4a00325b7..95e9c56fc23 100644 --- a/pkgs/development/compilers/graalvm/community-edition/truffleruby/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/truffleruby/default.nix @@ -1,14 +1,15 @@ { lib , stdenv +, fetchurl , graalvmCEPackages , libyaml , openssl -, src -, version }: graalvmCEPackages.buildGraalvmProduct { - inherit src version; + src = fetchurl (import ./hashes.nix).hashes.${stdenv.system}; + version = (import ./hashes.nix).version; + product = "truffleruby"; extraBuildInputs = [ diff --git a/pkgs/development/compilers/graalvm/community-edition/truffleruby/hashes.nix b/pkgs/development/compilers/graalvm/community-edition/truffleruby/hashes.nix index c61a42cc871..592cdd7ab2d 100644 --- a/pkgs/development/compilers/graalvm/community-edition/truffleruby/hashes.nix +++ b/pkgs/development/compilers/graalvm/community-edition/truffleruby/hashes.nix @@ -1,7 +1,7 @@ -# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script +# Generated by ./update.sh script { "version" = "23.1.0"; - "truffleruby" = { + "hashes" = { "aarch64-linux" = { sha256 = "05q0xqm7qa9mw7v4kwyhbqsx27x19msf9rbbzq60dinp5724r721"; url = "https://github.com/oracle/truffleruby/releases/download/graal-23.1.0/truffleruby-community-23.1.0-linux-aarch64.tar.gz"; diff --git a/pkgs/development/compilers/graalvm/community-edition/update.sh b/pkgs/development/compilers/graalvm/community-edition/update.sh index 3b1445bd649..f0a131571b6 100755 --- a/pkgs/development/compilers/graalvm/community-edition/update.sh +++ b/pkgs/development/compilers/graalvm/community-edition/update.sh @@ -99,7 +99,7 @@ echo_file "# Generated by $0 script" echo_file "{" echo_file " \"version\" = \"$new_version\";" url="${products_urls["${product}"]}" -echo_file " \"$product\" = {" +echo_file " \"hashes\" = {" for nix_platform in "${!platforms[@]}"; do product_platform="${platforms[$nix_platform]}" args=("${url//@platform@/$product_platform}") |