about summary refs log tree commit diff
path: root/pkgs/build-support/rust
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2018-05-20 13:20:53 +0200
committerVladimír Čunát <vcunat@gmail.com>2018-05-20 13:20:53 +0200
commit392e6de7d0cc9a65a7fd195fd1304310a30a8489 (patch)
treefefd8ca07d3e2665a4746ac0fd43d0c7965d660e /pkgs/build-support/rust
parent90c01001396e166fabfbcfb955de2a5409a95d9b (diff)
parent68cdc9c09e38e704a3bed720fc182f1907035375 (diff)
downloadnixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.gz
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.bz2
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.lz
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.xz
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.tar.zst
nixlib-392e6de7d0cc9a65a7fd195fd1304310a30a8489.zip
Merge branch 'master' into staging
Diffstat (limited to 'pkgs/build-support/rust')
-rw-r--r--pkgs/build-support/rust/build-rust-crate.nix6
-rw-r--r--pkgs/build-support/rust/default-crate-overrides.nix5
2 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/build-support/rust/build-rust-crate.nix b/pkgs/build-support/rust/build-rust-crate.nix
index e0aec6e0e18b..5c738dd7f0b3 100644
--- a/pkgs/build-support/rust/build-rust-crate.nix
+++ b/pkgs/build-support/rust/build-rust-crate.nix
@@ -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_);
@@ -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
@@ -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 [];
diff --git a/pkgs/build-support/rust/default-crate-overrides.nix b/pkgs/build-support/rust/default-crate-overrides.nix
index 971c4d0f5e22..d82a92042307 100644
--- a/pkgs/build-support/rust/default-crate-overrides.nix
+++ b/pkgs/build-support/rust/default-crate-overrides.nix
@@ -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;