mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-27 12:36:51 +03:00
ecf151658e
* Also install generated docs
28 lines
641 B
Nix
28 lines
641 B
Nix
{ mkCargoDerivation
|
|
}:
|
|
|
|
{ cargoDocExtraArgs ? "--no-deps"
|
|
, cargoExtraArgs ? "--locked"
|
|
, ...
|
|
}@origArgs:
|
|
let
|
|
args = (builtins.removeAttrs origArgs [
|
|
"cargoDocExtraArgs"
|
|
"cargoExtraArgs"
|
|
]);
|
|
in
|
|
mkCargoDerivation (args // {
|
|
pnameSuffix = "-doc";
|
|
|
|
buildPhaseCargoCommand = "cargoWithProfile doc ${cargoExtraArgs} ${cargoDocExtraArgs}";
|
|
|
|
doInstallCargoArtifacts = args.doInstallCargoArtifacts or false;
|
|
|
|
# NB: cargo always places docs at the root of the target directory
|
|
# even when building in release mode
|
|
installPhaseCommand = ''
|
|
mkdir -p $out/share
|
|
mv "''${CARGO_TARGET_DIR:-target}/doc" $out/share
|
|
'';
|
|
})
|