fix weave (bmo#583209)
authorWolfgang Rosenauer <wr@rosenauer.org>
Tue, 24 Aug 2010 09:30:55 +0200
changeset 139 765ad9b6362d
parent 138 d04c09ee4ce4
child 140 c5e051ab6cb8
fix weave (bmo#583209)
MozillaFirefox/MozillaFirefox.spec
MozillaFirefox/firefox-sync-system-nss.patch
firefox-sync-system-nss.patch
series
--- a/MozillaFirefox/MozillaFirefox.spec	Wed Aug 18 11:41:42 2010 +0200
+++ b/MozillaFirefox/MozillaFirefox.spec	Tue Aug 24 09:30:55 2010 +0200
@@ -62,6 +62,7 @@
 Patch9:         firefox-kde.patch
 Patch10:        firefox-ui-lockdown.patch
 Patch11:        firefox-no-sync-l10n.patch
+Patch12:        firefox-sync-system-nss.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 Requires(post):   coreutils shared-mime-info desktop-file-utils
 Requires(postun): shared-mime-info desktop-file-utils
@@ -172,6 +173,7 @@
 %endif
 #%patch10 -p1
 %patch11 -p1
+%patch12 -p1
 
 %build
 export MOZ_BUILD_DATE=%{releasedate}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MozillaFirefox/firefox-sync-system-nss.patch	Tue Aug 24 09:30:55 2010 +0200
@@ -0,0 +1,1 @@
+../firefox-sync-system-nss.patch
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/firefox-sync-system-nss.patch	Tue Aug 24 09:30:55 2010 +0200
@@ -0,0 +1,57 @@
+# HG changeset patch
+# Parent 1e4f0a7028202f758195452878b0299a587a4b4e
+Bug 583209 - Weave fails to load if system libnss3.so is in use (OpenSolaris, Linux dists)
+https://bugzilla.mozilla.org/show_bug.cgi?id=583209
+
+diff --git a/services/crypto/WeaveCrypto.js b/services/crypto/WeaveCrypto.js
+--- a/services/crypto/WeaveCrypto.js
++++ b/services/crypto/WeaveCrypto.js
+@@ -102,44 +102,23 @@ WeaveCrypto.prototype = {
+     initNSS : function() {
+         // We use NSS for the crypto ops, which needs to be initialized before
+         // use. By convention, PSM is required to be the module that
+         // initializes NSS. So, make sure PSM is initialized in order to
+         // implicitly initialize NSS.
+         Cc["@mozilla.org/psm;1"].getService(Ci.nsISupports);
+ 
+         // Open the NSS library.
+-        let nssfile = Services.dirsvc.get("GreD", Ci.nsILocalFile);
+         let os = Services.appinfo.OS;
+-        switch (os) {
+-          case "WINNT":
+-          case "WINMO":
+-          case "WINCE":
+-            nssfile.append("nss3.dll");
+-            break;
+-          case "Darwin":
+-            nssfile.append("libnss3.dylib");
+-            break;
+-          case "Linux":
+-          case "SunOS":
+-          case "WebOS": // Palm Pre
+-            nssfile.append("libnss3.so");
+-            break;
+-          case "Android":
+-            // Android uses a $GREDIR/lib/ subdir.
+-            nssfile.append("lib");
+-            nssfile.append("libnss3.so");
+-            break;
+-          default:
+-            throw Components.Exception("unsupported platform: " + os, Cr.NS_ERROR_UNEXPECTED);
+-        }
+-        this.log("Using NSS library " + nssfile.path);
++        let path = ctypes.libraryName("nss3");
++
++        this.log("Using NSS library " + path);
+ 
+         // XXX really want to be able to pass specific dlopen flags here.
+-        let nsslib = ctypes.open(nssfile.path);
++        let nsslib = ctypes.open(path);
+ 
+         this.log("Initializing NSS types and function declarations...");
+ 
+         this.nss = {};
+         this.nss_t = {};
+ 
+         // nsprpub/pr/include/prtypes.h#435
+         // typedef PRIntn PRBool; --> int
--- a/series	Wed Aug 18 11:41:42 2010 +0200
+++ b/series	Tue Aug 24 09:30:55 2010 +0200
@@ -22,3 +22,4 @@
 firefox-kde.patch
 #firefox-ui-lockdown.patch
 firefox-no-sync-l10n.patch
+firefox-sync-system-nss.patch