aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMihai Fufezan <[email protected]>2023-01-06 16:21:42 +0200
committerMihai Fufezan <[email protected]>2023-01-06 16:22:00 +0200
commita54247125f91358ef717ecee8801c4acebdb0b55 (patch)
tree927cb0a28b89aac2af1bae67ba79b586d3fc76b4
parent98ce867104b855824ee218296f91664e1fd60545 (diff)
downloadHyprland-a54247125f91358ef717ecee8801c4acebdb0b55.tar.gz
Hyprland-a54247125f91358ef717ecee8801c4acebdb0b55.zip
Build: use props file for versioning
-rw-r--r--CMakeLists.txt6
-rw-r--r--flake.nix4
-rw-r--r--meson.build2
-rw-r--r--props.json1
4 files changed, 11 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f3752eaf..04d9ec23 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,12 @@
cmake_minimum_required(VERSION 3.4)
+
+# Get version
+file(READ ${CMAKE_CURRENT_SOURCE_DIR}/props.json PROPS)
+string(JSON VER GET ${PROPS} version)
+
project(Hyprland
DESCRIPTION "A Modern C++ Wayland Compositor"
+ VERSION ${VER}
)
set(CMAKE_MESSAGE_LOG_LEVEL "STATUS")
diff --git a/flake.nix b/flake.nix
index 45d17067..a6def7bd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -33,6 +33,8 @@
pkgsFor = nixpkgs.legacyPackages;
+ props = builtins.fromJSON (builtins.readFile ./props.json);
+
mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
@@ -46,7 +48,7 @@
};
hyprland = prev.callPackage ./nix/default.nix {
stdenv = prev.gcc12Stdenv;
- version = "0.20.0beta" + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
+ version = props.version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
wlroots = wlroots-hyprland;
inherit (inputs) hyprland-protocols;
};
diff --git a/meson.build b/meson.build
index 5c096f8a..2f6892a0 100644
--- a/meson.build
+++ b/meson.build
@@ -1,5 +1,5 @@
project('Hyprland', 'cpp', 'c',
- version : '0.20.0beta',
+ version : run_command('jq', '-r', '.version', join_paths(meson.source_root(), 'props.json'), check: true).stdout().strip(),
default_options : [
'warning_level=2',
'default_library=static',
diff --git a/props.json b/props.json
new file mode 100644
index 00000000..e96cb77f
--- /dev/null
+++ b/props.json
@@ -0,0 +1 @@
+{"version": "0.20.0"}