aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMihai Fufezan <[email protected]>2023-10-10 21:45:25 +0300
committerMihai Fufezan <[email protected]>2023-10-10 21:51:33 +0300
commit3a8a30b83cbe523b6ab3488b4aaa79361335c467 (patch)
tree5aa8ba2243cebcf615a0f4085d5cfda6f2de2725
parent0a908acc05ed8c163beacfb0f0004c01a8d6dd4f (diff)
downloadHyprland-better-versioning.tar.gz
Hyprland-better-versioning.zip
nix: better versioningbetter-versioning
-rw-r--r--nix/default.nix12
-rw-r--r--nix/patches/meson-build.patch33
2 files changed, 23 insertions, 22 deletions
diff --git a/nix/default.nix b/nix/default.nix
index 96fa12d7..d12bc073 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -105,9 +105,15 @@ assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been remov
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@" '${
+
+ # Generate version.h
+ cp src/version.h.in src/version.h
+ substituteInPlace src/version.h \
+ --replace "@HASH@" '${commit}' \
+ --replace "@BRANCH@" "" \
+ --replace "@MESSAGE@" "" \
+ --replace "@TAG@" "" \
+ --replace "@DIRTY@" '${
if commit == ""
then "dirty"
else ""
diff --git a/nix/patches/meson-build.patch b/nix/patches/meson-build.patch
index d0cba18a..23442172 100644
--- a/nix/patches/meson-build.patch
+++ b/nix/patches/meson-build.patch
@@ -1,20 +1,8 @@
diff --git a/meson.build b/meson.build
-index f3802553..6a924a79 100644
+index 726933bc..28b4d9ac 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,21 +39,8 @@ add_project_arguments(
+@@ -29,20 +29,7 @@ add_project_arguments(
],
language: 'cpp')
@@ -32,17 +20,24 @@ index f3802553..6a924a79 100644
-have_xwayland = xcb_dep.found() and have_xwlr
-
-if not have_xwayland
-- add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
+if get_option('xwayland').disabled()
-+ add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
+ add_project_arguments('-DNO_XWAYLAND', language: 'cpp')
endif
- backtrace_dep = cpp_compiler.find_library('execinfo', required: false)
+@@ -71,8 +58,6 @@ foreach file : headers
+ install_headers(file, subdir: 'hyprland', preserve_path: true)
+ endforeach
+
+-version_h = run_command('sh', '-c', 'scripts/generateVersion.sh')
+-
+ subdir('protocols')
+ subdir('src')
+ subdir('hyprctl')
diff --git a/src/meson.build b/src/meson.build
-index 7b658d31..60aa4057 100644
+index 2065c6f5..55530605 100644
--- a/src/meson.build
+++ b/src/meson.build
-@@ -7,16 +7,16 @@ executable('Hyprland', src,
+@@ -9,16 +9,16 @@ executable('Hyprland', src,
server_protos,
dependency('wayland-server'),
dependency('wayland-client'),