nss: link libraries with absolute paths on Darwin

This commit is contained in:
Väinö Järvelä 2018-02-20 12:12:24 +02:00
parent 2a99b51390
commit aacd3e5267

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, nspr, perl, zlib, sqlite }: { stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames }:
let let
@ -16,7 +16,8 @@ in stdenv.mkDerivation rec {
sha256 = "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3"; sha256 = "186x33wsk4mzjz7dzbn8p0py9a0nzkgzpfkdv4rlyy5gghv5vhd3";
}; };
buildInputs = [ perl zlib sqlite ]; buildInputs = [ perl zlib sqlite ]
++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
propagatedBuildInputs = [ nspr ]; propagatedBuildInputs = [ nspr ];
@ -33,6 +34,10 @@ in stdenv.mkDerivation rec {
patchFlags = "-p0"; patchFlags = "-p0";
postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
'';
outputs = [ "out" "dev" "tools" ]; outputs = [ "out" "dev" "tools" ];
preConfigure = "cd nss"; preConfigure = "cd nss";