From cfc3088edcc646522b7a0208a43a3c678cfd1414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliv=C3=A9r=20Falvai?= Date: Sat, 23 Nov 2024 20:17:30 +0100 Subject: [PATCH] swiftpm2nix: use nurl instead of nix-prefetch-git --- pkgs/development/compilers/swift/swiftpm2nix/default.nix | 4 ++-- pkgs/development/compilers/swift/swiftpm2nix/swiftpm2nix.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/swift/swiftpm2nix/default.nix b/pkgs/development/compilers/swift/swiftpm2nix/default.nix index 26713860e198..461e572fe4f9 100644 --- a/pkgs/development/compilers/swift/swiftpm2nix/default.nix +++ b/pkgs/development/compilers/swift/swiftpm2nix/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, callPackage, makeWrapper, jq, nix-prefetch-git }: +{ lib, stdenv, callPackage, makeWrapper, jq, nurl }: stdenv.mkDerivation { name = "swiftpm2nix"; @@ -10,7 +10,7 @@ stdenv.mkDerivation { installPhase = '' install -vD ${./swiftpm2nix.sh} $out/bin/swiftpm2nix wrapProgram $out/bin/$name \ - --prefix PATH : ${lib.makeBinPath [ jq nix-prefetch-git ]} \ + --prefix PATH : ${lib.makeBinPath [ jq nurl ]} \ ''; preferLocalBuild = true; diff --git a/pkgs/development/compilers/swift/swiftpm2nix/swiftpm2nix.sh b/pkgs/development/compilers/swift/swiftpm2nix/swiftpm2nix.sh index eda7f475064a..f5f9780aa95d 100755 --- a/pkgs/development/compilers/swift/swiftpm2nix/swiftpm2nix.sh +++ b/pkgs/development/compilers/swift/swiftpm2nix/swiftpm2nix.sh @@ -23,9 +23,9 @@ hashes="" jq -r '.object.dependencies[] | "\(.subpath) \(.packageRef.location) \(.state.checkoutState.revision)"' $stateFile \ | while read -r name url rev; do echo >&2 "-- Fetching $name" - sha256="$(nix-prefetch-git --fetch-submodules $url $rev | jq -r .sha256)" - hashes+=" - \"$name\" = \"$sha256\";" + hash="$(nurl "$url" "$rev" --json --submodules=true --fetcher=fetchgit | jq -r .args.hash)" +hashes+=" + \"$name\" = \"$hash\";" echo >&2 done hashes+=$'\n'" "