chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / nr / nrfutil / update.sh
bloba7efb9d49aae87a3a7b39cddd045fb7d7b215238
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p jq nix nix-prefetch-github
4 nixpkgs="$(git rev-parse --show-toplevel || (printf 'Could not find root of nixpkgs repo\nAre we running from within the nixpkgs git repo?\n' >&2; exit 1))"
6 narhash() {
7 nix --extra-experimental-features nix-command store prefetch-file --json "$1" | jq -r .hash
10 set -euo pipefail
12 declare -A architectures
13 declare -A versions
14 declare -A hashes
16 architectures["x86_64-linux"]="x86_64-unknown-linux-gnu"
17 architectures["x86_64-darwin"]="x86_64-apple-darwin"
18 architectures["aarch64-darwin"]="aarch64-apple-darwin"
20 BASE_URL="https://files.nordicsemi.com/artifactory/swtools/external/nrfutil"
22 for a in ${!architectures[@]}; do
23 versions["$a"]=$(curl "$BASE_URL/index/${architectures[${a}]}/index.json" | jq -r '.packages.nrfutil.latest_version')
24 hashes["$a"]=$(narhash "$BASE_URL/packages/nrfutil/nrfutil-${architectures[${a}]}-${versions[${a}]}.tar.gz")
25 done
28 printf "{\n"
29 printf " version = \"${versions["x86_64-linux"]}\";\n"
30 for a in ${!architectures[@]}; do
31 printf " ${a} = {\n"
32 printf " name = \"${architectures[${a}]}\";\n"
33 printf " hash = \"${hashes[${a}]}\";\n"
34 printf " };\n"
35 done
36 printf "}\n"
37 } > "${nixpkgs}/pkgs/by-name/nr/nrfutil/source.nix"