mirror of
https://github.com/hyprwm/Hyprland
synced 2024-12-26 14:09:49 +01:00
Build: use props file for versioning
This commit is contained in:
parent
98ce867104
commit
a54247125f
4 changed files with 11 additions and 2 deletions
|
@ -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")
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -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',
|
||||
|
|
1
props.json
Normal file
1
props.json
Normal file
|
@ -0,0 +1 @@
|
|||
{"version": "0.20.0"}
|
Loading…
Reference in a new issue