CMake, Nix: add VERSION file

This commit is contained in:
Mihai Fufezan 2024-07-18 20:37:19 +03:00
parent 5df0174fd0
commit c0704455ee
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(HYPRLANG_VERSION "0.5.2") file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)
string(STRIP ${VER_RAW} HYPRLANG_VERSION)
project(hyprlang project(hyprlang
VERSION ${HYPRLANG_VERSION} VERSION ${HYPRLANG_VERSION}

1
VERSION Normal file
View file

@ -0,0 +1 @@
0.5.2

View file

@ -30,6 +30,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 {
overlays = { overlays = {
default = self.overlays.hyprlang; default = self.overlays.hyprlang;
@ -38,7 +40,7 @@
(final: prev: { (final: prev: {
hyprlang = final.callPackage ./nix/default.nix { hyprlang = 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");
}; };
hyprlang-with-tests = final.hyprlang.override {doCheck = true;}; hyprlang-with-tests = final.hyprlang.override {doCheck = true;};
}) })