Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo-vendor: fix build #40808

Merged
merged 2 commits into from
May 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkgs/build-support/rust/build-rust-crate.nix
Expand Up @@ -47,7 +47,7 @@ let makeDeps = dependencies:
'';

configureCrate =
{ crateName, crateVersion, crateAuthors, build, libName, crateFeatures, colors, libPath, release, buildDependencies, completeDeps, completeBuildDeps, verbose, dependencies, workspace_member }:
{ crateName, crateVersion, crateAuthors, build, libName, crateFeatures, colors, libPath, release, buildDependencies, completeDeps, completeBuildDeps, verbose, dependencies, workspace_member, extraLinkFlags }:
let version_ = lib.splitString "-" crateVersion;
versionPre = if lib.tail version_ == [] then "" else builtins.elemAt version_ 1;
version = lib.splitString "." (lib.head version_);
Expand Down Expand Up @@ -79,6 +79,8 @@ let makeDeps = dependencies:

mkdir -p target/{deps,lib,build,buildDeps}
chmod uga+w target -R
echo ${extraLinkFlags} > target/link
echo ${extraLinkFlags} > target/link.final
for i in ${completeDepsDir}; do
symlink_dependency $i target/deps
done
Expand Down Expand Up @@ -421,9 +423,11 @@ stdenv.mkDerivation (rec {
if lib.attrByPath ["plugin"] false crate then "dylib" else
(crate.type or "lib");
colors = lib.attrByPath [ "colors" ] "always" crate;
extraLinkFlags = builtins.concatStringsSep " " (crate.extraLinkFlags or []);
configurePhase = configureCrate {
inherit crateName dependencies buildDependencies completeDeps completeBuildDeps
crateFeatures libName build workspace_member release libPath crateVersion
extraLinkFlags
crateAuthors verbose colors;
};
extraRustcOpts = if crate ? extraRustcOpts then crate.extraRustcOpts else [];
Expand Down
5 changes: 3 additions & 2 deletions pkgs/build-support/rust/default-crate-overrides.nix
Expand Up @@ -19,8 +19,9 @@ in
crateBin = [ { name = "cargo-vendor"; path = "src/main.rs"; } ];
};
curl-sys = attrs: {
buildInputs = [ pkgconfig zlib ];
propagatedBuiltInputs = [ curl ];
buildInputs = [ pkgconfig zlib curl ];
propagatedBuildInputs = [ curl zlib ];
extraLinkFlags = ["-L${zlib.out}/lib"];
};
libgit2-sys = attrs: {
LIBGIT2_SYS_USE_PKG_CONFIG = true;
Expand Down