git.iko.soy/typeable/nixpkgs
on master help sign in
curl: wrap binary so it can find the zlib dylib

This is needed at least when first installing on a clean Mavericks machine.

commitb4a5a049d814c73b9fc99f6f88fb723ba78662fb authorJohn Wiegley <johnw@newartisans.com> dateTue 6 Jan 2015, 10:11 (12 years ago) parente957d71
1 file changed+9
pkgs/tools/networking/curl/default.nix+9
pkgs/tools/networking/curl/default.nix+9
@@ -33,6 +33,8 @@ stdenv.mkDerivation rec {
3333 preConfigure = ''
3434 sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
3535 rm src/tool_hugehelp.c
36+ '' ++ stdenv.lib.optionalString stdenv.isDarwin '';
37+ export DYLD_LIBRARY_PATH=${zlib}/lib:$DYLD_LIBRARY_PATH
3638 '';
3739
3840 # make curl honor CURL_CA_BUNDLE & SSL_CERT_FILE
@@ -41,12 +43,19 @@ stdenv.mkDerivation rec {
4143 '';
4244
4345 configureFlags = [
46+ ( if zlibSupport then "--with-zlib=${zlib}" else "--without-zlib" )
4447 ( if sslSupport then "--with-ssl=${openssl}" else "--without-ssl" )
4548 ( if scpSupport then "--with-libssh2=${libssh2}" else "--without-libssh2" )
4649 ]
4750 ++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
4851 ++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}";
4952
53+ installPhase = stdenv.lib.optionalString stdenv.isDarwin ''
54+ for prog in $out/bin/*; do
55+ wrapProgram "$prog" --prefix DYLD_LIBRARY_PATH : "${zlib}/lib"
56+ done
57+ '';
58+
5059 CXX = "g++";
5160 CXXCPP = "g++ -E";
5261