swiftpm2nix: use nurl instead of nix-prefetch-git (#358546)
This commit is contained in:
commit
c9e243b7ed
@ -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;
|
||||
|
@ -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'" "
|
||||
|
Loading…
Reference in New Issue
Block a user