From cd9e9868bffca38280ae0534c1e5d9ea1f2a0b61 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 4 Dec 2025 13:31:12 +0200 Subject: [PATCH 1/2] hyprland: update env variables, add muparser dep --- pkgs/by-name/hy/hyprland/package.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index 4c0c200850e2..3fc9a173302d 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -27,6 +27,7 @@ libuuid, libxkbcommon, libgbm, + muparser, pango, pciutils, pkgconf, @@ -109,14 +110,16 @@ customStdenv.mkDerivation (finalAttrs: { sed -i "s#@PREFIX@/##g" hyprland.pc.in ''; - # variables used by generateVersion.sh script, and shown in `hyprctl version` - BRANCH = info.branch; - COMMITS = info.commit_hash; - DATE = info.date; - DIRTY = ""; - HASH = info.commit_hash; - MESSAGE = info.commit_message; - TAG = info.tag; + # variables used by CMake, and shown in `hyprctl version` + env = { + GIT_BRANCH = info.branch; + GIT_COMMITS = info.commit_hash; + GIT_COMMIT_DATE = info.date; + GIT_DIRTY = "clean"; + GIT_COMMIT_HASH = info.commit_hash; + GIT_COMMIT_MESSAGE = info.commit_message; + GIT_TAG = info.tag; + }; depsBuildBuild = [ # to find wayland-scanner when cross-compiling @@ -157,6 +160,7 @@ customStdenv.mkDerivation (finalAttrs: { libuuid libxkbcommon libgbm + muparser pango pciutils re2 From eb7fc22ff9337cadd1bcf3eaa5d65e82fc12c1d9 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 4 Dec 2025 13:35:56 +0200 Subject: [PATCH 2/2] hyprland: use cmake build --- pkgs/by-name/hy/hyprland/package.nix | 30 ++++++++++++---------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/pkgs/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix index 3fc9a173302d..d55c28a961e4 100644 --- a/pkgs/by-name/hy/hyprland/package.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -63,8 +63,7 @@ let inherit (lib.strings) makeBinPath optionalString - mesonBool - mesonEnable + cmakeBool ; inherit (lib.trivial) importJSON @@ -129,12 +128,13 @@ customStdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ hyprwayland-scanner makeWrapper + cmake + # meson + ninja are used to build the hyprland-protocols submodule meson ninja pkg-config wayland-scanner # for udis86 - cmake python3 ]; @@ -181,24 +181,20 @@ customStdenv.mkDerivation (finalAttrs: { (optionals withSystemd [ systemd ]) ]; - mesonBuildType = if debug then "debug" else "release"; + cmakeBuildType = if debug then "Debug" else "RelWithDebInfo"; dontStrip = debug; strictDeps = true; - mesonFlags = concatLists [ - (mapAttrsToList mesonEnable { - "xwayland" = enableXWayland; - "systemd" = withSystemd; - "uwsm" = false; - "hyprpm" = false; - }) - (mapAttrsToList mesonBool { - # PCH provides no benefits when building with Nix - "b_pch" = false; - "tracy_enable" = false; - }) - ]; + cmakeFlags = mapAttrsToList cmakeBool { + "NO_XWAYLAND" = !enableXWayland; + "NO_SYSTEMD" = !withSystemd; + "CMAKE_DISABLE_PRECOMPILE_HEADERS" = true; + "NO_UWSM" = true; + "NO_HYPRPM" = true; + "TRACY_ENABLE" = false; + "BUILD_HYPRTESTER" = true; + }; postInstall = '' ${optionalString wrapRuntimeDeps ''