buildRustCrate: support rust editions
In combination with carnix we can now build crates that require a specific edition of rust features. A few crates started requiring that already and having this in nixpkgs is just logical.
This commit is contained in:
parent
044a8a24ed
commit
6a3b144d02
@ -71,7 +71,7 @@ let crate = crate_ // (lib.attrByPath [ crate_.crateName ] (attr: {}) crateOverr
|
||||
processedAttrs = [
|
||||
"src" "buildInputs" "crateBin" "crateLib" "libName" "libPath"
|
||||
"buildDependencies" "dependencies" "features"
|
||||
"crateName" "version" "build" "authors" "colors"
|
||||
"crateName" "version" "build" "authors" "colors" "edition"
|
||||
];
|
||||
extraDerivationAttrs = lib.filterAttrs (n: v: ! lib.elem n processedAttrs) crate;
|
||||
buildInputs_ = buildInputs;
|
||||
@ -136,7 +136,9 @@ stdenv.mkDerivation (rec {
|
||||
(crate.type or ["lib"]);
|
||||
colors = lib.attrByPath [ "colors" ] "always" crate;
|
||||
extraLinkFlags = builtins.concatStringsSep " " (crate.extraLinkFlags or []);
|
||||
extraRustcOpts = (if crate ? extraRustcOpts then crate.extraRustcOpts else []) ++ extraRustcOpts_;
|
||||
edition = crate.edition or null;
|
||||
extraRustcOpts = (if crate ? extraRustcOpts then crate.extraRustcOpts else []) ++ extraRustcOpts_ ++ (lib.optional (edition != null) "--edition ${edition}");
|
||||
|
||||
configurePhase = configureCrate {
|
||||
inherit crateName buildDependencies completeDeps completeBuildDeps
|
||||
crateFeatures libName build workspace_member release libPath crateVersion
|
||||
|
Loading…
Reference in New Issue
Block a user