Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions doc/languages-frameworks/rust.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
specify the crate's directory relative to `sourceRoot`. 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
path for `fetchCargoVendor`.
`cargoRoot` attribute. Note that we also need to pass in `cargoRoot`
to `fetchCargoVendor`.

```nix
{
Expand All @@ -627,8 +627,12 @@ buildPythonPackage rec {
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
sourceRoot = "${pname}-${version}/${cargoRoot}";
inherit
pname
version
src
cargoRoot
;
hash = "sha256-ctUt8maCjnGddKPf+Ii++wKsAXA1h+JM6zKQNXXwJqQ=";
};

Expand Down
6 changes: 1 addition & 5 deletions pkgs/applications/misc/openbangla-keyboard/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,7 @@ stdenv.mkDerivation rec {
];

cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
sourceRoot = "${src.name}/${cargoRoot}";
inherit src cargoRoot postPatch;
hash = "sha256-qZMTZi7eqEp5kSmVx7qdS7eDKOzSv9fMjWT0h/MGyeY=";
};

Expand Down
3 changes: 1 addition & 2 deletions pkgs/applications/science/electronics/librepcb/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ stdenv.mkDerivation rec {
buildInputs = [ qtbase ];

cargoDeps = rustPlatform.fetchCargoVendor {
inherit src;
sourceRoot = "source/${cargoRoot}";
inherit src cargoRoot;
hash = "sha256-1td3WjxbDq2lX7c0trpYRhO82ChNAG/ZABBRsekYtq4=";
};

Expand Down
4 changes: 1 addition & 3 deletions pkgs/by-name/cc/ccextractor/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ stdenv.mkDerivation (finalAttrs: {
cargoRoot = "src/rust";

cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/${finalAttrs.cargoRoot}";
inherit (finalAttrs) src cargoRoot;
patches = [ ./use-rsmpeg-0.15.patch ];
patchFlags = [ "-p3" ];
hash = "sha256-7v3gQghByUDWZLJRRGa/7X2ivUumirq6BbexNQcCXCk=";
};

Expand Down
3 changes: 1 addition & 2 deletions pkgs/by-name/op/opengamepadui/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ stdenv.mkDerivation (finalAttrs: {
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "source/${finalAttrs.cargoRoot}";
inherit (finalAttrs) src cargoRoot;
hash = "sha256-T79G2bShJuFRfaCqG3IDHqW0s68yAdGyv58kdDYg6kg=";
};
cargoRoot = "extensions";
Expand Down
3 changes: 1 addition & 2 deletions pkgs/by-name/su/surrealist/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ stdenv.mkDerivation (finalAttrs: {
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.src.name}/${finalAttrs.cargoRoot}";
inherit (finalAttrs) src cargoRoot;
hash = "sha256-Su9ZOPIskV5poeS8pgtri+sZANBpdgnuCsQqE4WKFdA=";
};

Expand Down
8 changes: 6 additions & 2 deletions pkgs/by-name/we/wealthfolio/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,12 @@ stdenv.mkDerivation (finalAttrs: {
buildAndTestSubdir = finalAttrs.cargoRoot;

cargoDeps = rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
sourceRoot = "${finalAttrs.src.name}/${finalAttrs.cargoRoot}";
inherit (finalAttrs)
pname
version
src
cargoRoot
;
hash = "sha256-MmdvEutdkX98DgX1aVuxs4gabuMX5aM8yC4eqgvd8Q4=";
};

Expand Down
3 changes: 1 addition & 2 deletions pkgs/development/interpreters/ruby/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,7 @@ let
cargoDeps =
if yjitSupport then
rustPlatform.fetchCargoVendor {
inherit (finalAttrs) src;
sourceRoot = "${finalAttrs.pname}-${version}/${finalAttrs.cargoRoot}";
inherit (finalAttrs) src cargoRoot;
hash =
assert cargoHash != null;
cargoHash;
Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/python-modules/bcrypt/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ buildPythonPackage rec {

cargoRoot = "src/_bcrypt";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
sourceRoot = "${pname}-${version}/${cargoRoot}";
inherit
pname
version
src
cargoRoot
;
hash = "sha256-HgHvfMBspPsSYhllnKBg5XZB6zxFIqJj+4//xKG8HwA=";
};

Expand Down
3 changes: 2 additions & 1 deletion pkgs/development/python-modules/biliass/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ buildPythonPackage rec {
pname
version
src
sourceRoot
cargoRoot
;
sourceRoot = "${sourceRoot}/${cargoRoot}";
hash = "sha256-tkHl6z0En+od//fCGJXK/p8Dz5KDOXltHrXhxHmHL6U=";
};

Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/python-modules/libcst/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ buildPythonPackage rec {
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
sourceRoot = "${src.name}/${cargoRoot}";
inherit
pname
version
src
cargoRoot
;
hash = "sha256-K8hug7JeLPIvrqgVaONKfixu8XRvn+pnqS0fHV+nTqg=";
};

Expand Down
8 changes: 6 additions & 2 deletions pkgs/development/python-modules/temporalio/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ buildPythonPackage rec {
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
sourceRoot = "${src.name}/${cargoRoot}";
inherit
pname
version
src
cargoRoot
;
hash = "sha256-9hP+zN6jcRmRhPmcZ4Zgp61IeS7gDPfsOvweAxKHnHM=";
};

Expand Down
3 changes: 1 addition & 2 deletions pkgs/kde/gear/akonadi-search/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ mkKdeDerivation rec {
cargoRoot = "agent/rs/htmlparser";

cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version;
inherit pname version cargoRoot;
src = sources.${pname};
sourceRoot = "${pname}-${version}/${cargoRoot}";
hash = "sha256-hdm4LfQcs4TTfBLzlZYJ0uzqfLxMXuYQExLGJg81W2U=";
};

Expand Down
3 changes: 1 addition & 2 deletions pkgs/kde/gear/kdepim-addons/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ mkKdeDerivation rec {
cargoRoot = "plugins/webengineurlinterceptor/adblock";

cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version;
inherit pname version cargoRoot;
src = sources.${pname};
sourceRoot = "${pname}-${version}/${cargoRoot}";
hash = "sha256-66FqoD3JoPbtg6zc32uaPYaTo4zHxywiN8wPI2jtcjc=";
};

Expand Down
8 changes: 6 additions & 2 deletions pkgs/tools/filesystems/ceph/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,12 @@ let
};
cargoRoot = "src/_bcrypt";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
sourceRoot = "${pname}-${version}/${cargoRoot}";
inherit
pname
version
src
cargoRoot
;
hash = "sha256-8PyCgh/rUO8uynzGdgylAsb5k55dP9fCnf40UOTCR/M=";
};
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,12 @@ buildPythonPackage rec {
};

cargoDeps = rustPlatform.fetchCargoVendor {
inherit pname version src;
sourceRoot = "${pname}-${version}/${cargoRoot}";
inherit
pname
version
src
cargoRoot
;
hash = "sha256-pZHu3Oo9DWRAtldU0UvrH1FIg0bEvyfizPUhj9IBL58=";
};

Expand Down