Unverified Commit bf8cde15 authored by K900's avatar K900 Committed by GitHub
Browse files

treewide: directly pass cargoRoot to fetcher (#373541)

parents 7c961946 8e876759
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -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
{
@@ -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=";
  };

+1 −5
Original line number Diff line number Diff line
@@ -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=";
  };

+1 −2
Original line number Diff line number Diff line
@@ -42,8 +42,7 @@ stdenv.mkDerivation rec {
  buildInputs = [ qtbase ];

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

+1 −3
Original line number Diff line number Diff line
@@ -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=";
  };

+1 −2
Original line number Diff line number Diff line
@@ -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";
Loading