Merge pull request #56353 from P-E-Meunier/buildRustCrate

buildRustCrate: adding the description field
This commit is contained in:
Andreas Rammhold 2019-02-25 17:42:28 +01:00 committed by GitHub
commit c3a3ae1961
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -5,6 +5,7 @@
, completeBuildDeps
, completeDeps
, crateAuthors
, crateDescription
, crateFeatures
, crateName
, crateVersion
@ -69,6 +70,7 @@ in ''
export CARGO_PKG_NAME=${crateName}
export CARGO_PKG_VERSION=${crateVersion}
export CARGO_PKG_AUTHORS="${authors}"
export CARGO_PKG_DESCRIPTION="${crateDescription}"
export CARGO_CFG_TARGET_ARCH=${stdenv.hostPlatform.parsed.cpu.name}
export CARGO_CFG_TARGET_OS=${target_os}

View File

@ -129,6 +129,7 @@ stdenv.mkDerivation (rec {
build = crate.build or "";
workspace_member = crate.workspace_member or ".";
crateVersion = crate.version;
crateDescription = crate.description or "";
crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [];
crateType =
if lib.attrByPath ["procMacro"] false crate then ["proc-macro"] else
@ -140,7 +141,7 @@ stdenv.mkDerivation (rec {
extraRustcOpts = (if crate ? extraRustcOpts then crate.extraRustcOpts else []) ++ extraRustcOpts_ ++ (lib.optional (edition != null) "--edition ${edition}");
configurePhase = configureCrate {
inherit crateName buildDependencies completeDeps completeBuildDeps
inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription
crateFeatures libName build workspace_member release libPath crateVersion
extraLinkFlags extraRustcOpts
crateAuthors verbose colors target_os;