diff options
Diffstat (limited to 'pkgs/applications/networking/browsers/firefox/common.nix')
-rw-r--r-- | pkgs/applications/networking/browsers/firefox/common.nix | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index a98891df4d13..1fbfdc2a7da6 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -4,7 +4,7 @@ { lib, stdenv, pkgconfig, pango, perl, python2, python3, zip , libjpeg, zlib, dbus, dbus-glib, bzip2, xorg -, freetype, fontconfig, file, nspr, nss, libnotify +, freetype, fontconfig, file, nspr, nss, nss_3_53, libnotify , yasm, libGLU, libGL, sqlite, unzip, makeWrapper , hunspell, libXdamage, libevent, libstartup_notification , libvpx_1_8 @@ -23,7 +23,7 @@ , ffmpegSupport ? true , gtk3Support ? true, gtk2, gtk3, wrapGAppsHook , waylandSupport ? true, libxkbcommon -# LTO is disabled since it caused segfaults on wayland see https://github.com/NixOS/nixpkgs/issues/10142 +# LTO is disabled since it caused segfaults on wayland see https://github.com/NixOS/nixpkgs/issues/101429 , ltoSupport ? false, overrideCC, buildPackages , gssSupport ? true, kerberos , pipewireSupport ? waylandSupport && webrtcSupport, pipewire @@ -106,6 +106,8 @@ let # 78 ESR won't build with rustc 1.47 inherit (if lib.versionAtLeast ffversion "82" then rustPackages else rustPackages_1_45) rustc cargo; + + nss_pkg = if lib.versionOlder ffversion "83" then nss_3_53 else nss; in buildStdenv.mkDerivation ({ @@ -116,12 +118,38 @@ buildStdenv.mkDerivation ({ patches = [ ./env_var_for_system_dir.patch - ] ++ lib.optional pipewireSupport + ./no-buildconfig-ffx76.patch + ] ++ + + # there are two flavors of pipewire support + # The patches for the ESR release and the patches for the current stable + # release. + # Until firefox upstream stabilizes pipewire support we will have to continue + # tracking multiple versions here. + lib.optional (pipewireSupport && lib.versionOlder ffversion "83") (fetchpatch { # https://src.fedoraproject.org/rpms/firefox/blob/master/f/firefox-pipewire-0-3.patch url = "https://src.fedoraproject.org/rpms/firefox/raw/e99b683a352cf5b2c9ff198756859bae408b5d9d/f/firefox-pipewire-0-3.patch"; sha256 = "0qc62di5823r7ly2lxkclzj9rhg2z7ms81igz44nv0fzv3dszdab"; }) + ++ + # This picks pipewire patches from fedora that are part of https://bugzilla.mozilla.org/show_bug.cgi?id=1672944 + lib.optionals (pipewireSupport && lib.versionAtLeast ffversion "83") (let + fedora_revision = "d6756537dd8cf4d9816dc63ada66ea026e0fd128"; + mkPWPatch = spec: fetchpatch { + inherit (spec) name sha256; + url = "https://src.fedoraproject.org/rpms/firefox/raw/${fedora_revision}/f/${spec.name}"; + }; + in map mkPWPatch [ + { name = "pw1.patch"; sha256 = "1a7zvngn3k7dg886zmi38kmrsdzh2rrr46aw59bhr1gfmq8wlwn0"; } + { name = "pw2.patch"; sha256 = "17irg3yb2mchcy0z0nr4k65mwvkps467cvvczr10fnm06lhkhw1l"; } + { name = "pw3.patch"; sha256 = "12p6ql5ff2lfzlni6xkpz63h2xr6n2a9zf8hhjl99fj56rif6706"; } + { name = "pw4.patch"; sha256 = "0rvysc92rdm98s47w5lvbnrklrf7d299k3918qnldniyb4b9p4mg"; } + { name = "pw5.patch"; sha256 = "0kk2yxq4qkfwc4px6m08jrn18a7a7dhrngfiaw84r9ga6sgn0z00"; } + { name = "pw6.patch"; sha256 = "12lhx9wjpw0ahbfmw07wsx76bb223mr453q9cg8cq951vyskch3s"; } + { name = "pw7.patch"; sha256 = "0afw7cfd48vn62zb9y5kd2l26fg44s3aq1kyg3gm4q3rj34xidf6"; } + ]) + ++ patches; @@ -144,7 +172,7 @@ buildStdenv.mkDerivation ({ # yasm can potentially be removed in future versions # https://bugzilla.mozilla.org/show_bug.cgi?id=1501796 # https://groups.google.com/forum/#!msg/mozilla.dev.platform/o-8levmLU80/SM_zQvfzCQAJ - nspr nss + nspr nss_pkg ] ++ lib.optional alsaSupport alsaLib ++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed @@ -165,14 +193,14 @@ buildStdenv.mkDerivation ({ NIX_CFLAGS_COMPILE = toString [ "-I${glib.dev}/include/gio-unix-2.0" - "-I${nss.dev}/include/nss" + "-I${nss_pkg.dev}/include/nss" ]; MACH_USE_SYSTEM_PYTHON = "1"; postPatch = '' rm -rf obj-x86_64-pc-linux-gnu - '' + lib.optionalString pipewireSupport '' + '' + lib.optionalString (pipewireSupport && lib.versionOlder ffversion "83") '' # substitute the /usr/include/ lines for the libraries that pipewire provides. # The patch we pick from fedora only contains the generated moz.build files # which hardcode the dependency paths instead of running pkg_config. @@ -359,4 +387,6 @@ buildStdenv.mkDerivation ({ # on aarch64 this is also required dontUpdateAutotoolsGnuConfigScripts = true; + + requiredSystemFeatures = [ "big-parallel" ]; }) |