From 88320091fac59584068fab5e2e944bc563219150 Mon Sep 17 00:00:00 2001 From: ajs124 Date: Mon, 12 Jul 2021 15:38:03 +0200 Subject: [PATCH] firefox: 89.0.2 -> 90.0 make gtk3Support non-optional, because it hasn't been for a long time also make gtk2 conditional on firefox older than 90, because we can get rid of it with firefox 90, but it's still needed by the current ESR release (cherry picked from commit b332794adf841262958424c623c442cc8fab92e8) --- .../networking/browsers/firefox/common.nix | 19 +++++++++---------- ...ffx84.patch => no-buildconfig-ffx90.patch} | 15 ++++++--------- .../networking/browsers/firefox/packages.nix | 4 ++-- 3 files changed, 17 insertions(+), 21 deletions(-) rename pkgs/applications/networking/browsers/firefox/{no-buildconfig-ffx84.patch => no-buildconfig-ffx90.patch} (61%) diff --git a/pkgs/applications/networking/browsers/firefox/common.nix b/pkgs/applications/networking/browsers/firefox/common.nix index 51a671cb198..13cf0ea0162 100644 --- a/pkgs/applications/networking/browsers/firefox/common.nix +++ b/pkgs/applications/networking/browsers/firefox/common.nix @@ -12,6 +12,7 @@ , autoconf213, which, gnused, rustPackages, rustPackages_1_45 , rust-cbindgen, nodejs, nasm, fetchpatch , gnum4 +, gtk2, gtk3, wrapGAppsHook , debugBuild ? false ### optionals @@ -25,7 +26,6 @@ , alsaSupport ? stdenv.isLinux, alsaLib , pulseaudioSupport ? stdenv.isLinux, libpulseaudio , ffmpegSupport ? true -, gtk3Support ? true, gtk2, gtk3, wrapGAppsHook , waylandSupport ? true, libxkbcommon, libdrm , ltoSupport ? (stdenv.isLinux && stdenv.is64bit), overrideCC, buildPackages , gssSupport ? true, libkrb5 @@ -83,7 +83,7 @@ let flag = tf: x: [(if tf then "--enable-${x}" else "--disable-${x}")]; default-toolkit = if stdenv.isDarwin then "cairo-cocoa" - else "cairo-gtk${if gtk3Support then "3${lib.optionalString waylandSupport "-wayland"}" else "2"}"; + else "cairo-gtk3${lib.optionalString waylandSupport "-wayland"}"; binaryName = "firefox"; binaryNameCapitalized = lib.toUpper (lib.substring 0 1 binaryName) + lib.substring 1 (-1) binaryName; @@ -145,7 +145,7 @@ buildStdenv.mkDerivation ({ lib.optional (lib.versionOlder ffversion "86") ./env_var_for_system_dir-ff85.patch ++ lib.optional (lib.versionAtLeast ffversion "86") ./env_var_for_system_dir-ff86.patch ++ lib.optional (lib.versionOlder ffversion "83") ./no-buildconfig-ffx76.patch ++ - lib.optional (lib.versionAtLeast ffversion "84") ./no-buildconfig-ffx84.patch ++ + lib.optional (lib.versionAtLeast ffversion "90") ./no-buildconfig-ffx90.patch ++ lib.optional (ltoSupport && lib.versionOlder ffversion "84") ./lto-dependentlibs-generation-ffx83.patch ++ lib.optional (ltoSupport && lib.versionAtLeast ffversion "84" && lib.versionOlder ffversion "86") (fetchpatch { @@ -170,7 +170,7 @@ buildStdenv.mkDerivation ({ patchFlags = [ "-p1" "-l" ]; buildInputs = [ - gtk2 perl zip libjpeg zlib bzip2 + gtk3 perl zip libjpeg zlib bzip2 dbus dbus-glib pango freetype fontconfig xorg.libXi xorg.libXcursor xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file xorg.pixman yasm libGLU libGL @@ -188,14 +188,14 @@ buildStdenv.mkDerivation ({ ] ++ lib.optional alsaSupport alsaLib ++ lib.optional pulseaudioSupport libpulseaudio # only headers are needed - ++ lib.optional gtk3Support gtk3 ++ lib.optional gssSupport libkrb5 ++ lib.optionals waylandSupport [ libxkbcommon libdrm ] ++ lib.optional pipewireSupport pipewire ++ lib.optional (lib.versionAtLeast ffversion "82") gnum4 ++ lib.optionals buildStdenv.isDarwin [ CoreMedia ExceptionHandling Kerberos AVFoundation MediaToolbox CoreLocation - Foundation libobjc AddressBook cups ]; + Foundation libobjc AddressBook cups ] + ++ lib.optional (lib.versionOlder ffversion "90") gtk2; NIX_LDFLAGS = lib.optionalString ltoSupport '' -rpath ${llvmPackages.libunwind.out}/lib @@ -238,8 +238,8 @@ buildStdenv.mkDerivation ({ rustc which unzip + wrapGAppsHook ] - ++ lib.optional gtk3Support wrapGAppsHook ++ lib.optionals buildStdenv.isDarwin [ xcbuild rsync ] ++ extraNativeBuildInputs; @@ -368,8 +368,6 @@ buildStdenv.mkDerivation ({ passthru = { inherit updateScript; version = ffversion; - isFirefox3Like = true; - gtk = gtk2; inherit alsaSupport; inherit pipewireSupport; inherit nspr; @@ -378,7 +376,8 @@ buildStdenv.mkDerivation ({ inherit execdir; inherit browserName; inherit tests; - } // lib.optionalAttrs gtk3Support { inherit gtk3; }; + inherit gtk3; + }; hardeningDisable = [ "format" ]; # -Werror=format-security diff --git a/pkgs/applications/networking/browsers/firefox/no-buildconfig-ffx84.patch b/pkgs/applications/networking/browsers/firefox/no-buildconfig-ffx90.patch similarity index 61% rename from pkgs/applications/networking/browsers/firefox/no-buildconfig-ffx84.patch rename to pkgs/applications/networking/browsers/firefox/no-buildconfig-ffx90.patch index c4187fcda39..c8d2028f30b 100644 --- a/pkgs/applications/networking/browsers/firefox/no-buildconfig-ffx84.patch +++ b/pkgs/applications/networking/browsers/firefox/no-buildconfig-ffx90.patch @@ -1,25 +1,22 @@ -diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp -index 10ac77b..0125d9b 100644 --- a/docshell/base/nsAboutRedirector.cpp +++ b/docshell/base/nsAboutRedirector.cpp -@@ -63,8 +63,6 @@ static const RedirEntry kRedirMap[] = { +@@ -66,8 +66,6 @@ static const RedirEntry kRedirMap[] = { {"about", "chrome://global/content/aboutAbout.html", 0}, - {"addons", "chrome://mozapps/content/extensions/extensions.xhtml", + {"addons", "chrome://mozapps/content/extensions/aboutaddons.html", nsIAboutModule::ALLOW_SCRIPT}, - {"buildconfig", "chrome://global/content/buildconfig.html", - nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT}, {"checkerboard", "chrome://global/content/aboutCheckerboard.html", nsIAboutModule::URI_SAFE_FOR_UNTRUSTED_CONTENT | nsIAboutModule::ALLOW_SCRIPT}, -diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn -index c83b3e2..d543140 100644 --- a/toolkit/content/jar.mn +++ b/toolkit/content/jar.mn -@@ -40,7 +40,6 @@ toolkit.jar: +@@ -39,8 +39,6 @@ toolkit.jar: + content/global/plugins.html content/global/plugins.css content/global/plugins.js - content/global/browser-child.js -* content/global/buildconfig.html - content/global/buildconfig.css +- content/global/buildconfig.css content/global/contentAreaUtils.js content/global/datepicker.xhtml + #ifndef MOZ_FENNEC diff --git a/pkgs/applications/networking/browsers/firefox/packages.nix b/pkgs/applications/networking/browsers/firefox/packages.nix index 01611fd41dd..f00f0bfeee2 100644 --- a/pkgs/applications/networking/browsers/firefox/packages.nix +++ b/pkgs/applications/networking/browsers/firefox/packages.nix @@ -7,10 +7,10 @@ in rec { firefox = common rec { pname = "firefox"; - ffversion = "89.0.2"; + ffversion = "90.0"; src = fetchurl { url = "mirror://mozilla/firefox/releases/${ffversion}/source/firefox-${ffversion}.source.tar.xz"; - sha512 = "ffd98ab0887611c5b4aba68346c49a7a31a58150fd8bbae610a4d941c4cff0acef0daaebfbb577787a759b4c1ef3c1199f02681148612f4f5b709983e07e0ccb"; + sha512 = "233ad59e4ab2f08d2253b49235b51b26fa32fb7c285928110573ccbe67c79965d9401a6c58a3af2ad22b8a58ca5d9b3154e3e8c9d29b153acd16152d9b75442c"; }; meta = {