From f8bd5bb401e7c47b66b4cf44b150707824a5f41d Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Tue, 6 Jan 2015 14:52:30 -0600 Subject: zlib: on darwin, correctly set the RPATH for libzlib --- pkgs/development/libraries/zlib/default.nix | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'pkgs/development/libraries/zlib') diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 0938e2a17a7..60aa8d0dbee 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") { -- cgit 1.4.1 From 4bbfa27e5c00339c49d51e61aa00e9086932e362 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Wed, 7 Jan 2015 18:23:18 +0300 Subject: Make the Darwin fix in zlib keep Linux hash --- pkgs/development/libraries/zlib/default.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'pkgs/development/libraries/zlib') diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 60aa8d0dbee..8a79806bf93 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -2,7 +2,7 @@ let version = "1.2.8"; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (rec { name = "zlib-${version}"; src = fetchurl { @@ -26,15 +26,6 @@ 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") { @@ -58,4 +49,13 @@ stdenv.mkDerivation rec { description = "Lossless data-compression library"; license = licenses.zlib; }; -} +} // (if stdenv.isDarwin then { + postInstall = '' + # 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 + ''; +} else {})) -- cgit 1.4.1