CMake, Nix: add VERSION file

This commit is contained in:
Mihai Fufezan 2024-07-18 20:48:30 +03:00
parent cbc16f939f
commit 06b93bbb77
Signed by: fufexan
SSH key fingerprint: SHA256:SdnKmEpJrDu1+2UO1QpB/Eg4HKcdDi6n+xSRqFNJVpg
3 changed files with 8 additions and 2 deletions

View file

@ -1,7 +1,11 @@
cmake_minimum_required(VERSION 3.12) cmake_minimum_required(VERSION 3.12)
file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)
string(STRIP ${VER_RAW} VERSION)
project(hyprpaper project(hyprpaper
DESCRIPTION "A blazing fast wayland wallpaper utility" DESCRIPTION "A blazing fast wayland wallpaper utility"
VERSION 0.7.0 VERSION ${VERSION}
) )
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS") set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")

1
VERSION Normal file
View file

@ -0,0 +1 @@
0.7.0

View file

@ -44,6 +44,7 @@
(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.hyprpaper; default = self.overlays.hyprpaper;
@ -54,7 +55,7 @@
(final: prev: rec { (final: prev: rec {
hyprpaper = final.callPackage ./nix/default.nix { hyprpaper = final.callPackage ./nix/default.nix {
stdenv = final.gcc13Stdenv; stdenv = final.gcc13Stdenv;
version = "0.7.0" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty"); version = version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
commit = self.rev or ""; commit = self.rev or "";
}; };
hyprpaper-debug = hyprpaper.override {debug = true;}; hyprpaper-debug = hyprpaper.override {debug = true;};