mirror of
https://github.com/JaKooLit/Debian-Hyprland.git
synced 2026-02-05 01:30:13 +01:00
Compare commits
3 Commits
4e5b37715a
...
6f5328bc7e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f5328bc7e | ||
|
|
d2b5a2d526 | ||
|
|
f3b5bf3847 |
91
assets/0002-start-hyprland-no-nixgl.patch
Normal file
91
assets/0002-start-hyprland-no-nixgl.patch
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
diff --git a/start/src/core/Instance.cpp b/start/src/core/Instance.cpp
|
||||||
|
index 2f5007b..8c6c73c 100644
|
||||||
|
--- a/start/src/core/Instance.cpp
|
||||||
|
+++ b/start/src/core/Instance.cpp
|
||||||
|
@@ -1,8 +1,6 @@
|
||||||
|
#include "Instance.hpp"
|
||||||
|
#include "State.hpp"
|
||||||
|
#include "../helpers/Logger.hpp"
|
||||||
|
-#include "../helpers/Nix.hpp"
|
||||||
|
-
|
||||||
|
#include <cstdlib>
|
||||||
|
#include <cstring>
|
||||||
|
#include <sys/poll.h>
|
||||||
|
@@ -54,13 +52,7 @@ void CHyprlandInstance::runHyprlandThread(bool safeMode) {
|
||||||
|
int sig = SIGKILL;
|
||||||
|
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);
|
||||||
|
diff --git a/start/src/core/State.hpp b/start/src/core/State.hpp
|
||||||
|
index d00a175..6cf73a9 100644
|
||||||
|
--- a/start/src/core/State.hpp
|
||||||
|
+++ b/start/src/core/State.hpp
|
||||||
|
@@ -8,7 +8,6 @@
|
||||||
|
struct SState {
|
||||||
|
std::span<const char*> rawArgvNoBinPath;
|
||||||
|
std::optional<std::string> customPath;
|
||||||
|
- bool noNixGl = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
inline UP<SState> g_state = makeUnique<SState>();
|
||||||
|
\ No newline at end of file
|
||||||
|
diff --git a/start/src/main.cpp b/start/src/main.cpp
|
||||||
|
index e73fcfa..30e68f0 100644
|
||||||
|
--- a/start/src/main.cpp
|
||||||
|
+++ b/start/src/main.cpp
|
||||||
|
@@ -3,7 +3,6 @@
|
||||||
|
#include <print>
|
||||||
|
|
||||||
|
#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
|
||||||
|
)#";
|
||||||
|
|
||||||
|
//
|
||||||
|
@@ -74,28 +72,13 @@ int main(int argc, const char** argv, const char** envp) {
|
||||||
|
|
||||||
|
g_state->customPath = argv[++i];
|
||||||
|
continue;
|
||||||
|
- }
|
||||||
|
- if (arg == "--no-nixgl") {
|
||||||
|
- g_state->noNixGl = true;
|
||||||
|
- continue;
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+ } }
|
||||||
|
|
||||||
|
if (startArgv != -1)
|
||||||
|
g_state->rawArgvNoBinPath = std::span<const char*>{argv + startArgv, argc - startArgv};
|
||||||
|
|
||||||
|
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<CHyprlandInstance>();
|
||||||
@ -139,6 +139,19 @@ EOF
|
|||||||
echo "${NOTE} Hyprland compile patch does not apply on $tag; skipping."
|
echo "${NOTE} Hyprland compile patch does not apply on $tag; skipping."
|
||||||
fi
|
fi
|
||||||
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
|
# 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.
|
# You can force system libs by exporting USE_SYSTEM_HYPRLIBS=1 before running this script.
|
||||||
USE_SYSTEM=${USE_SYSTEM_HYPRLIBS:-1}
|
USE_SYSTEM=${USE_SYSTEM_HYPRLIBS:-1}
|
||||||
|
|||||||
88
install.sh
88
install.sh
@ -1,9 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# https://github.com/JaKooLit
|
# https://github.com/JaKooLit
|
||||||
|
|
||||||
# Source location for pre-built Debian packages (can be local or network share)
|
|
||||||
# Set this variable to the path containing .deb files, or leave empty to build from source
|
|
||||||
DEB_PACKAGES_SOURCE="/mnt/nas/Projects/Jak/debian-pkg/build/debs"
|
|
||||||
|
|
||||||
clear
|
clear
|
||||||
|
|
||||||
@ -213,59 +210,6 @@ clean_existing_hyprland() {
|
|||||||
echo "${OK} Cleanup completed" | tee -a "$LOG"
|
echo "${OK} Cleanup completed" | tee -a "$LOG"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Function to install packages from pre-built .deb files
|
|
||||||
install_from_packages() {
|
|
||||||
echo "${INFO} Installing from pre-built packages at: ${SKY_BLUE}$DEB_PACKAGES_SOURCE${RESET}" | tee -a "$LOG"
|
|
||||||
|
|
||||||
if [ ! -d "$DEB_PACKAGES_SOURCE" ]; then
|
|
||||||
echo "${ERROR} Package source directory not found: $DEB_PACKAGES_SOURCE" | tee -a "$LOG"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
local pkg_count=$(find "$DEB_PACKAGES_SOURCE" -name "*.deb" | wc -l)
|
|
||||||
if [ "$pkg_count" -eq 0 ]; then
|
|
||||||
echo "${ERROR} No .deb files found in $DEB_PACKAGES_SOURCE" | tee -a "$LOG"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${INFO} Found ${SKY_BLUE}$pkg_count${RESET} .deb packages" | tee -a "$LOG"
|
|
||||||
|
|
||||||
# Clean up existing installations before installing from packages
|
|
||||||
echo "${CAT} Removing existing Hyprland installations to avoid conflicts..." | tee -a "$LOG"
|
|
||||||
clean_existing_hyprland
|
|
||||||
|
|
||||||
# Update package cache after cleanup
|
|
||||||
echo "${INFO} Updating package cache..." | tee -a "$LOG"
|
|
||||||
sudo apt-get update 2>&1 | tail -3 | tee -a "$LOG"
|
|
||||||
|
|
||||||
# Install core packages only (skip plugins and debug symbols)
|
|
||||||
echo "${INFO} Installing core Hyprland packages (excluding plugins and debug symbols)..." | tee -a "$LOG"
|
|
||||||
|
|
||||||
# Install only essential packages, skip plugins and dbgsym
|
|
||||||
for deb in "$DEB_PACKAGES_SOURCE"/*.deb; do
|
|
||||||
filename=$(basename "$deb")
|
|
||||||
|
|
||||||
# Skip debug symbols and plugins
|
|
||||||
if [[ "$filename" == *"-dbgsym_"* ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
if [[ "$filename" == "hyprland-plugin-"* ]]; then
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${INFO} Installing: $filename" | tee -a "$LOG"
|
|
||||||
sudo dpkg -i "$deb" 2>&1 | tee -a "$LOG" || true
|
|
||||||
done
|
|
||||||
|
|
||||||
# Fix any dependency issues
|
|
||||||
echo "${INFO} Fixing any dependency issues..." | tee -a "$LOG"
|
|
||||||
sudo apt-get install -f -y 2>&1 | tail -5 | tee -a "$LOG"
|
|
||||||
|
|
||||||
echo "${OK} Core package installation completed!" | tee -a "$LOG"
|
|
||||||
echo "${NOTE} To install plugins, run: sudo dpkg -i $DEB_PACKAGES_SOURCE/hyprland-plugin-*.deb" | tee -a "$LOG"
|
|
||||||
echo "${NOTE} To install debug symbols, run: sudo dpkg -i $DEB_PACKAGES_SOURCE/*-dbgsym*.deb" | tee -a "$LOG"
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Welcome message using whiptail (for displaying information)
|
# Welcome message using whiptail (for displaying information)
|
||||||
whiptail --title "KooL Debian-Hyprland Trixie+ (2025) Install Script" \
|
whiptail --title "KooL Debian-Hyprland Trixie+ (2025) Install Script" \
|
||||||
@ -274,24 +218,8 @@ ATTENTION: Run a full system update and Reboot first !!! (Highly Recommended)\n\
|
|||||||
NOTE: If you are installing on a VM, ensure to enable 3D acceleration otherwise Hyprland may NOT start!" \
|
NOTE: If you are installing on a VM, ensure to enable 3D acceleration otherwise Hyprland may NOT start!" \
|
||||||
15 80
|
15 80
|
||||||
|
|
||||||
# Ask user to choose build method
|
# Ask if the user wants to proceed (source-only build)
|
||||||
build_method="source"
|
|
||||||
if [ -d "$DEB_PACKAGES_SOURCE" ] && [ "$(find "$DEB_PACKAGES_SOURCE" -name "*.deb" 2>/dev/null | wc -l)" -gt 0 ]; then
|
|
||||||
if whiptail --title "Build Method" \
|
|
||||||
--yesno "Pre-built Hyprland packages are available at:\n$DEB_PACKAGES_SOURCE\n\nWould you like to install from pre-built packages?\n\nSelect YES for faster installation from packages\nSelect NO to build from source (takes longer)" 15 70; then
|
|
||||||
build_method="packages"
|
|
||||||
echo "${OK} Selected build method: ${SKY_BLUE}Pre-built Packages${RESET}" | tee -a "$LOG"
|
|
||||||
else
|
|
||||||
echo "${OK} Selected build method: ${SKY_BLUE}From Source${RESET}" | tee -a "$LOG"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ask if the user wants to proceed
|
|
||||||
if [ "$build_method" = "packages" ]; then
|
|
||||||
proceed_msg="Build method: PRE-BUILT PACKAGES\n\nThis will install pre-compiled Hyprland packages from the shared location.\n\nShall we proceed?"
|
|
||||||
else
|
|
||||||
proceed_msg="Build method: FROM SOURCE\n\nVERY IMPORTANT!!!\nYou must be able to install from source by uncommenting deb-src on /etc/apt/sources.list else script may fail.\n\nShall we proceed?"
|
proceed_msg="Build method: FROM SOURCE\n\nVERY IMPORTANT!!!\nYou must be able to install from source by uncommenting deb-src on /etc/apt/sources.list else script may fail.\n\nShall we proceed?"
|
||||||
fi
|
|
||||||
|
|
||||||
if ! whiptail --title "Proceed with Installation?" \
|
if ! whiptail --title "Proceed with Installation?" \
|
||||||
--yesno "$proceed_msg" 15 60; then
|
--yesno "$proceed_msg" 15 60; then
|
||||||
@ -552,18 +480,7 @@ echo "${INFO} Installing ${SKY_BLUE}necessary fonts...${RESET}" | tee -a "$LOG"
|
|||||||
sleep 1
|
sleep 1
|
||||||
execute_script "fonts.sh"
|
execute_script "fonts.sh"
|
||||||
|
|
||||||
# Build method selection: from source or pre-built packages
|
# Build from source (only method)
|
||||||
if [ "$build_method" = "packages" ]; then
|
|
||||||
echo "${INFO} Installing from ${SKY_BLUE}pre-built packages${RESET}..." | tee -a "$LOG"
|
|
||||||
sleep 1
|
|
||||||
if install_from_packages; then
|
|
||||||
echo "${OK} Pre-built packages installed successfully!" | tee -a "$LOG"
|
|
||||||
else
|
|
||||||
echo "${ERROR} Failed to install pre-built packages. Exiting..." | tee -a "$LOG"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# Build from source (original method)
|
|
||||||
# Optional: refresh tags before building the Hyprland stack
|
# Optional: refresh tags before building the Hyprland stack
|
||||||
# Set FETCH_LATEST=1 to opt-in (default is no-refresh to honor pinned tags)
|
# Set FETCH_LATEST=1 to opt-in (default is no-refresh to honor pinned tags)
|
||||||
if [ "${FETCH_LATEST:-0}" = "1" ] && [ -f ./refresh-hypr-tags.sh ]; then
|
if [ "${FETCH_LATEST:-0}" = "1" ] && [ -f ./refresh-hypr-tags.sh ]; then
|
||||||
@ -616,7 +533,6 @@ else
|
|||||||
execute_script "hyprlock.sh"
|
execute_script "hyprlock.sh"
|
||||||
sleep 1
|
sleep 1
|
||||||
execute_script "hypridle.sh"
|
execute_script "hypridle.sh"
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure /usr/local/lib is in the dynamic linker search path.
|
# Ensure /usr/local/lib is in the dynamic linker search path.
|
||||||
# Many Hypr* components install shared libraries into /usr/local/lib; without this,
|
# Many Hypr* components install shared libraries into /usr/local/lib; without this,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user