From f3b5bf3847152baf2a37565c45d294dca572cb0d Mon Sep 17 00:00:00 2001 From: Don Williams Date: Mon, 26 Jan 2026 12:24:29 -0500 Subject: [PATCH] Fixed build issue with debian trixie MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • All references to Nix::, Nix.hpp, Nix.cpp, --no-nixgl, and nixGL in the built Hyprland sources are removed via assets/0002-start-hyprland-no-nixgl.patch. ◦ The patch: ▪ Drops the Nix include and logic from start/src/core/Instance.cpp, start/src/core/State.hpp, and start/src/main.cpp. ▪ Removes the --no-nixgl flag and the Nix environment checks. ▪ Makes start-hyprland exec Hyprland directly, with no nixGL wrapper or Nix environment inspection. On branch development Your branch is up to date with 'origin/development'. Changes to be committed: new file: assets/0002-start-hyprland-no-nixgl.patch modified: install-scripts/hyprland.sh --- assets/0002-start-hyprland-no-nixgl.patch | 73 +++++++++++++++++++++++ install-scripts/hyprland.sh | 13 ++++ 2 files changed, 86 insertions(+) create mode 100644 assets/0002-start-hyprland-no-nixgl.patch diff --git a/assets/0002-start-hyprland-no-nixgl.patch b/assets/0002-start-hyprland-no-nixgl.patch new file mode 100644 index 0000000..f597bfa --- /dev/null +++ b/assets/0002-start-hyprland-no-nixgl.patch @@ -0,0 +1,73 @@ +--- a/start/src/core/Instance.cpp ++++ b/start/src/core/Instance.cpp +@@ -1,7 +1,6 @@ + #include "Instance.hpp" + #include "State.hpp" + #include "../helpers/Logger.hpp" +-#include "../helpers/Nix.hpp" + + #include + #include +@@ -55,12 +54,7 @@ void CHyprlandInstance::runHyprlandThread(bool safeMode) { + procctl(P_PID, getpid(), PROC_PDEATHSIG_CTL, &sig); + #endif + +- if (Nix::shouldUseNixGL()) { +- argsStd.insert(argsStd.begin(), g_state->customPath.value_or("Hyprland")); +- args.insert(args.begin(), strdup(argsStd.front().c_str())); +- execvp("nixGL", args.data()); +- } else +- execvp(g_state->customPath.value_or("Hyprland").c_str(), args.data()); ++ execvp(g_state->customPath.value_or("Hyprland").c_str(), args.data()); + + g_logger->log(Hyprutils::CLI::LOG_ERR, "fork(): execvp failed: {}", strerror(errno)); + std::fflush(stdout); +--- a/start/src/core/State.hpp ++++ b/start/src/core/State.hpp +@@ -8,7 +8,6 @@ + struct SState { + std::span rawArgvNoBinPath; + std::optional customPath; +- bool noNixGl = false; + }; + + inline UP g_state = makeUnique(); +--- a/start/src/main.cpp ++++ b/start/src/main.cpp +@@ -3,7 +3,6 @@ + #include + + #include "helpers/Logger.hpp" +-#include "helpers/Nix.hpp" + #include "core/State.hpp" + #include "core/Instance.hpp" +@@ -21,7 +20,6 @@ Any arguments after -- are passed to Hyprland. For Hyprland help, run start-hypr + + Additional arguments for start-hyprland: + --path [path] -> Override Hyprland path +- --no-nixgl -> Force disable nixGL + )#"; +@@ -76,7 +74,6 @@ int main(int argc, const char** argv, const char** envp) { + continue; + } + if (arg == "--no-nixgl") { +- g_state->noNixGl = true; + continue; + } + } +@@ -87,15 +84,6 @@ int main(int argc, const char** argv, const char** envp) { + if (!g_state->rawArgvNoBinPath.empty()) + g_logger->log(Hyprutils::CLI::LOG_WARN, "Arguments after -- are passed to Hyprland"); + +- // check if our environment is OK +- if (const auto RET = Nix::nixEnvironmentOk(); !RET) { +- g_logger->log(Hyprutils::CLI::LOG_ERR, "Nix environment check failed:\n{}", RET.error()); +- return 1; +- } +- +- if (Nix::shouldUseNixGL()) +- g_logger->log(Hyprutils::CLI::LOG_DEBUG, "Hyprland was compiled with Nix - will use nixGL"); +- + bool safeMode = false; + while (true) { + g_instance = makeUnique(); diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh index be452a6..eb6e467 100755 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -139,6 +139,19 @@ EOF echo "${NOTE} Hyprland compile patch does not apply on $tag; skipping." fi fi + + # Optionally strip nixGL/Nix helper logic from start-hyprland (Debian does not need it) + if [ -f "$PARENT_DIR/assets/0002-start-hyprland-no-nixgl.patch" ]; then + if patch -p1 --dry-run <"$PARENT_DIR/assets/0002-start-hyprland-no-nixgl.patch" >/dev/null 2>&1; then + patch -p1 <"$PARENT_DIR/assets/0002-start-hyprland-no-nixgl.patch" + else + echo "${NOTE} Hyprland start-hyprland nixGL patch does not apply on $tag; skipping." + fi + fi + + # Remove Nix helper sources that are no longer used (defensive) + rm -f start/src/helpers/Nix.cpp start/src/helpers/Nix.hpp || true + # By default, build Hyprland with bundled hyprutils/hyprlang to avoid version mismatches # You can force system libs by exporting USE_SYSTEM_HYPRLIBS=1 before running this script. USE_SYSTEM=${USE_SYSTEM_HYPRLIBS:-1}