diff options
author | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2024-03-24 11:04:41 +0100 |
commit | 5423cabbbf2b6dec5568f1ecabd288d5d9a642ec (patch) | |
tree | f316a6a921bfefd3a63bd4502c2eb50ff1644f67 /nixpkgs/pkgs/development/rocm-modules/6/update.nix | |
parent | 46a88117a05c3469af5d99433af140c3de8ca088 (diff) | |
parent | 8aa81f34981add12aecada6c702ddbbd0375ca36 (diff) | |
download | nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.gz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.bz2 nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.lz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.xz nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.tar.zst nixlib-5423cabbbf2b6dec5568f1ecabd288d5d9a642ec.zip |
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/rocm-modules/6/update.nix')
-rw-r--r-- | nixpkgs/pkgs/development/rocm-modules/6/update.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/rocm-modules/6/update.nix b/nixpkgs/pkgs/development/rocm-modules/6/update.nix new file mode 100644 index 000000000000..4d531e6bb176 --- /dev/null +++ b/nixpkgs/pkgs/development/rocm-modules/6/update.nix @@ -0,0 +1,33 @@ +{ lib +, writeScript +}: + +{ name ? "" +, owner ? "" +, repo ? "" +, page ? "releases/latest" +, filter ? ".tag_name | split(\"-\") | .[1]" +}: + +let + pname = + if lib.hasPrefix "rocm-llvm-" name + then "llvm.${lib.removePrefix "rocm-llvm-" name}" + else name; + + updateScript = writeScript "update.sh" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl jq common-updater-scripts + version="$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \ + -sL "https://api.github.com/repos/${owner}/${repo}/${page}" | jq '${filter}' --raw-output)" + + IFS='.' read -a version_arr <<< "$version" + + if (( ''${version_arr[0]} > 6 )); then + echo "'rocmPackages_6.${pname}' is already at it's maximum allowed version.''\nAny further upgrades should go into 'rocmPackages_X.${pname}'." 1>&2 + exit 1 + fi + + update-source-version rocmPackages_6.${pname} "$version" --ignore-same-hash + ''; +in [ updateScript ] |