Fixing update-hyprland to support tags

On branch development
 Your branch is up to date with 'origin/development'.

 Changes to be committed:
	modified:   install-scripts/hyprutils.sh
	modified:   update-hyprland.sh
This commit is contained in:
Don Williams 2025-12-29 13:04:03 -05:00
parent 118d1509bb
commit 178285a759
2 changed files with 40 additions and 27 deletions

View File

@ -4,7 +4,7 @@
# hyprutils # # hyprutils #
#specific branch or release #specific branch or release
tag="v0.10.4" tag="v0.11.0"
# Auto-source centralized tags if env is unset # Auto-source centralized tags if env is unset
if [ -z "${HYPRUTILS_TAG:-}" ]; then if [ -z "${HYPRUTILS_TAG:-}" ]; then
TAGS_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/hypr-tags.env" TAGS_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/hypr-tags.env"
@ -21,11 +21,14 @@ if [ "$1" = "--dry-run" ] || [ "${DRY_RUN}" = "1" ] || [ "${DRY_RUN}" = "true" ]
fi fi
## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ## ## WARNING: DO NOT EDIT BEYOND THIS LINE IF YOU DON'T KNOW WHAT YOU ARE DOING! ##
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Change the working directory to the parent directory of the script # Change the working directory to the parent directory of the script
PARENT_DIR="$SCRIPT_DIR/.." PARENT_DIR="$SCRIPT_DIR/.."
cd "$PARENT_DIR" || { echo "${ERROR} Failed to change directory to $PARENT_DIR"; exit 1; } cd "$PARENT_DIR" || {
echo "${ERROR} Failed to change directory to $PARENT_DIR"
exit 1
}
# Source the global functions script # Source the global functions script
if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then if ! source "$(dirname "$(readlink -f "$0")")/Global_functions.sh"; then
@ -49,7 +52,7 @@ fi
if git clone -b $tag "https://github.com/hyprwm/hyprutils.git"; then if git clone -b $tag "https://github.com/hyprwm/hyprutils.git"; then
cd "hyprutils" || exit 1 cd "hyprutils" || exit 1
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -S . -B ./build cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr/local -S . -B ./build
cmake --build ./build --config Release --target all -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF` cmake --build ./build --config Release --target all -j$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)
if [ $DO_INSTALL -eq 1 ]; then if [ $DO_INSTALL -eq 1 ]; then
if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then
printf "${OK} hyprutils installed successfully.\n" 2>&1 | tee -a "$MLOG" printf "${OK} hyprutils installed successfully.\n" 2>&1 | tee -a "$MLOG"
@ -66,5 +69,3 @@ else
fi fi
printf "\n%.0s" {1..2} printf "\n%.0s" {1..2}

View File

@ -211,8 +211,14 @@ fetch_latest_tags() {
run_stack() { run_stack() {
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$TAGS_FILE" source "$TAGS_FILE"
# Export tags so child scripts inherit them # Export all tag keys found in the tags file so child scripts inherit them
export HYPRLAND_TAG AQUAMARINE_TAG HYPRUTILS_TAG HYPRLANG_TAG HYPRGRAPHICS_TAG HYPRWAYLAND_SCANNER_TAG HYPRLAND_PROTOCOLS_TAG HYPRLAND_QT_SUPPORT_TAG HYPRLAND_QTUTILS_TAG HYPRWIRE_TAG WAYLAND_PROTOCOLS_TAG while IFS='=' read -r _k _v; do
[[ -z "${_k:-}" || "$_k" =~ ^# ]] && continue
# Only export keys that look like TAG variables or protocol version
if [[ "$_k" == *"_TAG" || "$_k" == "WAYLAND_PROTOCOLS_TAG" ]]; then
export "$_k"
fi
done < "$TAGS_FILE"
# Optionally install dependencies (not dry-run) # Optionally install dependencies (not dry-run)
if [[ $WITH_DEPS -eq 1 ]]; then if [[ $WITH_DEPS -eq 1 ]]; then
@ -507,7 +513,13 @@ if [[ $VIA_HELPER -eq 1 ]]; then
fi fi
# shellcheck disable=SC1090 # shellcheck disable=SC1090
source "$TAGS_FILE" source "$TAGS_FILE"
export HYPRLAND_TAG AQUAMARINE_TAG HYPRUTILS_TAG HYPRLANG_TAG HYPRGRAPHICS_TAG HYPRWAYLAND_SCANNER_TAG HYPRLAND_PROTOCOLS_TAG HYPRLAND_QT_SUPPORT_TAG HYPRLAND_QTUTILS_TAG WAYLAND_PROTOCOLS_TAG # Export all tag variables dynamically
while IFS='=' read -r _k _v; do
[[ -z "${_k:-}" || "$_k" =~ ^# ]] && continue
if [[ "$_k" == *"_TAG" || "$_k" == "WAYLAND_PROTOCOLS_TAG" ]]; then
export "$_k"
fi
done < "$TAGS_FILE"
helper="$REPO_ROOT/dry-run-build.sh" helper="$REPO_ROOT/dry-run-build.sh"
if [[ ! -x "$helper" ]]; then if [[ ! -x "$helper" ]]; then
echo "[ERROR] dry-run-build.sh not found or not executable at $helper" | tee -a "$SUMMARY_LOG" echo "[ERROR] dry-run-build.sh not found or not executable at $helper" | tee -a "$SUMMARY_LOG"