CMake, Nix: add VERSION file

This commit is contained in:
Mihai Fufezan 2024-07-18 20:42:35 +03:00
parent fc4e3bd2dc
commit 2d774e6f32
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.19) cmake_minimum_required(VERSION 3.19)
set(VERSION 0.1.2) file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)
string(STRIP ${VER_RAW} VERSION)
project(hypridle project(hypridle
DESCRIPTION "An idle management daemon for Hyprland" DESCRIPTION "An idle management daemon for Hyprland"

1
VERSION Normal file
View file

@ -0,0 +1 @@
0.1.2

View file

@ -7,6 +7,8 @@
(builtins.substring 4 2 longDate) (builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate) (builtins.substring 6 2 longDate)
]); ]);
version = lib.removeSuffix "\n" (builtins.readFile ../VERSION);
in { in {
default = inputs.self.overlays.hypridle; default = inputs.self.overlays.hypridle;
@ -16,7 +18,7 @@ in {
(final: prev: { (final: prev: {
hypridle = prev.callPackage ./default.nix { hypridle = prev.callPackage ./default.nix {
stdenv = prev.gcc13Stdenv; stdenv = prev.gcc13Stdenv;
version = "0.pre" + "+date=" + (mkDate (inputs.self.lastModifiedDate or "19700101")) + "_" + (inputs.self.shortRev or "dirty"); version = version + "+date=" + (mkDate (inputs.self.lastModifiedDate or "19700101")) + "_" + (inputs.self.shortRev or "dirty");
inherit (final) hyprlang; inherit (final) hyprlang;
}; };
}) })