diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 779cfb92d88b..14a5ba2e05a6 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -1,8 +1,15 @@ { pname, version, meta, updateScript ? null , binaryName ? "firefox", application ? "browser" -, src, unpackPhase ? null, patches ? [] -, extraNativeBuildInputs ? [], extraConfigureFlags ? [], extraMakeFlags ? [], tests ? [] -, extraPostPatch ? "", extraPassthru ? {} }: +, src, unpackPhase ? null +, extraPatches ? [] +, extraPostPatch ? "" +, extraNativeBuildInputs ? [] +, extraConfigureFlags ? [] +, extraMakeFlags ? [] +, extraPassthru ? {} +, tests ? [] +}: + { lib, stdenv, pkg-config, pango, perl, python3, zip , libjpeg, zlib, dbus, dbus-glib, bzip2, xorg @@ -141,12 +148,19 @@ buildStdenv.mkDerivation ({ inherit src unpackPhase meta; patches = [ - ] ++ - lib.optional (lib.versionAtLeast version "86") ./env_var_for_system_dir-ff86.patch ++ - lib.optional (lib.versionAtLeast version "90" && lib.versionOlder version "95") ./no-buildconfig-ffx90.patch ++ - lib.optional (lib.versionAtLeast version "96") ./no-buildconfig-ffx96.patch ++ + ] + ++ lib.optional (lib.versionAtLeast version "86") ./env_var_for_system_dir-ff86.patch + ++ lib.optional (lib.versionAtLeast version "90" && lib.versionOlder version "95") ./no-buildconfig-ffx90.patch + ++ lib.optional (lib.versionAtLeast version "96") ./no-buildconfig-ffx96.patch + ++ extraPatches; - patches; + postPatch = '' + rm -rf obj-x86_64-pc-linux-gnu + substituteInPlace toolkit/xre/glxtest.cpp \ + --replace 'dlopen("libpci.so' 'dlopen("${pciutils}/lib/libpci.so' + + patchShebangs mach + '' + extraPostPatch; # Ignore trivial whitespace changes in patches, this fixes compatibility of # ./env_var_for_system_dir.patch with Firefox >=65 without having to track @@ -179,14 +193,6 @@ buildStdenv.mkDerivation ({ MACH_USE_SYSTEM_PYTHON = "1"; - postPatch = '' - rm -rf obj-x86_64-pc-linux-gnu - substituteInPlace toolkit/xre/glxtest.cpp \ - --replace 'dlopen("libpci.so' 'dlopen("${pciutils}/lib/libpci.so' - - patchShebangs mach - '' + extraPostPatch; - nativeBuildInputs = [ autoconf diff --git a/pkgs/applications/networking/browsers/firefox/librewolf/default.nix b/pkgs/applications/networking/browsers/firefox/librewolf/default.nix index 4d8fe708e75a..10b65e8825c2 100644 --- a/pkgs/applications/networking/browsers/firefox/librewolf/default.nix +++ b/pkgs/applications/networking/browsers/firefox/librewolf/default.nix @@ -6,7 +6,7 @@ rec { inherit (src) packageVersion firefox source; - patches = [ ./verify-telemetry-macros.patch ]; + extraPatches = [ ./verify-telemetry-macros.patch ]; extraConfigureFlags = [ "--with-app-name=librewolf" @@ -34,7 +34,7 @@ rec { extraPoliciesFiles = [ "${source}/submodules/settings/distribution/policies.json" ]; extraPassthru = { - librewolf = { inherit src patches; }; + librewolf = { inherit src extraPatches; }; inherit extraPrefsFiles extraPoliciesFiles; }; } diff --git a/pkgs/applications/networking/mailreaders/thunderbird/packages.nix b/pkgs/applications/networking/mailreaders/thunderbird/packages.nix index 3ab0c58ecc5e..d559976d8003 100644 --- a/pkgs/applications/networking/mailreaders/thunderbird/packages.nix +++ b/pkgs/applications/networking/mailreaders/thunderbird/packages.nix @@ -17,7 +17,7 @@ rec { url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz"; sha512 = "2afaee16f155edcb0bdb46ebe282a733cf041ec6f562aebd06f8b675e46917f6f500fcc532fc54d74f3f4b0b489a88934a2c6c304f849873de4bc2690b9056a0"; }; - patches = [ + extraPatches = [ # The file to be patched is different from firefox's `no-buildconfig-ffx90.patch`. ./no-buildconfig.patch ];