From cac93f67e8bde1d18ef93d272f5830e1dd88a7a2 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 18 Jul 2024 20:45:42 +0300 Subject: [PATCH] CMake, Nix: add VERSION file --- CMakeLists.txt | 3 ++- VERSION | 1 + nix/overlays.nix | 4 +++- 3 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 VERSION diff --git a/CMakeLists.txt b/CMakeLists.txt index 8500386..1707cb9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,7 @@ cmake_minimum_required(VERSION 3.19) -set(VERSION 0.4.0) +file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW) +string(STRIP ${VER_RAW} VERSION) project(hyprlock DESCRIPTION "A gpu-accelerated screen lock for Hyprland" diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..1d0ba9e --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.4.0 diff --git a/nix/overlays.nix b/nix/overlays.nix index 414b1ae..d4ec360 100644 --- a/nix/overlays.nix +++ b/nix/overlays.nix @@ -7,6 +7,8 @@ (builtins.substring 4 2 longDate) (builtins.substring 6 2 longDate) ]); + + version = lib.removeSuffix "\n" (builtins.readFile ../VERSION); in { default = inputs.self.overlays.hyprlock; @@ -16,7 +18,7 @@ in { (final: prev: { hyprlock = prev.callPackage ./default.nix { 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; }; })