chromium: Move the version helper functions into default.nix
Those functions can be required anywhere in the Nix expressions for Chromium and therefore they should be defined in default.nix and inherited where necessary. This fixes the chromiumBeta build which failed because I forgot to update the channel conditional when the beta channel advanced to M94. This is exactly why the version based conditionals should be used everywhere. (cherry picked from commit 186315def77d62b53ad6ccdf57ec9593edbe8bc3)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
{ stdenv, lib, fetchurl, fetchpatch
|
||||
# Channel data:
|
||||
, channel, upstream-info
|
||||
# Helper functions:
|
||||
, chromiumVersionAtLeast, versionRange
|
||||
|
||||
# Native build inputs:
|
||||
, ninja, pkg-config
|
||||
@@ -106,18 +108,6 @@ let
|
||||
buildPath = "out/${buildType}";
|
||||
libExecPath = "$out/libexec/${packageName}";
|
||||
|
||||
warnObsoleteVersionConditional = min-version: result:
|
||||
let ungoogled-version = (importJSON ./upstream-info.json).ungoogled-chromium.version;
|
||||
in warnIf (versionAtLeast ungoogled-version min-version) "chromium: ungoogled version ${ungoogled-version} is newer than a conditional bounded at ${min-version}. You can safely delete it."
|
||||
result;
|
||||
chromiumVersionAtLeast = min-version:
|
||||
let result = versionAtLeast upstream-info.version min-version;
|
||||
in warnObsoleteVersionConditional min-version result;
|
||||
versionRange = min-version: upto-version:
|
||||
let inherit (upstream-info) version;
|
||||
result = versionAtLeast version min-version && versionOlder version upto-version;
|
||||
in warnObsoleteVersionConditional upto-version result;
|
||||
|
||||
ungoogler = ungoogled-chromium {
|
||||
inherit (upstream-info.deps.ungoogled-patches) rev sha256;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user