From 1675cc8a0f3e13c5e21c6ff98fafeab39d2984e7 Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sat, 20 Dec 2025 02:10:41 +0900 Subject: [PATCH] Sync version with SFD file The version was 1.28.0, but the actual version in the SFD file is 1.30.0. This change aligns the Nix package version with the source. --- flake.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/flake.nix b/flake.nix index 1a98f34..e382c0a 100644 --- a/flake.nix +++ b/flake.nix @@ -14,6 +14,7 @@ system: let pkgs = nixpkgs.legacyPackages.${system}; + inherit (pkgs) lib; in { devShells = { @@ -33,7 +34,19 @@ # Derivation to build and install cozette cozette = pkgs.stdenvNoCC.mkDerivation { pname = "cozette"; - version = "1.28.0"; + version = + let + sfdLines = lib.strings.splitString "\n" (builtins.readFile ./Cozette/Cozette.sfd); + sfdVersionLine = lib.lists.findFirst (l: lib.strings.hasPrefix "Version: " l) null sfdLines; + sfdVersion = + if sfdVersionLine != null then lib.strings.removePrefix "Version: " sfdVersionLine else "0.00"; + majorRest = lib.strings.splitString "." sfdVersion; + major = builtins.elemAt majorRest 0; + minorPatch = builtins.elemAt majorRest 1; + minor = builtins.substring 0 2 minorPatch; + patch = builtins.substring 2 1 minorPatch; + in + "${major}.${minor}.${patch}"; src = ./.; @@ -55,7 +68,7 @@ postPatch = '' substituteInPlace build.py --replace-fail \ - 'bitsnpicas.sh' '${pkgs.lib.getExe pkgs.bitsnpicas}' + 'bitsnpicas.sh' '${lib.getExe pkgs.bitsnpicas}' ''; buildPhase = ''