mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 19:26:00 +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;
|
stdenv = prev.gcc12Stdenv;
|
||||||
version = props.version + "+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;
|
wlroots = wlroots-hyprland;
|
||||||
|
commit = self.rev or "";
|
||||||
inherit (inputs.hyprland-protocols.packages.${prev.stdenv.hostPlatform.system}) hyprland-protocols;
|
inherit (inputs.hyprland-protocols.packages.${prev.stdenv.hostPlatform.system}) hyprland-protocols;
|
||||||
inherit udis86;
|
inherit udis86;
|
||||||
};
|
};
|
||||||
|
|
|
@ -32,6 +32,7 @@
|
||||||
nvidiaPatches ? false,
|
nvidiaPatches ? false,
|
||||||
withSystemd ? true,
|
withSystemd ? true,
|
||||||
version ? "git",
|
version ? "git",
|
||||||
|
commit,
|
||||||
}: let
|
}: let
|
||||||
assertXWayland = lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
assertXWayland = lib.assertMsg (hidpiXWayland -> enableXWayland) ''
|
||||||
Hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
Hyprland: cannot have hidpiXWayland when enableXWayland is false.
|
||||||
|
@ -102,6 +103,9 @@ in
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# Fix hardcoded paths to /usr installation
|
# Fix hardcoded paths to /usr installation
|
||||||
sed -i "s#/usr#$out#" src/render/OpenGL.cpp
|
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"];
|
passthru.providedSessions = ["hyprland"];
|
||||||
|
|
|
@ -2,6 +2,18 @@ diff --git a/meson.build b/meson.build
|
||||||
index f380255..abd7cd3 100644
|
index f380255..abd7cd3 100644
|
||||||
--- a/meson.build
|
--- a/meson.build
|
||||||
+++ b/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(
|
@@ -39,23 +39,8 @@ add_project_arguments(
|
||||||
],
|
],
|
||||||
language: 'cpp')
|
language: 'cpp')
|
||||||
|
|
Loading…
Reference in a new issue