diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 689dc3d7d5ef..f8b3ad9355ad 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -103,30 +103,24 @@ stdenv.mkDerivation rec { ]; # Fix all broken refernces to dependencies in .la and .pc files - postInstall = '' - sed -i \ - '' + optionalString (optZlib != null) '' - -e 's,\(-lz\),-L${optZlib}/lib \1,' \ + postInstall = optionalString (optZlib != null) '' + sed -i 's,\(-lz\),-L${optZlib}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} '' + optionalString (optOpenssl != null) '' - -e 's,\(-lssl\|-lcrypto\),-L${optOpenssl}/lib \1,' \ + sed -i 's,\(-lssl\|-lcrypto\),-L${optOpenssl}/lib \1,' $out/lib/pkgconfig/libcurl.pc '' + optionalString (optLibssh2 != null) '' - -e 's,\(-lssh2\),-L${optLibssh2}/lib \1,' \ + sed -i 's,\(-lssh2\),-L${optLibssh2}/lib \1,' $out/lib/pkgconfig/libcurl.pc '' + optionalString (optLibnghttp2 != null) '' - -e 's,\(-lnghttp2\),-L${optLibnghttp2}/lib \1,' \ + sed -i 's,\(-lnghttp2\),-L${optLibnghttp2}/lib \1,' $out/lib/pkgconfig/libcurl.pc '' + optionalString (optC-ares != null) '' - -e 's,\(-lcares\),-L${optC-ares}/lib \1,' \ + sed -i 's,\(-lcares\),-L${optC-ares}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} '' + optionalString (optGss != null) '' - -e 's,\(-lgss\),-L${optGss}/lib \1,' \ + sed -i 's,\(-lgss\),-L${optGss}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} '' + optionalString (optRtmpdump != null) '' - -e 's,\(-lrtmp\),-L${optRtmpdump}/lib \1,' \ + sed -i 's,\(-lrtmp\),-L${optRtmpdump}/lib \1,' $out/lib/pkgconfig/libcurl.pc '' + optionalString (optOpenldap != null) '' - -e 's,\(-lgss\),-L${optOpenldap}/lib \1,' \ + sed -i 's,\(-lgss\),-L${optOpenldap}/lib \1,' $out/lib/{libcurl.la,pkgconfig/libcurl.pc} '' + optionalString (optLibidn != null) '' - -e 's,\(-lidn\),-L${optLibidn}/lib \1,' \ - '' + optionalString (!stdenv.isDarwin) '' - $out/lib/libcurl.la \ - '' + '' - $out/lib/pkgconfig/libcurl.pc + sed -i 's,\(-lidn\),-L${optLibidn}/lib \1,' $out/lib/pkgconfig/libcurl.pc ''; meta = {