summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers
diff options
context:
space:
mode:
authorJan Malakhovski <oxij@oxij.org>2018-03-06 22:33:11 +0000
committerJan Malakhovski <oxij@oxij.org>2018-03-09 21:21:06 +0000
commit23e2ea9cbabe43fe36c01380f59f406da65028c7 (patch)
treede4ffa3beffb334f6d47b6d5fce3387fb78fbad4 /pkgs/applications/networking/browsers
parent7cd02c8a4caa5a729076488e3caf86470274815e (diff)
downloadnixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.tar
nixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.tar.gz
nixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.tar.bz2
nixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.tar.lz
nixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.tar.xz
nixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.tar.zst
nixlib-23e2ea9cbabe43fe36c01380f59f406da65028c7.zip
firefoxPackages: add a patch to fix pulseaudio initialization bug
This is optional (`libcardiacarrest` has a workaround for this bug
because there's `firefox-bin` that I can't fix), but with this applied things
are a bit smoother.
Diffstat (limited to 'pkgs/applications/networking/browsers')
-rw-r--r--pkgs/applications/networking/browsers/firefox/fix-pa-context-connect-retval.patch26
-rw-r--r--pkgs/applications/networking/browsers/firefox/packages.nix26
2 files changed, 43 insertions, 9 deletions
diff --git a/pkgs/applications/networking/browsers/firefox/fix-pa-context-connect-retval.patch b/pkgs/applications/networking/browsers/firefox/fix-pa-context-connect-retval.patch
new file mode 100644
index 000000000000..1c3c32948944
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox/fix-pa-context-connect-retval.patch
@@ -0,0 +1,26 @@
+Yep, it's a "return code was ignored" bug.
+diff --git a/media/libcubeb/src/cubeb_pulse.c b/media/libcubeb/src/cubeb_pulse.c
+index aaaaaaaaaaa..bbbbbbbbbbb 100644
+--- a/media/libcubeb/src/cubeb_pulse.c
++++ b/media/libcubeb/src/cubeb_pulse.c
+@@ -473,6 +473,8 @@
+ static int
+ pulse_context_init(cubeb * ctx)
+ {
++  int r;
++
+   if (ctx->context) {
+     assert(ctx->error == 1);
+     pulse_context_destroy(ctx);
+@@ -486,9 +488,9 @@
+   WRAP(pa_context_set_state_callback)(ctx->context, context_state_callback, ctx);
+ 
+   WRAP(pa_threaded_mainloop_lock)(ctx->mainloop);
+-  WRAP(pa_context_connect)(ctx->context, NULL, 0, NULL);
++  r = WRAP(pa_context_connect)(ctx->context, NULL, 0, NULL);
+ 
+-  if (wait_until_context_ready(ctx) != 0) {
++  if (r < 0 || wait_until_context_ready(ctx) != 0) {
+     WRAP(pa_threaded_mainloop_unlock)(ctx->mainloop);
+     pulse_context_destroy(ctx);
+     ctx->context = NULL;
diff --git a/pkgs/applications/networking/browsers/firefox/packages.nix b/pkgs/applications/networking/browsers/firefox/packages.nix
index c21201a69db3..865bf4379d7e 100644
--- a/pkgs/applications/networking/browsers/firefox/packages.nix
+++ b/pkgs/applications/networking/browsers/firefox/packages.nix
@@ -1,6 +1,18 @@
 { lib, callPackage, stdenv, overrideCC, gcc5, fetchurl, fetchFromGitHub, fetchpatch }:
 
-let common = opts: callPackage (import ./common.nix opts); in
+let
+
+  common = opts: callPackage (import ./common.nix opts);
+
+  nixpkgsPatches = [
+    ./env_var_for_system_dir.patch
+
+    # this one is actually an omnipresent bug
+    # https://bugzilla.mozilla.org/show_bug.cgi?id=1444519
+    ./fix-pa-context-connect-retval.patch
+  ];
+
+in
 
 rec {
 
@@ -12,9 +24,8 @@ rec {
       sha512 = "ff748780492fc66b3e44c7e7641f16206e4c09514224c62d37efac2c59877bdf428a3670bfb50407166d7b505d4e2ea020626fd776b87f6abb6bc5d2e54c773f";
     };
 
-    patches = [
+    patches = nixpkgsPatches ++ [
       ./no-buildconfig.patch
-      ./env_var_for_system_dir.patch
 
       # https://bugzilla.mozilla.org/show_bug.cgi?id=1430274
       # Scheduled for firefox 59
@@ -49,8 +60,7 @@ rec {
       sha512 = "cf583df34272b7ff8841c3b093ca0819118f9c36d23c6f9b3135db298e84ca022934bcd189add6473922b199b47330c0ecf14c303ab4177c03dbf26e64476fa4";
     };
 
-    patches =
-      [ ./env_var_for_system_dir.patch ];
+    patches = nixpkgsPatches;
 
     meta = firefox.meta // {
       description = "A web browser built from Firefox Extended Support Release source tree";
@@ -127,8 +137,7 @@ in rec {
       sha256 = "169mjkr0bp80yv9nzza7kay7y2k03lpnx71h4ybcv9ygxgzdgax5";
     };
 
-    patches =
-      [ ./env_var_for_system_dir.patch ];
+    patches = nixpkgsPatches;
   } // commonAttrs) {};
 
   tor-browser-7-5 = common (rec {
@@ -145,8 +154,7 @@ in rec {
       sha256 = "0llbk7skh1n7yj137gv7rnxfasxsnvfjp4ss7h1fbdnw19yba115";
     };
 
-    patches =
-      [ ./env_var_for_system_dir.patch ];
+    patches = nixpkgsPatches;
   } // commonAttrs) {};
 
   tor-browser = tor-browser-7-5;