From 4dc21cedcba98420790d24bca5c07d4463d28ae1 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 20 Sep 2024 10:49:39 +0200 Subject: [PATCH 1/2] nrfutil: switch upstream source --- pkgs/by-name/nr/nrfutil/package.nix | 2 +- pkgs/by-name/nr/nrfutil/update.sh | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/nr/nrfutil/package.nix b/pkgs/by-name/nr/nrfutil/package.nix index 9cafd07b5c45..b72c55b55736 100644 --- a/pkgs/by-name/nr/nrfutil/package.nix +++ b/pkgs/by-name/nr/nrfutil/package.nix @@ -19,7 +19,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { inherit (source) version; src = fetchurl { - url = "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-${platform.name}-${finalAttrs.version}.tar.gz"; + url = "https://files.nordicsemi.com/artifactory/swtools/external/nrfutil/packages/nrfutil/nrfutil-${platform.name}-${finalAttrs.version}.tar.gz"; inherit (platform) hash; }; diff --git a/pkgs/by-name/nr/nrfutil/update.sh b/pkgs/by-name/nr/nrfutil/update.sh index bd3bbadbfde5..a7efb9d49aae 100755 --- a/pkgs/by-name/nr/nrfutil/update.sh +++ b/pkgs/by-name/nr/nrfutil/update.sh @@ -1,5 +1,5 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p jq nix nix-prefetch-github xq-xml +#!nix-shell -i bash -p jq nix nix-prefetch-github 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))" @@ -17,12 +17,11 @@ architectures["x86_64-linux"]="x86_64-unknown-linux-gnu" architectures["x86_64-darwin"]="x86_64-apple-darwin" architectures["aarch64-darwin"]="aarch64-apple-darwin" -binary_list=$(curl "https://developer.nordicsemi.com/.pc-tools/nrfutil/" | xq -q "#files" | grep -o -E 'nrfutil-(x86_64|aarch64)-.*?.gz' | cut -d' ' -f 1) +BASE_URL="https://files.nordicsemi.com/artifactory/swtools/external/nrfutil" for a in ${!architectures[@]}; do - versions["$a"]=$(echo "$binary_list" | grep "${architectures[${a}]}" | sed -r "s/nrfutil-${architectures[${a}]}-(.*?).tar.gz/\\1/" | tail -n 1) - echo "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-${architectures[${a}]}-${versions[${a}]}.tar.gz" - hashes["$a"]=$(narhash "https://developer.nordicsemi.com/.pc-tools/nrfutil/nrfutil-${architectures[${a}]}-${versions[${a}]}.tar.gz") + versions["$a"]=$(curl "$BASE_URL/index/${architectures[${a}]}/index.json" | jq -r '.packages.nrfutil.latest_version') + hashes["$a"]=$(narhash "$BASE_URL/packages/nrfutil/nrfutil-${architectures[${a}]}-${versions[${a}]}.tar.gz") done { From 19635fef8f61273320a5f1528c4a4006b120a88e Mon Sep 17 00:00:00 2001 From: h7x4 Date: Fri, 20 Sep 2024 10:50:13 +0200 Subject: [PATCH 2/2] nrfutil: 7.11.1 -> 7.13.0 --- pkgs/by-name/nr/nrfutil/source.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/nr/nrfutil/source.nix b/pkgs/by-name/nr/nrfutil/source.nix index f768ac96bb88..6d48b7274120 100644 --- a/pkgs/by-name/nr/nrfutil/source.nix +++ b/pkgs/by-name/nr/nrfutil/source.nix @@ -1,15 +1,15 @@ { - version = "7.11.1"; + version = "7.13.0"; x86_64-linux = { name = "x86_64-unknown-linux-gnu"; - hash = "sha256-faF/iA07wWiAuxeqEZciIYlnoWe4LKCtDxD0BwIyeYw="; + hash = "sha256-R3OF/340xEab+0zamfwvejY16fjy/3TrzMvQaBlVxHw="; }; x86_64-darwin = { name = "x86_64-apple-darwin"; - hash = "sha256-EImYXMIvxPgzaGuAOWi4O6mG5S1awdGSX0HQgT1iHaI="; + hash = "sha256-cnZkVkTbQ/+ciITPEx2vxxZchCC54T0JOApB4HKp8e0="; }; aarch64-darwin = { name = "aarch64-apple-darwin"; - hash = "sha256-jgigeJRHH/c761wYGMHhtRHE59ms7obZPxiH5pKeoeQ="; + hash = "sha256-5VxDQ25tW+qTXHwkltpaAm4AnQvA18qGMaflYQzE2pQ="; }; }