From 0d1ca1a7c8e4fc5dbad6310b13d1b6359d50e7bd Mon Sep 17 00:00:00 2001 From: Don Williams Date: Wed, 8 Oct 2025 01:40:59 -0400 Subject: [PATCH] Fixing wl protocol build error On branch hl-051 Your branch is up to date with 'origin/hl-051'. Changes to be committed: modified: dry-run-build.sh modified: hypr-tags.env new file: install-scripts/wayland-protocols-src.sh modified: update-hyprland.sh --- dry-run-build.sh | 1 + hypr-tags.env | 1 + install-scripts/wayland-protocols-src.sh | 66 ++++++++++++++++++++++++ update-hyprland.sh | 34 +++++++++--- 4 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 install-scripts/wayland-protocols-src.sh diff --git a/dry-run-build.sh b/dry-run-build.sh index eb630e9..988202d 100644 --- a/dry-run-build.sh +++ b/dry-run-build.sh @@ -27,6 +27,7 @@ SUMMARY_LOG="$LOG_DIR/build-dry-run-$TS.log" DEFAULT_MODULES=( hyprutils hyprlang + wayland-protocols-src aquamarine hyprgraphics hyprwayland-scanner diff --git a/hypr-tags.env b/hypr-tags.env index 9a2eed5..28fade9 100644 --- a/hypr-tags.env +++ b/hypr-tags.env @@ -11,3 +11,4 @@ HYPRWAYLAND_SCANNER_TAG=v0.4.5 HYPRLAND_PROTOCOLS_TAG=v0.6.4 HYPRLAND_QT_SUPPORT_TAG=v0.1.0 HYPRLAND_QTUTILS_TAG=v0.1.4 +WAYLAND_PROTOCOLS_TAG=1.46 diff --git a/install-scripts/wayland-protocols-src.sh b/install-scripts/wayland-protocols-src.sh new file mode 100644 index 0000000..cc9c979 --- /dev/null +++ b/install-scripts/wayland-protocols-src.sh @@ -0,0 +1,66 @@ +#!/bin/bash +# 💫 https://github.com/JaKooLit 💫 # +# Build and install wayland-protocols from source +# Provides a newer wayland-protocols.pc for pkg-config when distro version is too old + +#specific tag or release (e.g., 1.45, 1.46) +tag="1.46" +# Allow environment override +if [ -n "${WAYLAND_PROTOCOLS_TAG:-}" ]; then tag="$WAYLAND_PROTOCOLS_TAG"; fi + +# Dry-run support +DO_INSTALL=1 +if [ "$1" = "--dry-run" ] || [ "${DRY_RUN}" = "1" ] || [ "${DRY_RUN}" = "true" ]; then + DO_INSTALL=0 + echo "${NOTE} DRY RUN: install step will be skipped." +fi + +## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + +# Change the working directory to the parent directory of the script +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 + +# Set the name of the log file to include the current date and time +LOG="Install-Logs/install-$(date +%d-%H%M%S)_wayland-protocols.log" +MLOG="install-$(date +%d-%H%M%S)_wayland-protocols2.log" + +printf "\n%s - Installing ${YELLOW}wayland-protocols (from source)${RESET} .... \n" "${INFO}" + +# Clean previous clone +if [ -d "wayland-protocols" ]; then + rm -rf "wayland-protocols" +fi + +# Clone and build (meson) +# Upstream: https://gitlab.freedesktop.org/wayland/wayland-protocols.git +printf "${INFO} Installing ${YELLOW}wayland-protocols $tag${RESET} ...\n" +if git clone --depth=1 -b "$tag" https://gitlab.freedesktop.org/wayland/wayland-protocols.git; then + cd wayland-protocols || exit 1 + # Install to /usr/local so pkg-config can prefer it over distro /usr + meson setup build --prefix=/usr/local + meson compile -C build -j"$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)" + if [ $DO_INSTALL -eq 1 ]; then + if sudo meson install -C build 2>&1 | tee -a "$MLOG" ; then + printf "${OK} ${MAGENTA}wayland-protocols $tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG" + else + echo -e "${ERROR} Installation failed for ${YELLOW}wayland-protocols $tag${RESET}" 2>&1 | tee -a "$MLOG" + fi + else + echo "${NOTE} DRY RUN: Skipping installation of wayland-protocols $tag." + fi + # Move additional logs to Install-Logs directory if they exist + [ -f "$MLOG" ] && mv "$MLOG" ../Install-Logs/ || true + cd .. +else + echo -e "${ERROR} Download failed for ${YELLOW}wayland-protocols $tag${RESET}" 2>&1 | tee -a "$LOG" +fi + +printf "\n%.0s" {1..2} \ No newline at end of file diff --git a/update-hyprland.sh b/update-hyprland.sh index 0714e57..5328467 100644 --- a/update-hyprland.sh +++ b/update-hyprland.sh @@ -35,6 +35,7 @@ SUMMARY_LOG="$LOG_DIR/update-hypr-$TS.log" DEFAULT_MODULES=( hyprutils hyprlang + wayland-protocols-src aquamarine hyprgraphics hyprwayland-scanner @@ -226,30 +227,49 @@ run_stack() { modules=("${filtered[@]}") fi - # Ensure aquamarine is installed before hyprland on install runs + # Ensure wayland-protocols-src and aquamarine are installed before hyprland on install runs if [[ $DO_INSTALL -eq 1 ]]; then - local has_hl=0 has_aqua=0 + local has_hl=0 has_aqua=0 has_wp=0 for m in "${modules[@]}"; do [[ "$m" == "hyprland" ]] && has_hl=1 [[ "$m" == "aquamarine" ]] && has_aqua=1 + [[ "$m" == "wayland-protocols-src" ]] && has_wp=1 done if [[ $has_hl -eq 1 ]]; then + # ensure wayland-protocols-src present + if [[ $has_wp -eq 0 ]]; then + modules=("wayland-protocols-src" "${modules[@]}") + fi + # ensure aquamarine present if [[ $has_aqua -eq 0 ]]; then - # Prepend aquamarine if missing modules=("aquamarine" "${modules[@]}") fi - # Reorder to ensure aquamarine appears before hyprland + # Reorder to ensure wayland-protocols-src and aquamarine appear before hyprland # Remove existing occurrences and rebuild in correct order local tmp=() - local inserted_aqua=0 + local inserted_wp=0 inserted_aqua=0 for m in "${modules[@]}"; do - if [[ "$m" == "aquamarine" ]]; then + if [[ "$m" == "wayland-protocols-src" ]]; then + if [[ $inserted_wp -eq 0 ]]; then + tmp+=("wayland-protocols-src") + inserted_wp=1 + fi + elif [[ "$m" == "aquamarine" ]]; then if [[ $inserted_aqua -eq 0 ]]; then + # ensure protocols before aquamarine + if [[ $inserted_wp -eq 0 ]]; then + tmp+=("wayland-protocols-src") + inserted_wp=1 + fi tmp+=("aquamarine") inserted_aqua=1 fi elif [[ "$m" == "hyprland" ]]; then - # ensure aquamarine is already present before adding hyprland + # ensure protocols and aquamarine already present + if [[ $inserted_wp -eq 0 ]]; then + tmp+=("wayland-protocols-src") + inserted_wp=1 + fi if [[ $inserted_aqua -eq 0 ]]; then tmp+=("aquamarine") inserted_aqua=1