mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 11:45:45 +03:00
doc/rust: pass cargoRoot to fetcher in example
This commit is contained in:
parent
501b8f1c69
commit
8e87675994
1 changed files with 8 additions and 4 deletions
|
@ -605,8 +605,8 @@ In some projects, the Rust crate is not in the main Python source
|
||||||
directory. In such cases, the `cargoRoot` attribute can be used to
|
directory. In such cases, the `cargoRoot` attribute can be used to
|
||||||
specify the crate's directory relative to `sourceRoot`. In the
|
specify the crate's directory relative to `sourceRoot`. In the
|
||||||
following example, the crate is in `src/rust`, as specified in the
|
following example, the crate is in `src/rust`, as specified in the
|
||||||
`cargoRoot` attribute. Note that we also need to specify the correct
|
`cargoRoot` attribute. Note that we also need to pass in `cargoRoot`
|
||||||
path for `fetchCargoVendor`.
|
to `fetchCargoVendor`.
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
{
|
{
|
||||||
|
@ -627,8 +627,12 @@ buildPythonPackage rec {
|
||||||
};
|
};
|
||||||
|
|
||||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||||
inherit pname version src;
|
inherit
|
||||||
sourceRoot = "${pname}-${version}/${cargoRoot}";
|
pname
|
||||||
|
version
|
||||||
|
src
|
||||||
|
cargoRoot
|
||||||
|
;
|
||||||
hash = "sha256-ctUt8maCjnGddKPf+Ii++wKsAXA1h+JM6zKQNXXwJqQ=";
|
hash = "sha256-ctUt8maCjnGddKPf+Ii++wKsAXA1h+JM6zKQNXXwJqQ=";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue