From fef3db632a0d16a7171ad5ab11f29e05953e228f Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 26 Sep 2023 15:26:44 +0100 Subject: [PATCH] graalvmCEProducts: generate version inside update.sh script --- .../compilers/graalvm/community-edition/default.nix | 5 +++-- .../compilers/graalvm/community-edition/hashes-graalpy.nix | 1 + .../graalvm/community-edition/hashes-graalvm-ce.nix | 1 + .../compilers/graalvm/community-edition/update.sh | 5 +---- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index aa7c2c066ec7..9218391ee723 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -20,6 +20,7 @@ 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}} or (throw "Unsupported product combination: product=${product} system=${stdenv.system}"); @@ -28,13 +29,13 @@ rec { inherit buildGraalvm buildGraalvmProduct; graalvm-ce = buildGraalvm { - version = "21.0.0"; + version = version "graalvm-ce"; src = fetchurl (source "graalvm-ce"); meta.platforms = builtins.attrNames javaPlatform; }; graalpy = callPackage ./graalpy.nix { - version = "23.1.0"; + version = version "graalpy"; src = fetchurl (source "graalpy"); }; } diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-graalpy.nix b/pkgs/development/compilers/graalvm/community-edition/hashes-graalpy.nix index e8ce2ef4626f..3e543b44569b 100644 --- a/pkgs/development/compilers/graalvm/community-edition/hashes-graalpy.nix +++ b/pkgs/development/compilers/graalvm/community-edition/hashes-graalpy.nix @@ -1,5 +1,6 @@ # Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script { + "version" = "23.1.0"; "graalpy" = { "linux-aarch64" = { sha256 = "0n0zz86h7jsqgdiyj6vj7qw57ny40jpmfvylyxq70riy86a4zp67"; diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-graalvm-ce.nix b/pkgs/development/compilers/graalvm/community-edition/hashes-graalvm-ce.nix index 401b45e9e49c..e98e87153009 100644 --- a/pkgs/development/compilers/graalvm/community-edition/hashes-graalvm-ce.nix +++ b/pkgs/development/compilers/graalvm/community-edition/hashes-graalvm-ce.nix @@ -1,5 +1,6 @@ # Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script { + "version" = "21.0.0"; "graalvm-ce" = { "linux-aarch64" = { sha256 = "199h3d6zayw28xlyggldap6nafh5fnpfbshs0rsf94dfgv7r4kmv"; diff --git a/pkgs/development/compilers/graalvm/community-edition/update.sh b/pkgs/development/compilers/graalvm/community-edition/update.sh index 10d6566b1bdd..cc3e0287ae81 100755 --- a/pkgs/development/compilers/graalvm/community-edition/update.sh +++ b/pkgs/development/compilers/graalvm/community-edition/update.sh @@ -88,6 +88,7 @@ info "Generating '$hashes_nix' file for '$product' $new_version. This will take # Indentation of `echo_file` function is on purpose to make it easier to visualize the output echo_file "# Generated by $0 script" echo_file "{" +echo_file " \"version\" = \"$new_version\";" url="${products_urls["${product}"]}" echo_file " \"$product\" = {" for platform in "${platforms[@]}"; do @@ -112,10 +113,6 @@ done echo_file " };" echo_file "}" -info "Updating '$product' version..." -# update-source-version does not work here since it expects src attribute -sed "s|$current_version|$new_version|" -i default.nix - info "Moving the temporary file to '$hashes_nix'" mv "$tmpfile" "$hashes_nix"