From 61ac55008202ae006872bee778d65dacbd67c244 Mon Sep 17 00:00:00 2001 From: Peter Kolloch Date: Tue, 23 Apr 2019 23:40:29 +0200 Subject: [PATCH] Fix #60125 - buildRustCrate: Always set CARGO_PKG_VERSION_PRE and CARGO_PKG_HOMEPAGE (as cargo does) --- .../build-support/rust/build-rust-crate/configure-crate.nix | 6 +++--- pkgs/build-support/rust/build-rust-crate/default.nix | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix index 165b3414c6a32..169adcf2d43a2 100644 --- a/pkgs/build-support/rust/build-rust-crate/configure-crate.nix +++ b/pkgs/build-support/rust/build-rust-crate/configure-crate.nix @@ -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 diff --git a/pkgs/build-support/rust/build-rust-crate/default.nix b/pkgs/build-support/rust/build-rust-crate/default.nix index 81e8a7ca0afa3..acb2ee63cce47 100644 --- a/pkgs/build-support/rust/build-rust-crate/default.nix +++ b/pkgs/build-support/rust/build-rust-crate/default.nix @@ -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