mirror of
https://github.com/ipetkov/crane.git
synced 2024-12-18 04:51:39 +03:00
edcb983805
* We can simplify the configuration by removing the `doCopyTargetToSeparateOutput` parameter * If a caller wants to copy target artifacts into any other output, it is pretty trivial for them to add their own logic for it
37 lines
631 B
Nix
37 lines
631 B
Nix
{ cargo
|
|
, configureCargoCommonVarsHook
|
|
, configureCargoVendoredDepsHook
|
|
, copyCargoTargetToOutputHook
|
|
, lib
|
|
, stdenv
|
|
}:
|
|
|
|
{ doCopyTarget ? true
|
|
, nativeBuildInputs ? [ ]
|
|
, outputs ? [ "out" ]
|
|
, ...
|
|
}@args:
|
|
stdenv.mkDerivation (args // {
|
|
inherit
|
|
doCopyTarget;
|
|
|
|
nativeBuildInputs = nativeBuildInputs ++ [
|
|
cargo
|
|
configureCargoCommonVarsHook
|
|
configureCargoVendoredDepsHook
|
|
copyCargoTargetToOutputHook
|
|
];
|
|
|
|
outputs = outputs ++ lib.optional doCopyTarget "target";
|
|
|
|
buildPhase = ''
|
|
cargo check --release
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir -p $out
|
|
runHook postInstall
|
|
'';
|
|
})
|