graalvmCEProducts: generate version inside update.sh script

This commit is contained in:
Thiago Kenji Okada 2023-09-26 15:26:44 +01:00
parent 681f8bfb32
commit fef3db632a
4 changed files with 6 additions and 6 deletions

View File

@ -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");
};
}

View File

@ -1,5 +1,6 @@
# Generated by pkgs/development/compilers/graalvm/community-edition/update.sh script
{
"version" = "23.1.0";
"graalpy" = {
"linux-aarch64" = {
sha256 = "0n0zz86h7jsqgdiyj6vj7qw57ny40jpmfvylyxq70riy86a4zp67";

View File

@ -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";

View File

@ -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"