treewide: directly pass cargoRoot to fetcher (#373541)
This commit is contained in:
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ stdenv.mkDerivation rec {
|
||||
buildInputs = [ qtbase ];
|
||||
|
||||
cargoDeps = rustPlatform.fetchCargoVendor {
|
||||
inherit src;
|
||||
sourceRoot = "source/${cargoRoot}";
|
||||
inherit src cargoRoot;
|
||||
hash = "sha256-1td3WjxbDq2lX7c0trpYRhO82ChNAG/ZABBRsekYtq4=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -28,8 +28,9 @@ buildPythonPackage rec {
|
||||
pname
|
||||
version
|
||||
src
|
||||
sourceRoot
|
||||
cargoRoot
|
||||
;
|
||||
sourceRoot = "${sourceRoot}/${cargoRoot}";
|
||||
hash = "sha256-tkHl6z0En+od//fCGJXK/p8Dz5KDOXltHrXhxHmHL6U=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
});
|
||||
|
||||
@@ -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=";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user