summary refs log tree commit diff
path: root/pkgs/development/libraries/nss
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2018-01-03 13:39:37 -0800
committerJohn Wiegley <johnw@newartisans.com>2018-01-03 15:18:00 -0800
commite8caa47b357405ad3e4791e501e3e047ff8cba16 (patch)
treef705535a7f7a8e98e9b64a65c40bb6706578bdaa /pkgs/development/libraries/nss
parent25aff92280d3a416210836af6cdae9cf1b242270 (diff)
downloadnixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.tar
nixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.tar.gz
nixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.tar.bz2
nixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.tar.lz
nixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.tar.xz
nixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.tar.zst
nixpkgs-e8caa47b357405ad3e4791e501e3e047ff8cba16.zip
nss: Omit an extraneous definition; fix other problems on Darwin
Diffstat (limited to 'pkgs/development/libraries/nss')
-rw-r--r--pkgs/development/libraries/nss/ckpem.patch11
-rw-r--r--pkgs/development/libraries/nss/default.nix19
2 files changed, 25 insertions, 5 deletions
diff --git a/pkgs/development/libraries/nss/ckpem.patch b/pkgs/development/libraries/nss/ckpem.patch
new file mode 100644
index 00000000000..c1a65a6c0b2
--- /dev/null
+++ b/pkgs/development/libraries/nss/ckpem.patch
@@ -0,0 +1,11 @@
+--- nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:12.000000000 -0800
++++ nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:20.000000000 -0800
+@@ -156,8 +156,6 @@
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
+ 
+-  PRBool          logged_in;
+-
+ /* our raw object data array */
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 3e8ed856bfa..47f5c1ef5cf 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -28,6 +28,7 @@ in stdenv.mkDerivation rec {
     [
       # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
       ./85_security_load.patch
+      ./ckpem.patch
     ];
 
   patchFlags = "-p0";
@@ -45,7 +46,8 @@ in stdenv.mkDerivation rec {
     "NSS_ENABLE_ECC=1"
     "USE_SYSTEM_ZLIB=1"
     "NSS_USE_SYSTEM_SQLITE=1"
-  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1";
+  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1"
+    ++ stdenv.lib.optional stdenv.isDarwin "CCC=clang++";
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
@@ -84,15 +86,22 @@ in stdenv.mkDerivation rec {
 
   postFixup = ''
     for libname in freebl3 nssdbm3 softokn3
-    do
-      libfile="$out/lib/lib$libname.so"
-      LD_LIBRARY_PATH=$out/lib $out/bin/shlibsign -v -i "$libfile"
+    do '' +
+    (if stdenv.isDarwin
+     then ''
+       libfile="$out/lib/lib$libname.dylib"
+       DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+     '' else ''
+       libfile="$out/lib/lib$libname.so"
+       LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+     '') + ''
+        $out/bin/shlibsign -v -i "$libfile"
     done
 
     moveToOutput bin "$tools"
     moveToOutput bin/nss-config "$dev"
     moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
-    rm "$out"/lib/*.a
+    rm -f "$out"/lib/*.a
   '';
 
   meta = {