Skip to content

Commit 6a29c74

Browse files
read CEF version from CMakeLists.txt
1 parent 9ee655e commit 6a29c74

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

default.nix

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,15 @@ let
5555
};
5656
}
5757
.${platform};
58-
cef_version = "146.0.9+g3ca6a87+chromium-146.0.7680.165";
59-
inherit (arches) depsArch projectArch targetArch;
58+
cmakeListsContent = builtins.readFile ./CMakeLists.txt;
59+
60+
# The regex looks for the CEF_VERSION variable and captures the content inside quotes
61+
# [^"]+ matches one or more characters that are NOT a double quote
62+
match = builtins.match ".*set\\(CEF_VERSION \"([^\"]+)\"\\).*" (builtins.replaceStrings ["\n"] [" "] cmakeListsContent);
6063

64+
# builtins.match returns a list of captures or null if no match is found
65+
cef_version = if match != null then builtins.head match else "unknown";
66+
inherit (arches) depsArch projectArch targetArch;
6167
in
6268
pkgs.stdenv.mkDerivation rec {
6369
pname = "jcef-ccbluex";
@@ -89,7 +95,7 @@ pkgs.stdenv.mkDerivation rec {
8995
name = "cef_binary_${cef_version}_${platform}";
9096
hash =
9197
{
92-
"linux64" = "sha256-ELgbopPAN/GZuYRi3RqSTe44PFwN4UyQHhNPeRjxF3U=";
98+
"linux64" = "sha256-8qZCfpYPgAABhLQXvW7ZIcFxU29EiHllB9n+YH2AGXw=";
9399
}
94100
.${platform};
95101
urlName = builtins.replaceStrings [ "+" ] [ "%2B" ] name;

0 commit comments

Comments
 (0)