diff --git a/default.nix b/default.nix index e6e3df4..3ef8cf3 100644 --- a/default.nix +++ b/default.nix @@ -5,9 +5,17 @@ installShellFiles, ... }: +let + cmakeContent = builtins.readFile ./CMakeLists.txt; + cmakeLines = lib.splitString "\n" cmakeContent; + # Find the line containing set(KE_VERSION "...") + versionLine = lib.findFirst (l: builtins.match ".*set\\(KE_VERSION \".+\"\\).*" l != null) (throw "KE_VERSION not found in CMakeLists.txt") cmakeLines; + # Extract the version number + version = builtins.head (builtins.match ".*set\\(KE_VERSION \"(.+)\"\\).*" versionLine); +in stdenv.mkDerivation { pname = "ke"; - version = "1.5.1"; + inherit version; src = lib.cleanSource ./.;