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
This commit is contained in:
Don Williams 2025-10-08 01:40:59 -04:00
parent 5a34836119
commit 0d1ca1a7c8
4 changed files with 95 additions and 7 deletions

View File

@ -27,6 +27,7 @@ SUMMARY_LOG="$LOG_DIR/build-dry-run-$TS.log"
DEFAULT_MODULES=( DEFAULT_MODULES=(
hyprutils hyprutils
hyprlang hyprlang
wayland-protocols-src
aquamarine aquamarine
hyprgraphics hyprgraphics
hyprwayland-scanner hyprwayland-scanner

View File

@ -11,3 +11,4 @@ HYPRWAYLAND_SCANNER_TAG=v0.4.5
HYPRLAND_PROTOCOLS_TAG=v0.6.4 HYPRLAND_PROTOCOLS_TAG=v0.6.4
HYPRLAND_QT_SUPPORT_TAG=v0.1.0 HYPRLAND_QT_SUPPORT_TAG=v0.1.0
HYPRLAND_QTUTILS_TAG=v0.1.4 HYPRLAND_QTUTILS_TAG=v0.1.4
WAYLAND_PROTOCOLS_TAG=1.46

View File

@ -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}

View File

@ -35,6 +35,7 @@ SUMMARY_LOG="$LOG_DIR/update-hypr-$TS.log"
DEFAULT_MODULES=( DEFAULT_MODULES=(
hyprutils hyprutils
hyprlang hyprlang
wayland-protocols-src
aquamarine aquamarine
hyprgraphics hyprgraphics
hyprwayland-scanner hyprwayland-scanner
@ -226,30 +227,49 @@ run_stack() {
modules=("${filtered[@]}") modules=("${filtered[@]}")
fi 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 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 for m in "${modules[@]}"; do
[[ "$m" == "hyprland" ]] && has_hl=1 [[ "$m" == "hyprland" ]] && has_hl=1
[[ "$m" == "aquamarine" ]] && has_aqua=1 [[ "$m" == "aquamarine" ]] && has_aqua=1
[[ "$m" == "wayland-protocols-src" ]] && has_wp=1
done done
if [[ $has_hl -eq 1 ]]; then 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 if [[ $has_aqua -eq 0 ]]; then
# Prepend aquamarine if missing
modules=("aquamarine" "${modules[@]}") modules=("aquamarine" "${modules[@]}")
fi 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 # Remove existing occurrences and rebuild in correct order
local tmp=() local tmp=()
local inserted_aqua=0 local inserted_wp=0 inserted_aqua=0
for m in "${modules[@]}"; do 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 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") tmp+=("aquamarine")
inserted_aqua=1 inserted_aqua=1
fi fi
elif [[ "$m" == "hyprland" ]]; then 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 if [[ $inserted_aqua -eq 0 ]]; then
tmp+=("aquamarine") tmp+=("aquamarine")
inserted_aqua=1 inserted_aqua=1