summary refs log tree commit diff
path: root/pkgs/development/libraries/zlib
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2015-01-06 14:52:30 -0600
committerJohn Wiegley <johnw@newartisans.com>2015-01-06 14:52:58 -0600
commitf8bd5bb401e7c47b66b4cf44b150707824a5f41d (patch)
tree2a3655efae860297f7ecebe3df9facfa2500cea4 /pkgs/development/libraries/zlib
parent0f04707953933923cf957b7800c2eba83b4f8f34 (diff)
zlib: on darwin, correctly set the RPATH for libzlib
Diffstat (limited to 'pkgs/development/libraries/zlib')
-rw-r--r--pkgs/development/libraries/zlib/default.nix9
1 files changed, 9 insertions, 0 deletions
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index 0938e2a17a796..60aa8d0dbeea8 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -26,6 +26,15 @@ stdenv.mkDerivation rec {
   # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-static-libgcc";
 
+  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+    # jww (2015-01-06): Sometimes this library install as a .so, even on
+    # Darwin; others time it installs as a .dylib.  I haven't yet figured out
+    # what causes this difference.
+    for file in $out/lib/*.so* $out/lib/*.dylib* ; do
+      install_name_tool -id "$file" $file
+    done
+  '';
+
   crossAttrs = {
     dontStrip = static;
   } // stdenv.lib.optionalAttrs (stdenv.cross.libc == "msvcrt") {