diff --git a/install-scripts/hyprland.sh b/install-scripts/hyprland.sh index 0718e52..bec3c75 100755 --- a/install-scripts/hyprland.sh +++ b/install-scripts/hyprland.sh @@ -118,6 +118,16 @@ EOF sed -ri 's|^\s*#embed\s+"\.{0,2}/\.{0,2}/example/hyprland\.conf"\s*$|#include "defaultConfig.bytes.inc"|g' src/config/defaultConfig.hpp || true fi + # Compatibility: some toolchains/libstdc++ do not support std::string operator+ with std::string_view. + # Hyprland hyprctl uses a std::string_view filename; ensure it is converted explicitly. + HYPRCTL_MAIN="$(pwd)/hyprctl/src/main.cpp" + if [ -f "$HYPRCTL_MAIN" ] && grep -q "std::string socketPath" "$HYPRCTL_MAIN"; then + # Only patch if we see a "+ filename" concatenation. + if grep -qE '\+\s*filename\s*;' "$HYPRCTL_MAIN"; then + sed -ri 's/\+\s*filename\s*;/+ std::string(filename);/g' "$HYPRCTL_MAIN" || true + fi + fi + # Apply patch only if it applies cleanly; otherwise skip if [ -f ../assets/0001-fix-hyprland-compile-issue.patch ]; then if patch -p1 --dry-run <../assets/0001-fix-hyprland-compile-issue.patch >/dev/null 2>&1; then diff --git a/install-scripts/xdph.sh b/install-scripts/xdph.sh index 8a60616..86fa8ff 100755 --- a/install-scripts/xdph.sh +++ b/install-scripts/xdph.sh @@ -29,6 +29,7 @@ if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then fi LOG="Install-Logs/install-$(date +%d-%H%M%S)_xdph.log" +MLOG="install-$(date +%d-%H%M%S)_xdph2.log" # Check if the file exists and remove it [[ -f "/usr/lib/xdg-desktop-portal-hyprland" ]] && sudo rm "/usr/lib/xdg-desktop-portal-hyprland" @@ -58,11 +59,12 @@ if git clone --recursive -b $tag "https://github.com/hyprwm/xdg-desktop-portal-h cmake -DCMAKE_INSTALL_LIBEXECDIR=/usr/lib -DCMAKE_INSTALL_PREFIX=/usr -B build cmake --build build if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then - printf "${OK} ${MAGENTA}xdph $tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" + printf "${OK} ${MAGENTA}xdph $tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" else echo -e "${ERROR} Installation failed for ${YELLOW}xdph $tag${RESET}" 2>&1 | tee -a "$MLOG" fi - mv $MLOG ../Install-Logs/ || true + # Move the additional logs to Install-Logs directory + [ -f "$MLOG" ] && mv "$MLOG" ../Install-Logs/ || true cd .. else echo -e "${ERROR} Download failed for ${YELLOW}xdph $tag${RESET}" 2>&1 | tee -a "$LOG" diff --git a/install.sh b/install.sh index 9dcf278..ae09dfb 100755 --- a/install.sh +++ b/install.sh @@ -558,6 +558,14 @@ else execute_script "hypridle.sh" fi +# Ensure /usr/local/lib is in the dynamic linker search path. +# Many Hypr* components install shared libraries into /usr/local/lib; without this, +# tools like hyprctl can fail to load (e.g. missing libhyprwire.so.*). +if ! sudo grep -qxF "/usr/local/lib" /etc/ld.so.conf.d/usr-local.conf 2>/dev/null; then + echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/usr-local.conf >/dev/null +fi +sudo ldconfig 2>/dev/null || true + #execute_script "imagemagick.sh" #this is for compiling from source. 07 Sep 2024 # execute_script "waybar-git.sh" only if waybar on repo is old diff --git a/update-hyprland.sh b/update-hyprland.sh index 51301a5..359ebb7 100755 --- a/update-hyprland.sh +++ b/update-hyprland.sh @@ -503,6 +503,17 @@ run_stack() { fi done + # Ensure /usr/local/lib is in the dynamic linker search path after installs. + # Many Hypr* components install shared libraries into /usr/local/lib; without this, + # tools like hyprctl can fail to load (e.g. missing libhyprwire.so.*). + if [[ $DO_INSTALL -eq 1 ]]; then + echo "[INFO] Ensuring /usr/local/lib is in dynamic linker path" | tee -a "$SUMMARY_LOG" + if ! sudo grep -qxF "/usr/local/lib" /etc/ld.so.conf.d/usr-local.conf 2>/dev/null; then + echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf.d/usr-local.conf >/dev/null + fi + sudo ldconfig || true + fi + { printf "\nSummary:\n" for mod in "${modules[@]}"; do