buildRustCrate: Fix #60125 - Always set additional env variables during build (#60127)

buildRustCrate: Fix #60125 -  Always set additional env variables during build
This commit is contained in:
Vladyslav M 2019-04-24 10:28:03 +03:00 committed by GitHub
commit 0e6ae0bdd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

@ -6,6 +6,7 @@
, completeDeps
, crateAuthors
, crateDescription
, crateHomepage
, crateFeatures
, crateName
, crateVersion
@ -91,12 +92,11 @@ in ''
export CARGO_PKG_VERSION_MAJOR=${builtins.elemAt version 0}
export CARGO_PKG_VERSION_MINOR=${builtins.elemAt version 1}
export CARGO_PKG_VERSION_PATCH=${builtins.elemAt version 2}
export CARGO_PKG_VERSION_PRE="${versionPre}"
export CARGO_PKG_HOMEPAGE="${crateHomepage}"
export NUM_JOBS=1
export RUSTC="rustc"
export RUSTDOC="rustdoc"
if [[ -n "${versionPre}" ]]; then
export CARGO_PKG_VERSION_PRE="${versionPre}"
fi
BUILD=""
if [[ ! -z "${build}" ]] ; then

@ -131,6 +131,7 @@ stdenv.mkDerivation (rec {
crateVersion = crate.version;
crateDescription = crate.description or "";
crateAuthors = if crate ? authors && lib.isList crate.authors then crate.authors else [];
crateHomepage = crate.homepage or "";
crateType =
if lib.attrByPath ["procMacro"] false crate then ["proc-macro"] else
if lib.attrByPath ["plugin"] false crate then ["dylib"] else
@ -144,7 +145,7 @@ stdenv.mkDerivation (rec {
inherit crateName buildDependencies completeDeps completeBuildDeps crateDescription
crateFeatures libName build workspace_member release libPath crateVersion
extraLinkFlags extraRustcOpts
crateAuthors verbose colors target_os;
crateAuthors crateHomepage verbose colors target_os;
};
buildPhase = buildCrate {
inherit crateName dependencies