summary refs log tree commit diff
path: root/pkgs/development/libraries/zlib/default.nix
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-23 10:59:27 -0400
committerJohn Ericson <John.Ericson@Obsidian.Systems>2018-09-23 10:59:27 -0400
commit45f40f5fe02d71f9863e54277a50fe7e1dc46afa (patch)
tree6051fd83ecfdc83d78a39bf40c0645b55048c461 /pkgs/development/libraries/zlib/default.nix
parent2091133e789b22b33cdb85af99e36c5589faf1db (diff)
parentb97242238d7efb029c76eb8d4fe4b1228a5b49a8 (diff)
downloadnixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.tar
nixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.tar.gz
nixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.tar.bz2
nixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.tar.lz
nixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.tar.xz
nixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.tar.zst
nixlib-45f40f5fe02d71f9863e54277a50fe7e1dc46afa.zip
Merge commit 'b97242238d7efb029c76eb8d4fe4b1228a5b49a8'
Both parent commits were previously tied as the most recent ancestor to
'master' and 'release-18.09'.
Diffstat (limited to 'pkgs/development/libraries/zlib/default.nix')
-rw-r--r--pkgs/development/libraries/zlib/default.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index d3fb0970cd00..d348f877f722 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -3,7 +3,7 @@
 , static ? false
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (rec {
   name = "zlib-${version}";
   version = "1.2.11";
 
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     # what causes this difference.
   + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
     for file in $out/lib/*.so* $out/lib/*.dylib* ; do
-      install_name_tool -id "$file" $file
+      ${stdenv.cc.bintools.targetPrefix}install_name_tool -id "$file" $file
     done
   ''
     # Non-typical naming confuses libtool which then refuses to use zlib's DLL
@@ -78,4 +78,8 @@ stdenv.mkDerivation rec {
     license = licenses.zlib;
     platforms = platforms.all;
   };
-}
+} // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+  preConfigure = ''
+    export CHOST=${stdenv.hostPlatform.config}
+  '';
+})