Skip to content

Commit

Permalink
CMake, Nix: add VERSION file
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Jul 18, 2024
1 parent eb1ceff commit 928d9b4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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}")

project(hyprutils
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.2.0
4 changes: 3 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);

version = lib.removeSuffix "\n" (builtins.readFile ./VERSION);
in {
overlays = {
default = self.overlays.hyprutils;
hyprutils = final: prev: {
hyprutils = final.callPackage ./nix/default.nix {
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;};
};
Expand Down

0 comments on commit 928d9b4

Please sign in to comment.