firefox: rename patches arg to extraPatches

This is for consistency with other extra arguments that can be handed to
firefox common.nix.

Also pull the patch phase of the derivation closer together and use the
same list concat style as elsewhere.
This commit is contained in:
Martin Weinelt
2022-03-23 17:03:40 +01:00
parent 350f1345a7
commit 2f31fe95fd
3 changed files with 25 additions and 19 deletions
@@ -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
@@ -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;
};
}
@@ -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
];