diff --git a/pkgs/applications/networking/browsers/firefox/packages.nix b/pkgs/applications/networking/browsers/firefox/packages.nix index e34120de9c00..10249aea4ee9 100644 --- a/pkgs/applications/networking/browsers/firefox/packages.nix +++ b/pkgs/applications/networking/browsers/firefox/packages.nix @@ -1,11 +1,7 @@ -{ stdenv, lib, callPackage, fetchurl, fetchpatch, nixosTests }: - -let - common = opts: callPackage (import ./common.nix opts) {}; -in +{ stdenv, lib, callPackage, fetchurl, fetchpatch, nixosTests, buildMozillaMach }: rec { - firefox = common rec { + firefox = buildMozillaMach rec { pname = "firefox"; version = "100.0"; src = fetchurl { @@ -30,7 +26,7 @@ rec { }; }; - firefox-esr-91 = common rec { + firefox-esr-91 = buildMozillaMach rec { pname = "firefox-esr"; version = "91.9.0esr"; src = fetchurl { @@ -54,30 +50,4 @@ rec { versionSuffix = "esr"; }; }; - - librewolf = - let - librewolf-src = callPackage ./librewolf { }; - in - (common rec { - pname = "librewolf"; - binaryName = "librewolf"; - version = librewolf-src.packageVersion; - src = librewolf-src.firefox; - inherit (librewolf-src) extraConfigureFlags extraPostPatch extraPassthru; - - meta = { - description = "A fork of Firefox, focused on privacy, security and freedom"; - homepage = "https://librewolf.net/"; - maintainers = with lib.maintainers; [ squalus ]; - inherit (firefox.meta) platforms badPlatforms broken maxSilent license; - }; - updateScript = callPackage ./librewolf/update.nix { - attrPath = "librewolf-unwrapped"; - }; - }).override { - crashreporterSupport = false; - enableOfficialBranding = false; - pgoSupport = false; # Profiling gets stuck and doesn't terminate. - }; } diff --git a/pkgs/applications/networking/browsers/librewolf/default.nix b/pkgs/applications/networking/browsers/librewolf/default.nix new file mode 100644 index 000000000000..8f3100de970d --- /dev/null +++ b/pkgs/applications/networking/browsers/librewolf/default.nix @@ -0,0 +1,31 @@ +{ stdenv, lib, callPackage, buildMozillaMach }: + +let + librewolf-src = callPackage ./librewolf.nix { }; +in +(buildMozillaMach rec { + pname = "librewolf"; + binaryName = "librewolf"; + version = librewolf-src.packageVersion; + src = librewolf-src.firefox; + inherit (librewolf-src) extraConfigureFlags extraPostPatch extraPassthru; + + meta = { + description = "A fork of Firefox, focused on privacy, security and freedom"; + homepage = "https://librewolf.net/"; + maintainers = with lib.maintainers; [ squalus ]; + platforms = lib.platforms.unix; + badPlatforms = lib.platforms.darwin; + broken = stdenv.buildPlatform.is32bit; # since Firefox 60, build on 32-bit platforms fails with "out of memory". + # not in `badPlatforms` because cross-compilation on 64-bit machine might work. + maxSilent = 14400; # 4h, double the default of 7200s (c.f. #129212, #129115) + license = lib.licenses.mpl20; + }; + updateScript = callPackage ./update.nix { + attrPath = "librewolf-unwrapped"; + }; +}).override { + crashreporterSupport = false; + enableOfficialBranding = false; + pgoSupport = false; # Profiling gets stuck and doesn't terminate. +} diff --git a/pkgs/applications/networking/browsers/firefox/librewolf/default.nix b/pkgs/applications/networking/browsers/librewolf/librewolf.nix similarity index 98% rename from pkgs/applications/networking/browsers/firefox/librewolf/default.nix rename to pkgs/applications/networking/browsers/librewolf/librewolf.nix index 10b65e8825c2..68ed776e91c9 100644 --- a/pkgs/applications/networking/browsers/firefox/librewolf/default.nix +++ b/pkgs/applications/networking/browsers/librewolf/librewolf.nix @@ -1,4 +1,4 @@ -{ callPackage, git }: +{ callPackage }: let src = callPackage ./src.nix { }; in diff --git a/pkgs/applications/networking/browsers/firefox/librewolf/src.json b/pkgs/applications/networking/browsers/librewolf/src.json similarity index 100% rename from pkgs/applications/networking/browsers/firefox/librewolf/src.json rename to pkgs/applications/networking/browsers/librewolf/src.json diff --git a/pkgs/applications/networking/browsers/firefox/librewolf/src.nix b/pkgs/applications/networking/browsers/librewolf/src.nix similarity index 100% rename from pkgs/applications/networking/browsers/firefox/librewolf/src.nix rename to pkgs/applications/networking/browsers/librewolf/src.nix diff --git a/pkgs/applications/networking/browsers/firefox/librewolf/update.nix b/pkgs/applications/networking/browsers/librewolf/update.nix similarity index 96% rename from pkgs/applications/networking/browsers/firefox/librewolf/update.nix rename to pkgs/applications/networking/browsers/librewolf/update.nix index 5cb5c6168f73..b8bc64afafe0 100644 --- a/pkgs/applications/networking/browsers/firefox/librewolf/update.nix +++ b/pkgs/applications/networking/browsers/librewolf/update.nix @@ -20,7 +20,7 @@ writeScript "update-librewolf" '' latestTag=$(curl https://gitlab.com/api/v4/projects/librewolf-community%2Fbrowser%2Fsource/repository/tags?per_page=1 | jq -r .[0].name) echo "latestTag=$latestTag" - srcJson=pkgs/applications/networking/browsers/firefox/librewolf/src.json + srcJson=pkgs/applications/networking/browsers/librewolf/src.json localRev=$(jq -r .source.rev < $srcJson) echo "localRev=$localRev" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c82544ce55bf..6707930edd47 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26404,11 +26404,13 @@ with pkgs; filezilla = callPackage ../applications/networking/ftp/filezilla { }; - firefoxPackages = recurseIntoAttrs (callPackage ../applications/networking/browsers/firefox/packages.nix { - callPackage = newScope { + buildMozillaMach = + let callPackage = newScope { inherit (rustPackages) cargo rustc; }; - }); + in opts: callPackage (import ../applications/networking/browsers/firefox/common.nix opts) {}; + + firefoxPackages = recurseIntoAttrs (callPackage ../applications/networking/browsers/firefox/packages.nix {}); firefox-unwrapped = firefoxPackages.firefox; firefox-esr-91-unwrapped = firefoxPackages.firefox-esr-91; @@ -26453,7 +26455,7 @@ with pkgs; desktopName = "Firefox DevEdition"; }; - librewolf-unwrapped = firefoxPackages.librewolf; + librewolf-unwrapped = callPackage ../applications/networking/browsers/librewolf {}; librewolf = wrapFirefox librewolf-unwrapped { inherit (librewolf-unwrapped) extraPrefsFiles extraPoliciesFiles;