From 240a8f746e0e3e698fc87cb9934ffaef7e09e5bf Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Wed, 9 Dec 2020 19:29:31 +0100 Subject: [PATCH] ungoogled-chromium: Move ungoogled-src.nix into upstream-info.json This also adds a dedicated channel for ungoogled-chromium that enables us to update ungoogled-chromium independently of chromium. TODO: Automate ungoogled-chromium updates via update.py (currently it needs to be updated manually). Note: Unfortunately this changes the ungoogled-chromium derivation because common.nix passes the channel as an argument to stdenv.mkDerivation (this makes it more difficult to verify this commit but the result should remain the same). --- .../networking/browsers/chromium/browser.nix | 4 +++- .../networking/browsers/chromium/common.nix | 9 ++++----- .../networking/browsers/chromium/default.nix | 4 +++- .../browsers/chromium/ungoogled-src.nix | 6 ------ .../networking/browsers/chromium/update.py | 3 +++ .../browsers/chromium/upstream-info.json | 16 ++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 7 files changed, 30 insertions(+), 13 deletions(-) delete mode 100644 pkgs/applications/networking/browsers/chromium/ungoogled-src.nix diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index eab88297e68d..b9a42e825f31 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -85,7 +85,9 @@ mkChromiumDerivation (base: rec { else [ primeos thefloweringash bendlas ]; license = if enableWideVine then licenses.unfree else licenses.bsd3; platforms = platforms.linux; - hydraPlatforms = if channel == "stable" then ["aarch64-linux" "x86_64-linux"] else []; + hydraPlatforms = if (channel == "stable" || channel == "ungoogled-chromium") + then ["aarch64-linux" "x86_64-linux"] + else []; timeout = 172800; # 48 hours (increased from the Hydra default of 10h) }; }) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index c396e5996de7..d754c2769c90 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -110,11 +110,10 @@ let result else result; - ungoogler = - let versionEntry = (import ./ungoogled-src.nix)."${upstream-info.version}"; - in ungoogled-chromium { - inherit (versionEntry) rev sha256; - }; + ungoogler = ungoogled-chromium { + inherit (upstream-info.deps.ungoogled-patches) rev sha256; + }; + base = rec { name = "${packageName}-unwrapped-${version}"; inherit (upstream-info) version; diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index adf967251f29..0cbfbc332706 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -116,7 +116,9 @@ let }; }; - suffix = if channel != "stable" then "-" + channel else ""; + suffix = if (channel == "stable" || channel == "ungoogled-chromium") + then "" + else "-" + channel; sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName; diff --git a/pkgs/applications/networking/browsers/chromium/ungoogled-src.nix b/pkgs/applications/networking/browsers/chromium/ungoogled-src.nix deleted file mode 100644 index 26f2f730a41d..000000000000 --- a/pkgs/applications/networking/browsers/chromium/ungoogled-src.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ - "87.0.4280.88" = { - rev = "87.0.4280.88-1"; - sha256 = "0w2137w8hfcgl6f938hqnb4ffp33v5r8vdzxrvs814w7dszkiqgg"; - }; -} diff --git a/pkgs/applications/networking/browsers/chromium/update.py b/pkgs/applications/networking/browsers/chromium/update.py index 9e1f0aec598d..57fe268e72fe 100755 --- a/pkgs/applications/networking/browsers/chromium/update.py +++ b/pkgs/applications/networking/browsers/chromium/update.py @@ -113,9 +113,12 @@ with open(JSON_PATH, 'w') as out: return 1 elif channel_name == 'dev': return 2 + elif channel_name == 'ungoogled-chromium': + return 3 else: print(f'Error: Unexpected channel: {channel_name}', file=sys.stderr) sys.exit(1) + channels['ungoogled-chromium'] = last_channels['ungoogled-chromium'] # Keep ungoogled-chromium unchanged sorted_channels = OrderedDict(sorted(channels.items(), key=get_channel_key)) json.dump(sorted_channels, out, indent=2) out.write('\n') diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.json b/pkgs/applications/networking/browsers/chromium/upstream-info.json index 15899d31e726..5c824391341f 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.json +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.json @@ -42,5 +42,21 @@ "sha256": "1xcm07qjk6m2czi150fiqqxql067i832adck6zxrishm70c9jbr9" } } + }, + "ungoogled-chromium": { + "version": "87.0.4280.88", + "sha256": "1h09g9b2zxad85vd146ymvg3w2kpngpi78yig3dn1vrmhwr4aiiy", + "deps": { + "ungoogled-patches": { + "rev": "87.0.4280.88-1", + "sha256": "0w2137w8hfcgl6f938hqnb4ffp33v5r8vdzxrvs814w7dszkiqgg" + }, + "gn": { + "version": "2020-09-09", + "url": "https://gn.googlesource.com/gn", + "rev": "e002e68a48d1c82648eadde2f6aafa20d08c36f2", + "sha256": "0x4c7amxwzxs39grqs3dnnz0531mpf1p75niq7zhinyfqm86i4dk" + } + } } } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6623af0e4594..c8952b85c2c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24416,6 +24416,7 @@ in ungoogled-chromium = callPackage ../applications/networking/browsers/chromium ((config.chromium or {}) // { ungoogled = true; + channel = "ungoogled-chromium"; }); unigine-valley = callPackage ../applications/graphics/unigine-valley { };