mirror of
https://github.com/JaKooLit/Debian-Hyprland.git
synced 2026-02-05 01:30:13 +01:00
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:
parent
118d1509bb
commit
178285a759
@ -4,11 +4,11 @@
|
||||
# hyprutils #
|
||||
|
||||
#specific branch or release
|
||||
tag="v0.10.4"
|
||||
tag="v0.11.0"
|
||||
# Auto-source centralized tags if env is unset
|
||||
if [ -z "${HYPRUTILS_TAG:-}" ]; then
|
||||
TAGS_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/hypr-tags.env"
|
||||
[ -f "$TAGS_FILE" ] && source "$TAGS_FILE"
|
||||
TAGS_FILE="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)/hypr-tags.env"
|
||||
[ -f "$TAGS_FILE" ] && source "$TAGS_FILE"
|
||||
fi
|
||||
# Allow environment override
|
||||
if [ -n "${HYPRUTILS_TAG:-}" ]; then tag="$HYPRUTILS_TAG"; fi
|
||||
@ -21,16 +21,19 @@ if [ "$1" = "--dry-run" ] || [ "${DRY_RUN}" = "1" ] || [ "${DRY_RUN}" = "true" ]
|
||||
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 )"
|
||||
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; }
|
||||
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
|
||||
echo "Failed to source Global_functions.sh"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Set the name of the log file to include the current date and time
|
||||
@ -42,29 +45,27 @@ printf "${NOTE} Cloning hyprutils...\n"
|
||||
|
||||
# Check if hyprutils folder exists and remove it
|
||||
if [ -d "hyprutils" ]; then
|
||||
printf "${NOTE} Removing existing hyprutils folder...\n"
|
||||
rm -rf "hyprutils" 2>&1 | tee -a "$LOG"
|
||||
printf "${NOTE} Removing existing hyprutils folder...\n"
|
||||
rm -rf "hyprutils" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
|
||||
if git clone -b $tag "https://github.com/hyprwm/hyprutils.git"; then
|
||||
cd "hyprutils" || exit 1
|
||||
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`
|
||||
if [ $DO_INSTALL -eq 1 ]; then
|
||||
if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then
|
||||
printf "${OK} hyprutils installed successfully.\n" 2>&1 | tee -a "$MLOG"
|
||||
cd "hyprutils" || exit 1
|
||||
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)
|
||||
if [ $DO_INSTALL -eq 1 ]; then
|
||||
if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then
|
||||
printf "${OK} hyprutils installed successfully.\n" 2>&1 | tee -a "$MLOG"
|
||||
else
|
||||
echo -e "${ERROR} Installation failed for hyprutils." 2>&1 | tee -a "$MLOG"
|
||||
fi
|
||||
else
|
||||
echo -e "${ERROR} Installation failed for hyprutils." 2>&1 | tee -a "$MLOG"
|
||||
echo "${NOTE} DRY RUN: Skipping installation of hyprutils $tag."
|
||||
fi
|
||||
else
|
||||
echo "${NOTE} DRY RUN: Skipping installation of hyprutils $tag."
|
||||
fi
|
||||
[ -f "$MLOG" ] && mv "$MLOG" ../Install-Logs/
|
||||
cd ..
|
||||
[ -f "$MLOG" ] && mv "$MLOG" ../Install-Logs/
|
||||
cd ..
|
||||
else
|
||||
echo -e "${ERROR} Download failed for hyprutils" 2>&1 | tee -a "$LOG"
|
||||
echo -e "${ERROR} Download failed for hyprutils" 2>&1 | tee -a "$LOG"
|
||||
fi
|
||||
|
||||
printf "\n%.0s" {1..2}
|
||||
|
||||
|
||||
|
||||
@ -211,8 +211,14 @@ fetch_latest_tags() {
|
||||
run_stack() {
|
||||
# shellcheck disable=SC1090
|
||||
source "$TAGS_FILE"
|
||||
# Export tags 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
|
||||
# Export all tag keys found in the tags file so child scripts inherit them
|
||||
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)
|
||||
if [[ $WITH_DEPS -eq 1 ]]; then
|
||||
@ -507,7 +513,13 @@ if [[ $VIA_HELPER -eq 1 ]]; then
|
||||
fi
|
||||
# shellcheck disable=SC1090
|
||||
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"
|
||||
if [[ ! -x "$helper" ]]; then
|
||||
echo "[ERROR] dry-run-build.sh not found or not executable at $helper" | tee -a "$SUMMARY_LOG"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user