nrfutil: switch upstream source

This commit is contained in:
h7x4 2024-09-20 10:49:39 +02:00
parent 98a31cdb8d
commit 4dc21cedcb
No known key found for this signature in database
GPG Key ID: 9F2F7D8250F35146
2 changed files with 5 additions and 6 deletions

View File

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

View File

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