mirror of
https://github.com/JaKooLit/Debian-Hyprland.git
synced 2026-02-05 01:30:13 +01:00
Compare commits
3 Commits
9044cc4986
...
90dc9c7883
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
90dc9c7883 | ||
|
|
b14bb03c0f | ||
|
|
37a7652ccf |
215
install-scripts/quickshell.sh
Executable file
215
install-scripts/quickshell.sh
Executable file
@ -0,0 +1,215 @@
|
||||
#!/bin/bash
|
||||
# 💫 https://github.com/JaKooLit 💫 #
|
||||
# Quickshell (QtQuick-based shell toolkit) - Debian builder
|
||||
|
||||
set -Eeuo pipefail
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
PARENT_DIR="$SCRIPT_DIR/.."
|
||||
cd "$PARENT_DIR" || {
|
||||
echo "${ERROR} Failed to change directory to $PARENT_DIR"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Source the global functions script
|
||||
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then
|
||||
echo "Failed to source Global_functions.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Prefer /usr/local for pkg-config and CMake (for locally built libs like Breakpad)
|
||||
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:${PKG_CONFIG_PATH:-}"
|
||||
export CMAKE_PREFIX_PATH="/usr/local:${CMAKE_PREFIX_PATH:-}"
|
||||
|
||||
# Ensure logs dir exists at repo root (we cd into source later)
|
||||
mkdir -p "$PARENT_DIR/Install-Logs"
|
||||
|
||||
LOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_quickshell.log"
|
||||
MLOG="$PARENT_DIR/Install-Logs/install-$(date +%d-%H%M%S)_quickshell_build.log"
|
||||
|
||||
# Refresh sudo credentials once (install_package uses sudo internally)
|
||||
if command -v sudo >/dev/null 2>&1; then
|
||||
sudo -v 2>/dev/null || sudo -v
|
||||
fi
|
||||
|
||||
note() { echo -e "${NOTE} $*" | tee -a "$LOG"; }
|
||||
info() { echo -e "${INFO} $*" | tee -a "$LOG"; }
|
||||
|
||||
# Build-time and runtime deps per upstream BUILD.md (Qt 6.6+)
|
||||
# Some may already be present from 00-dependencies.sh
|
||||
DEPS=(
|
||||
build-essential
|
||||
git
|
||||
autoconf
|
||||
automake
|
||||
libtool
|
||||
zlib1g-dev
|
||||
libcurl4-openssl-dev
|
||||
cmake
|
||||
ninja-build
|
||||
pkg-config
|
||||
spirv-tools
|
||||
qt6-base-dev
|
||||
qt6-declarative-dev
|
||||
qt6-shadertools-dev
|
||||
qt6-tools-dev
|
||||
qt6-tools-dev-tools
|
||||
qt6-declarative-private-dev
|
||||
# Wayland + protocols
|
||||
libwayland-dev
|
||||
wayland-protocols
|
||||
# Screencopy/GBM/DRM
|
||||
libdrm-dev
|
||||
libgbm-dev
|
||||
# Optional integrations enabled by default
|
||||
libpipewire-0.3-dev
|
||||
libpam0g-dev
|
||||
libglib2.0-dev
|
||||
libpolkit-gobject-1-dev
|
||||
libpolkit-agent-1-dev
|
||||
libjemalloc-dev
|
||||
# X11 (optional but harmless)
|
||||
libxcb1-dev
|
||||
# SVG support (package name differs across releases; try both)
|
||||
qt6-svg-dev
|
||||
libqt6svg6-dev
|
||||
# Third-party libs used by Quickshell
|
||||
libcli11-dev
|
||||
# Qt Quick runtime QML modules required at runtime (RectangularShadow, etc.)
|
||||
qml6-module-qtquick-effects
|
||||
qml6-module-qtquick-shapes
|
||||
qml6-module-qtquick-controls
|
||||
qml6-module-qtquick-layouts
|
||||
qml6-module-qt5compat-graphicaleffects
|
||||
)
|
||||
|
||||
printf "\n%s - Installing ${SKY_BLUE}Quickshell build dependencies${RESET}....\n" "${NOTE}"
|
||||
# Single apt transaction for speed and robustness, but filter packages with no candidate
|
||||
sudo apt update 2>&1 | tee -a "$LOG"
|
||||
AVAILABLE_PKGS=()
|
||||
for PKG in "${DEPS[@]}"; do
|
||||
CAND=$(apt-cache policy "$PKG" | awk '/Candidate:/ {print $2}')
|
||||
if [ -n "$CAND" ] && [ "$CAND" != "(none)" ]; then
|
||||
AVAILABLE_PKGS+=("$PKG")
|
||||
else
|
||||
note "Skipping $PKG (no candidate in APT)"
|
||||
fi
|
||||
done
|
||||
if ! sudo apt install -y "${AVAILABLE_PKGS[@]}" 2>&1 | tee -a "$LOG"; then
|
||||
echo "${ERROR} apt failed when installing Quickshell build dependencies." | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Validate critical tools
|
||||
for bin in cmake ninja pkg-config; do
|
||||
if ! command -v "$bin" >/dev/null 2>&1; then
|
||||
echo "${ERROR} Required tool '$bin' not found after apt install." | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
# Build Google Breakpad from source if pkg-config 'breakpad' is missing
|
||||
if ! pkg-config --exists breakpad; then
|
||||
note "Building Google Breakpad from source..."
|
||||
BP_DIR="$PARENT_DIR/.thirdparty/breakpad"
|
||||
rm -rf "$BP_DIR"
|
||||
mkdir -p "$BP_DIR"
|
||||
(
|
||||
set -Eeuo pipefail
|
||||
cd "$BP_DIR"
|
||||
# Clone Breakpad into the root of BP_DIR (expected layout: ./src)
|
||||
git clone --depth=1 https://chromium.googlesource.com/breakpad/breakpad . 2>&1 | tee -a "$MLOG"
|
||||
# lss must live at src/third_party/lss relative to Breakpad root
|
||||
git clone --depth=1 https://chromium.googlesource.com/linux-syscall-support src/third_party/lss 2>&1 | tee -a "$MLOG" || true
|
||||
# Autotools bootstrap if needed (at Breakpad root)
|
||||
if [ ! -x ./configure ]; then
|
||||
autoreconf -fi 2>&1 | tee -a "$MLOG"
|
||||
fi
|
||||
./configure --prefix=/usr/local 2>&1 | tee -a "$MLOG"
|
||||
make -j "$(nproc 2>/dev/null || getconf _NPROCESSORS_ONLN)" 2>&1 | tee -a "$MLOG"
|
||||
sudo make install 2>&1 | tee -a "$MLOG"
|
||||
) || { echo "${ERROR} Breakpad build failed." | tee -a "$LOG"; exit 1; }
|
||||
|
||||
# Provide pkg-config file if upstream didn't install one under the name 'breakpad'
|
||||
if ! pkg-config --exists breakpad; then
|
||||
if pkg-config --exists breakpad-client; then
|
||||
sudo mkdir -p /usr/local/lib/pkgconfig
|
||||
sudo ln -sf /usr/local/lib/pkgconfig/breakpad-client.pc /usr/local/lib/pkgconfig/breakpad.pc
|
||||
elif [ -f /usr/local/lib/libbreakpad_client.a ] || [ -f /usr/local/lib/libbreakpad_client.so ]; then
|
||||
TMP_PC="/tmp/breakpad.pc.$$"
|
||||
cat >"$TMP_PC" <<'PCEOF'
|
||||
prefix=/usr/local
|
||||
exec_prefix=${prefix}
|
||||
includedir=${prefix}/include
|
||||
libdir=${exec_prefix}/lib
|
||||
Name: breakpad
|
||||
Description: Google Breakpad client library
|
||||
Version: 0
|
||||
Libs: -L${libdir} -lbreakpad_client
|
||||
Cflags: -I${includedir}
|
||||
PCEOF
|
||||
sudo mkdir -p /usr/local/lib/pkgconfig
|
||||
sudo mv "$TMP_PC" /usr/local/lib/pkgconfig/breakpad.pc
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! pkg-config --exists breakpad; then
|
||||
echo "${ERROR} breakpad pkg-config entry not found after installation." | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
# Clone source (prefer upstream forgejo; mirror available at github:quickshell-mirror/quickshell)
|
||||
SRC_DIR="quickshell-src"
|
||||
if [ -d "$SRC_DIR" ]; then
|
||||
note "Removing existing $SRC_DIR"
|
||||
rm -rf "$SRC_DIR"
|
||||
fi
|
||||
|
||||
note "Cloning Quickshell source..."
|
||||
if git clone --depth=1 https://git.outfoxxed.me/quickshell/quickshell "$SRC_DIR" 2>&1 | tee -a "$LOG"; then
|
||||
cd "$SRC_DIR"
|
||||
else
|
||||
echo "${ERROR} Failed to clone Quickshell repo" | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Configure with Ninja; enable RelWithDebInfo, leave features ON (deps installed above)
|
||||
CMAKE_FLAGS=(
|
||||
-GNinja
|
||||
-B build
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
-DDISTRIBUTOR="Debian-Hyprland installer"
|
||||
)
|
||||
|
||||
note "Configuring Quickshell (CMake)..."
|
||||
# Use explicit source/build dirs and preserve cmake exit code with pipefail
|
||||
if ! cmake -S . -B build "${CMAKE_FLAGS[@]}" 2>&1 | tee -a "$MLOG"; then
|
||||
echo "${ERROR} CMake configure failed. See log: $MLOG" | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure build files exist before invoking ninja
|
||||
if [ ! -f build/build.ninja ]; then
|
||||
echo "${ERROR} build/build.ninja not generated; aborting build." | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
note "Building Quickshell (Ninja)..."
|
||||
if ! cmake --build build 2>&1 | tee -a "$MLOG"; then
|
||||
echo "${ERROR} Build failed. See log: $MLOG" | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
note "Installing Quickshell..."
|
||||
if ! sudo cmake --install build 2>&1 | tee -a "$MLOG"; then
|
||||
echo "${ERROR} Installation failed. See log: $MLOG" | tee -a "$LOG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "${OK} Quickshell installed successfully." | tee -a "$MLOG"
|
||||
|
||||
# Build logs already written to $PARENT_DIR/Install-Logs
|
||||
# Keep source directory for reference in case user wants to rebuild later
|
||||
|
||||
printf "\n%.0s" {1..1}
|
||||
@ -302,6 +302,7 @@ gtk_themes="OFF"
|
||||
bluetooth="OFF"
|
||||
thunar="OFF"
|
||||
ags="OFF"
|
||||
quickshell="OFF"
|
||||
sddm="OFF"
|
||||
sddm_theme="OFF"
|
||||
xdph="OFF"
|
||||
@ -401,6 +402,7 @@ options_command+=(
|
||||
"bluetooth" "Do you want script to configure Bluetooth?" "OFF"
|
||||
"thunar" "Do you want Thunar file manager to be installed?" "OFF"
|
||||
"ags" "Install AGS v1 for Desktop-Like Overview" "OFF"
|
||||
"quickshell" "Install Quickshell (QtQuick-based shell toolkit)?" "OFF"
|
||||
"xdph" "Install XDG-DESKTOP-PORTAL-HYPRLAND (for screen share)?" "OFF"
|
||||
"zsh" "Install zsh shell with Oh-My-Zsh?" "OFF"
|
||||
"pokemon" "Add Pokemon color scripts to your terminal?" "OFF"
|
||||
@ -592,6 +594,10 @@ for option in "${options[@]}"; do
|
||||
echo "${INFO} Installing ${SKY_BLUE}AGS v1 for Desktop Overview...${RESET}" | tee -a "$LOG"
|
||||
execute_script "ags.sh"
|
||||
;;
|
||||
quickshell)
|
||||
echo "${INFO} Installing ${SKY_BLUE}Quickshell${RESET} (QtQuick-based shell toolkit)..." | tee -a "$LOG"
|
||||
execute_script "quickshell.sh"
|
||||
;;
|
||||
xdph)
|
||||
echo "${INFO} Installing ${SKY_BLUE}xdg-desktop-portal-hyprland...${RESET}" | tee -a "$LOG"
|
||||
execute_script "xdph.sh"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user