Skip to content

Commit

Permalink
CMake, Meson, Nix: replace props.json with VERSION
Browse files Browse the repository at this point in the history
  • Loading branch information
fufexan committed Jul 21, 2024
1 parent faa157e commit 928d1dd
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ include(CheckIncludeFile)
include(GNUInstallDirs)

# Get version
file(READ ${CMAKE_CURRENT_SOURCE_DIR}/props.json PROPS)
string(JSON VER GET ${PROPS} version)
file(READ "${CMAKE_SOURCE_DIR}/VERSION" VER_RAW)
string(STRIP ${VER_RAW} VER)

project(Hyprland
DESCRIPTION "A Modern C++ Wayland Compositor"
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.41.2
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
project('Hyprland', 'cpp', 'c',
version : run_command('jq', '-r', '.version', join_paths(meson.source_root(), 'props.json'), check: true).stdout().strip(),
version : run_command('cat', join_paths(meson.source_root(), 'VERSION'), check: true).stdout().strip(),
default_options : [
'warning_level=2',
'default_library=static',
Expand Down
5 changes: 2 additions & 3 deletions nix/overlays.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
lib,
inputs,
}: let
props = builtins.fromJSON (builtins.readFile ../props.json);

mkDate = longDate: (lib.concatStringsSep "-" [
(builtins.substring 0 4 longDate)
(builtins.substring 4 2 longDate)
(builtins.substring 6 2 longDate)
]);
version = lib.removeSuffix "\n" (builtins.readFile ../VERSION);
in {
# Contains what a user is most likely to care about:
# Hyprland itself, XDPH and the Share Picker.
Expand All @@ -33,7 +32,7 @@ in {
in {
hyprland = final.callPackage ./default.nix {
stdenv = final.gcc13Stdenv;
version = "${props.version}+date=${date}_${self.shortRev or "dirty"}";
version = "${version}+date=${date}_${self.shortRev or "dirty"}";
commit = self.rev or "";
inherit date;
};
Expand Down
3 changes: 0 additions & 3 deletions props.json

This file was deleted.

0 comments on commit 928d1dd

Please sign in to comment.