mirror of
https://github.com/nix-community/dream2nix.git
synced 2024-11-10 14:08:51 +03:00
fix(rust): write cargo checksum for path dependencies
This commit is contained in:
parent
2167b7e993
commit
947fb621a8
@ -39,9 +39,9 @@ let
|
|||||||
makeSource = dep:
|
makeSource = dep:
|
||||||
let
|
let
|
||||||
path = getSource dep.name dep.version;
|
path = getSource dep.name dep.version;
|
||||||
isGit = (getSourceSpec dep.name dep.version).type == "git";
|
spec = getSourceSpec dep.name dep.version;
|
||||||
in {
|
in {
|
||||||
inherit path isGit dep;
|
inherit path spec dep;
|
||||||
name = "${dep.name}-${dep.version}";
|
name = "${dep.name}-${dep.version}";
|
||||||
};
|
};
|
||||||
sources = l.map makeSource deps;
|
sources = l.map makeSource deps;
|
||||||
@ -73,12 +73,16 @@ let
|
|||||||
tree="$(dirname $crateCargoTOML)"
|
tree="$(dirname $crateCargoTOML)"
|
||||||
'';
|
'';
|
||||||
makeScript = source:
|
makeScript = source:
|
||||||
|
let
|
||||||
|
isGit = source.spec.type == "git";
|
||||||
|
isPath = source.spec.type == "path";
|
||||||
|
in
|
||||||
''
|
''
|
||||||
tree="${source.path}"
|
tree="${source.path}"
|
||||||
${l.optionalString source.isGit (findCrateSource source)}
|
${l.optionalString isGit (findCrateSource source)}
|
||||||
cp -prvd "$tree" $out/${source.name}
|
cp -prvd "$tree" $out/${source.name}
|
||||||
chmod u+w $out/${source.name}
|
chmod u+w $out/${source.name}
|
||||||
${l.optionalString source.isGit "printf '{\"files\":{},\"package\":null}' > \"$out/${source.name}/.cargo-checksum.json\""}
|
${l.optionalString (isGit || isPath) "printf '{\"files\":{},\"package\":null}' > \"$out/${source.name}/.cargo-checksum.json\""}
|
||||||
'';
|
'';
|
||||||
in
|
in
|
||||||
pkgs.runCommand "vendor-${pname}-${version}" {} ''
|
pkgs.runCommand "vendor-${pname}-${version}" {} ''
|
||||||
|
Loading…
Reference in New Issue
Block a user