librewolf: move out of firefox directory

Simplifies Firefox maintenance. See #160520

- make the firefox common.nix available from the top level as
  buildMozillaMach
- use new buildMozillaMach function in librewolf expressions
- minor changes to update script
This commit is contained in:
squalus 2022-05-10 00:10:21 -07:00
parent 517109653f
commit b1571265b5
7 changed files with 42 additions and 39 deletions

View file

@ -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.
};
}

View file

@ -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.
}

View file

@ -1,4 +1,4 @@
{ callPackage, git }:
{ callPackage }:
let
src = callPackage ./src.nix { };
in

View file

@ -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"

View file

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