Skip to content

Commit

Permalink
firefox: prepare pipewire patches for firefox 83
Browse files Browse the repository at this point in the history
  • Loading branch information
andir committed Nov 18, 2020
1 parent 94448ba commit 398cdab
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions pkgs/applications/networking/browsers/firefox/common.nix
Expand Up @@ -116,12 +116,37 @@ buildStdenv.mkDerivation ({

patches = [
./env_var_for_system_dir.patch
] ++ lib.optional pipewireSupport
] ++

# 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;


Expand Down Expand Up @@ -172,7 +197,7 @@ buildStdenv.mkDerivation ({

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.
Expand Down

0 comments on commit 398cdab

Please sign in to comment.