mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-13 13:46:02 +01:00
nix: show commit in hyprctl
This commit is contained in:
parent
fea2031bfe
commit
5184b542b1
3 changed files with 17 additions and 0 deletions
|
@ -79,6 +79,7 @@
|
|||
stdenv = prev.gcc12Stdenv;
|
||||
version = props.version + "+date=" + (mkDate (self.lastModifiedDate or "19700101")) + "_" + (self.shortRev or "dirty");
|
||||
wlroots = wlroots-hyprland;
|
||||
commit = self.rev or "";
|
||||
inherit (inputs.hyprland-protocols.packages.${prev.stdenv.hostPlatform.system}) hyprland-protocols;
|
||||
inherit udis86;
|
||||
};
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
nvidiaPatches ? false,
|
||||
withSystemd ? true,
|
||||
version ? "git",
|
||||
commit,
|
||||
}: let
|
||||
assertXWayland = lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
||||
Hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
||||
|
@ -102,6 +103,9 @@ in
|
|||
postPatch = ''
|
||||
# Fix hardcoded paths to /usr installation
|
||||
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
||||
substituteInPlace meson.build \
|
||||
--replace "@GIT_COMMIT_HASH@" '${commit}' \
|
||||
--replace "@GIT_DIRTY@" '${if commit == "" then "dirty" else ""}'
|
||||
'';
|
||||
|
||||
passthru.providedSessions = ["hyprland"];
|
||||
|
|
|
@ -2,6 +2,18 @@ diff --git a/meson.build b/meson.build
|
|||
index f380255..abd7cd3 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -21,9 +21,9 @@ else
|
||||
endif
|
||||
|
||||
GIT_BRANCH = run_command('git', 'rev-parse', '--abbrev-ref', 'HEAD', check: false).stdout().strip()
|
||||
-GIT_COMMIT_HASH = run_command('git', 'rev-parse', 'HEAD', check: false).stdout().strip()
|
||||
+GIT_COMMIT_HASH = '@GIT_COMMIT_HASH@'
|
||||
GIT_COMMIT_MESSAGE = run_command('sh', '-c', 'git show | head -n 5 | tail -n 1', check: false).stdout().strip()
|
||||
-GIT_DIRTY = run_command('sh', '-c', 'git diff-index --quiet HEAD -- || echo "dirty"', check: false).stdout().strip()
|
||||
+GIT_DIRTY = '@GIT_DIRTY@'
|
||||
|
||||
add_project_arguments(
|
||||
[
|
||||
@@ -39,23 +39,8 @@ add_project_arguments(
|
||||
],
|
||||
language: 'cpp')
|
||||
|
|
Loading…
Reference in a new issue