Merge pull request #266787 from tvbeat/cargo-manifest-links

This commit is contained in:
Ryan Lahfa 2023-11-19 16:14:58 +01:00 committed by GitHub
commit 7e869d89ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -7,6 +7,7 @@
, completeBuildDeps
, completeDeps
, crateAuthors
, crateLinks
, crateDescription
, crateHomepage
, crateFeatures
@ -134,6 +135,7 @@ in ''
export CARGO_CFG_TARGET_VENDOR=${stdenv.hostPlatform.parsed.vendor.name}
export CARGO_MANIFEST_DIR=$(pwd)
export CARGO_MANIFEST_LINKS=${crateLinks}
export DEBUG="${toString (!release)}"
export OPT_LEVEL="${toString optLevel}"
export TARGET="${stdenv.hostPlatform.rust.rustcTargetSpec}"

View file

@ -235,6 +235,7 @@ crate_: lib.makeOverridable
"edition"
"buildTests"
"codegenUnits"
"links"
];
extraDerivationAttrs = builtins.removeAttrs crate processedAttrs;
nativeBuildInputs_ = nativeBuildInputs;
@ -317,6 +318,7 @@ crate_: lib.makeOverridable
crateDescription = crate.description or "";
crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [ ];
crateHomepage = crate.homepage or "";
crateLinks = crate.links or "";
crateType =
if lib.attrByPath [ "procMacro" ] false crate then [ "proc-macro" ] else
if lib.attrByPath [ "plugin" ] false crate then [ "dylib" ] else
@ -337,7 +339,7 @@ crate_: lib.makeOverridable
configurePhase = configureCrate {
inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription
crateFeatures crateRenames libName build workspace_member release libPath crateVersion
crateFeatures crateRenames libName build workspace_member release libPath crateVersion crateLinks
extraLinkFlags extraRustcOptsForBuildRs
crateAuthors crateHomepage verbose colors codegenUnits;
};