CMake, Nix: add VERSION file

This commit is contained in:
Mihai Fufezan 2024-07-18 20:34:06 +03:00
parent eb1ceff2b8
commit 928d9b4ee9
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(HYPRUTILS_VERSION "0.2.0") file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)
string(STRIP ${VER_RAW} HYPRUTILS_VERSION)
add_compile_definitions(HYPRUTILS_VERSION="${HYPRUTILS_VERSION}") add_compile_definitions(HYPRUTILS_VERSION="${HYPRUTILS_VERSION}")
project(hyprutils project(hyprutils

1
VERSION Normal file
View file

@ -0,0 +1 @@
0.2.0

View file

@ -23,13 +23,15 @@
(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 {
overlays = { overlays = {
default = self.overlays.hyprutils; default = self.overlays.hyprutils;
hyprutils = final: prev: { hyprutils = final: prev: {
hyprutils = final.callPackage ./nix/default.nix { hyprutils = final.callPackage ./nix/default.nix {
stdenv = final.gcc13Stdenv; stdenv = final.gcc13Stdenv;
version = "0.pre" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
}; };
hyprutils-with-tests = final.hyprutils.override {doCheck = true;}; hyprutils-with-tests = final.hyprutils.override {doCheck = true;};
}; };