6XDVUSBMBXM4LKKKR7YPJ5PF4ISOZNT465GSOFR2GF7NTL5SNLZAC
J6UIWIYYFEG3F4XJOZEGBV7UEFJA53356GG63JPUNZPYJEKUGZRQC
NWYJJHDFVCDR34NC6VYI4S2ZT4Q6KV4JWIBJDHOZEFZVEGO2J72AC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
HW5Q7GGYDMCQQYDBFLDAWCTNQQMIQHJ77UOSPN5BHMSD3KMO2O3AC
TNN56XYKX4QRHA4FWCF5F3JVG52FIAC76EEYYANDKEE4IAWQKPEQC
JACZWIJ6UEL5HWZRNOOXTFXUEG67XJDPC5D72LYUPCVVJ6WB7JQAC
IIV3EL2XYI2X7HZWKXEXQFAE3R3KC2Q7SGOT3Q332HSENMYVF32QC
5OGOE4VWS5AIG4U2UYLLIGA3HY6UB7SNQOSESHNXBLET3VQXFBZAC
G734WNM64AR5BLAZMN5MDPKSFTYXTUQR6MAGB32NRBC5FXFRWSJAC
HDGRZISM2SS4TK5BMNGDIYG22SOXAZRTTC6YFIOPY4LSO53QDWZQC
Y7KH4QOPBZSWPVYL45TF2G5VBQWUJXJWIKOLTFTB5GE5FVH4CK6AC
7ZFRYVVQQGJYG3POPWJWL3CDW37YDXZYZQC3OSWFHWEUSEMYQ4EQC
YMWMWFA54PUELJI4YX77ZXEBQLHFM3DBJVQYQEP3DBO3GF7T4PCAC
CCLLB7OIFNFYJZTG3UCI7536TOCWSCSXR67VELSB466R24WLJSDAC
QJXNUQFJOAPQT3GUXRDTVKMJZCKFONSXUZMAZB7VC7OHDCGAVCOQC
then lib.warn "`buildRustCrate` is deprecated, use `buildRustCrateForPkgs` instead" (_: buildRustCrate)
then lib.warn "crate2nix: Passing `buildRustCrate` as argument to Cargo.nix is deprecated. If you don't customize `buildRustCrate`, replace `callPackage ./Cargo.nix {}` by `import ./Cargo.nix { inherit pkgs; }`, and if you need to customize `buildRustCrate`, use `buildRustCrateForPkgs` instead." (_: buildRustCrate)
testCrateFlags: list of flags to pass to the test exectuable
testInputs: list of packages that should be available during test execution
testCrateFlags: list of flags to pass to the test exectuable
testInputs: list of packages that should be available during test execution
# If the user hasn't set any pre/post commands, we don't want to
# insert empty lines. This means that any existing users of crate2nix
# don't get a spurious rebuild unless they set these explicitly.
testCommand = pkgs.lib.concatStringsSep "\n"
(pkgs.lib.filter (s: s != "") [
testPreRun
"$f $testCrateFlags 2>&1 | tee -a $out"
testPostRun
]);
If multiple paths to a dependency enable different features, the
corresponding feature sets are merged. Features in rust are additive.
If multiple paths to a dependency enable different features, the
corresponding feature sets are merged. Features in rust are additive.
featureMap is an attribute set which maps feature names to lists of further
feature names to enable in case this feature is selected.
featureMap is an attribute set which maps feature names to lists of further
feature names to enable in case this feature is selected.
/* This function adds optional dependencies as features if they are enabled
indirectly by dependency features. This function mimics Cargo's behavior
described in a note at:
https://doc.rust-lang.org/nightly/cargo/reference/features.html#dependency-features
*/
enableFeatures = dependencies: features:
assert (builtins.isList features);
assert (builtins.isList dependencies);
let
additionalFeatures = lib.concatMap
(
dependency:
assert (builtins.isAttrs dependency);
let
enabled = builtins.any (doesFeatureEnableDependency dependency) features;
in
if (dependency.optional or false) && enabled then [ dependency.name ] else [ ]
)
dependencies;
in
sortedUnique (features ++ additionalFeatures);