From 3e9ecc840b778c82db5288b2239bac2612ebf1e4 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Tue, 26 Sep 2023 18:49:33 +0100 Subject: [PATCH] graalvmCEPackages: reorganize each product in its own subdirectory --- .../graalvm/community-edition/default.nix | 15 ++++++++------- .../{graaljs.nix => graaljs/default.nix} | 0 .../{hashes-graaljs.nix => graaljs/hashes.nix} | 0 .../{graalnodejs.nix => graalnodejs/default.nix} | 0 .../hashes.nix} | 0 .../{graalpy.nix => graalpy/default.nix} | 0 .../{hashes-graalpy.nix => graalpy/hashes.nix} | 0 .../hashes.nix} | 0 .../{truffleruby.nix => truffleruby/default.nix} | 0 .../hashes.nix} | 0 .../compilers/graalvm/community-edition/update.sh | 4 +++- 11 files changed, 11 insertions(+), 8 deletions(-) rename pkgs/development/compilers/graalvm/community-edition/{graaljs.nix => graaljs/default.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{hashes-graaljs.nix => graaljs/hashes.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{graalnodejs.nix => graalnodejs/default.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{hashes-graalnodejs.nix => graalnodejs/hashes.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{graalpy.nix => graalpy/default.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{hashes-graalpy.nix => graalpy/hashes.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{hashes-graalvm-ce.nix => graalvm-ce/hashes.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{truffleruby.nix => truffleruby/default.nix} (100%) rename pkgs/development/compilers/graalvm/community-edition/{hashes-truffleruby.nix => truffleruby/hashes.nix} (100%) diff --git a/pkgs/development/compilers/graalvm/community-edition/default.nix b/pkgs/development/compilers/graalvm/community-edition/default.nix index bae453487679..726db815fe4e 100644 --- a/pkgs/development/compilers/graalvm/community-edition/default.nix +++ b/pkgs/development/compilers/graalvm/community-edition/default.nix @@ -20,9 +20,10 @@ 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}} + hashes = product: (import (./. + "/${product}/hashes.nix")); + version = product: (hashes product).version; + source = product: (hashes product).${product}.${javaPlatform.${stdenv.system}} + or (hashes product).${product}.${javaPlatformForProducts.${stdenv.system}} or (throw "Unsupported product combination: product=${product} system=${stdenv.system}"); in rec { @@ -34,22 +35,22 @@ rec { meta.platforms = builtins.attrNames javaPlatform; }; - graaljs = callPackage ./graaljs.nix { + graaljs = callPackage ./graaljs { version = version "graaljs"; src = fetchurl (source "graaljs"); }; - graalnodejs = callPackage ./graalnodejs.nix { + graalnodejs = callPackage ./graalnodejs { version = "21"; src = fetchurl (source "graalnodejs"); }; - graalpy = callPackage ./graalpy.nix { + graalpy = callPackage ./graalpy { version = version "graalpy"; src = fetchurl (source "graalpy"); }; - truffleruby = callPackage ./truffleruby.nix { + truffleruby = callPackage ./truffleruby { version = version "truffleruby"; src = fetchurl (source "truffleruby"); }; diff --git a/pkgs/development/compilers/graalvm/community-edition/graaljs.nix b/pkgs/development/compilers/graalvm/community-edition/graaljs/default.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/graaljs.nix rename to pkgs/development/compilers/graalvm/community-edition/graaljs/default.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-graaljs.nix b/pkgs/development/compilers/graalvm/community-edition/graaljs/hashes.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/hashes-graaljs.nix rename to pkgs/development/compilers/graalvm/community-edition/graaljs/hashes.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/graalnodejs.nix b/pkgs/development/compilers/graalvm/community-edition/graalnodejs/default.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/graalnodejs.nix rename to pkgs/development/compilers/graalvm/community-edition/graalnodejs/default.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-graalnodejs.nix b/pkgs/development/compilers/graalvm/community-edition/graalnodejs/hashes.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/hashes-graalnodejs.nix rename to pkgs/development/compilers/graalvm/community-edition/graalnodejs/hashes.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/graalpy.nix b/pkgs/development/compilers/graalvm/community-edition/graalpy/default.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/graalpy.nix rename to pkgs/development/compilers/graalvm/community-edition/graalpy/default.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-graalpy.nix b/pkgs/development/compilers/graalvm/community-edition/graalpy/hashes.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/hashes-graalpy.nix rename to pkgs/development/compilers/graalvm/community-edition/graalpy/hashes.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-graalvm-ce.nix b/pkgs/development/compilers/graalvm/community-edition/graalvm-ce/hashes.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/hashes-graalvm-ce.nix rename to pkgs/development/compilers/graalvm/community-edition/graalvm-ce/hashes.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/truffleruby.nix b/pkgs/development/compilers/graalvm/community-edition/truffleruby/default.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/truffleruby.nix rename to pkgs/development/compilers/graalvm/community-edition/truffleruby/default.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/hashes-truffleruby.nix b/pkgs/development/compilers/graalvm/community-edition/truffleruby/hashes.nix similarity index 100% rename from pkgs/development/compilers/graalvm/community-edition/hashes-truffleruby.nix rename to pkgs/development/compilers/graalvm/community-edition/truffleruby/hashes.nix diff --git a/pkgs/development/compilers/graalvm/community-edition/update.sh b/pkgs/development/compilers/graalvm/community-edition/update.sh index 8c648f996d9b..23c36c91a67f 100755 --- a/pkgs/development/compilers/graalvm/community-edition/update.sh +++ b/pkgs/development/compilers/graalvm/community-edition/update.sh @@ -29,9 +29,11 @@ verlte() { } readonly product="${1:-graalvm-ce}" -readonly hashes_nix="hashes-$product.nix" +readonly hashes_nix="$product/hashes.nix" readonly nixpkgs=../../../../.. +mkdir -p "$product" + declare -r -A update_urls=( [graalvm-ce]="https://api.github.com/repos/graalvm/graalvm-ce-builds/releases/latest" [graaljs]="https://api.github.com/repos/oracle/graaljs/releases/latest"