Hyprland tag set to 52.2

This commit is contained in:
Don Williams 2025-12-29 12:47:34 -05:00
parent eef41a7104
commit fd832ef277

View File

@ -3,7 +3,7 @@
# Main Hyprland Package# # Main Hyprland Package#
#specific branch or release #specific branch or release
tag="v0.52.2" tag="v0.53.0"
# Allow environment override # Allow environment override
if [ -n "${HYPRLAND_TAG:-}" ]; then tag="$HYPRLAND_TAG"; fi if [ -n "${HYPRLAND_TAG:-}" ]; then tag="$HYPRLAND_TAG"; fi
@ -15,19 +15,19 @@ if [ "$1" = "--dry-run" ] || [ "${DRY_RUN}" = "1" ] || [ "${DRY_RUN}" = "true" ]
fi fi
hyprland=( hyprland=(
clang clang
llvm llvm
libxcb-errors-dev libxcb-errors-dev
libre2-dev libre2-dev
libglaze-dev libglaze-dev
libudis86-dev libudis86-dev
libinotify-ocaml-dev libinotify-ocaml-dev
libmuparser-dev libmuparser-dev
) )
## 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! ##
# Determine the directory where the script is located # Determine the directory where the script is located
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/.."
@ -43,11 +43,11 @@ MLOG="install-$(date +%d-%H%M%S)_hyprland2.log"
printf "\n%s - Installing hyprland additional dependencies.... \n" "${NOTE}" printf "\n%s - Installing hyprland additional dependencies.... \n" "${NOTE}"
for PKG1 in "${hyprland[@]}"; do for PKG1 in "${hyprland[@]}"; do
install_package "$PKG1" 2>&1 | tee -a "$LOG" install_package "$PKG1" 2>&1 | tee -a "$LOG"
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs" echo -e "\e[1A\e[K${ERROR} - $PKG1 Package installation failed, Please check the installation logs"
exit 1 exit 1
fi fi
done done
printf "\n%.0s" {1..1} printf "\n%.0s" {1..1}
@ -63,7 +63,6 @@ if [ ! -d /usr/include/glaze ]; then
echo "${INFO} ${YELLOW}libglaze-dev from assets${RESET} installed." echo "${INFO} ${YELLOW}libglaze-dev from assets${RESET} installed."
fi fi
printf "\n%.0s" {1..1} printf "\n%.0s" {1..1}
# Clone, build, and install Hyprland using Cmake # Clone, build, and install Hyprland using Cmake
@ -71,16 +70,16 @@ printf "${NOTE} Cloning and Installing ${YELLOW}Hyprland $tag${RESET} ...\n"
# Check if Hyprland folder exists and remove it # Check if Hyprland folder exists and remove it
if [ -d "Hyprland" ]; then if [ -d "Hyprland" ]; then
printf "${NOTE} Removing existing Hyprland folder...\n" printf "${NOTE} Removing existing Hyprland folder...\n"
rm -rf "Hyprland" 2>&1 | tee -a "$LOG" rm -rf "Hyprland" 2>&1 | tee -a "$LOG"
fi fi
if git clone --recursive -b $tag "https://github.com/hyprwm/Hyprland"; then if git clone --recursive -b $tag "https://github.com/hyprwm/Hyprland"; then
cd "Hyprland" || exit 1 cd "Hyprland" || exit 1
# Compatibility shim for toolchains without std::vector::{insert_range,append_range} # Compatibility shim for toolchains without std::vector::{insert_range,append_range}
RANGE_HDR="$(pwd)/hypr_range_compat.hpp" RANGE_HDR="$(pwd)/hypr_range_compat.hpp"
cat > "$RANGE_HDR" <<'EOF' cat >"$RANGE_HDR" <<'EOF'
#pragma once #pragma once
#include <iterator> #include <iterator>
#include <ranges> #include <ranges>
@ -91,94 +90,94 @@ if git clone --recursive -b $tag "https://github.com/hyprwm/Hyprland"; then
// append_range compatibility for containers expecting begin/end // append_range compatibility for containers expecting begin/end
#define APPEND_RANGE(vec, ...) (vec).insert((vec).end(), std::begin(__VA_ARGS__), std::end(__VA_ARGS__)) #define APPEND_RANGE(vec, ...) (vec).insert((vec).end(), std::begin(__VA_ARGS__), std::end(__VA_ARGS__))
EOF EOF
# Rewrite calls: # Rewrite calls:
# x.insert_range(pos, rng) -> INSERT_RANGE_AT(x, pos, rng) # x.insert_range(pos, rng) -> INSERT_RANGE_AT(x, pos, rng)
# x.insert_range(rng) -> INSERT_RANGE(x, rng) # x.insert_range(rng) -> INSERT_RANGE(x, rng)
# x.append_range(rng) -> APPEND_RANGE(x, rng) # x.append_range(rng) -> APPEND_RANGE(x, rng)
PATCH_FILES=$(grep -REIl --exclude-dir=.git '\.\s*(insert_range|append_range)\s*\(' . || true) PATCH_FILES=$(grep -REIl --exclude-dir=.git '\.\s*(insert_range|append_range)\s*\(' . || true)
if [ -n "$PATCH_FILES" ]; then if [ -n "$PATCH_FILES" ]; then
# Two-arg form first (pos, rng) # Two-arg form first (pos, rng)
perl -0777 -pi -e 's/([A-Za-z_][[:alnum:]_:.>\-]*?)\s*\.\s*insert_range\s*\(\s*([^,]+?)\s*,\s*/INSERT_RANGE_AT($1, $2, /gs' $PATCH_FILES perl -0777 -pi -e 's/([A-Za-z_][[:alnum:]_:.>\-]*?)\s*\.\s*insert_range\s*\(\s*([^,]+?)\s*,\s*/INSERT_RANGE_AT($1, $2, /gs' $PATCH_FILES
# One-arg form (rng only) # One-arg form (rng only)
perl -0777 -pi -e 's/([A-Za-z_][[:alnum:]_:.>\-]*?)\s*\.\s*insert_range\s*\(/INSERT_RANGE($1, /gs' $PATCH_FILES perl -0777 -pi -e 's/([A-Za-z_][[:alnum:]_:.>\-]*?)\s*\.\s*insert_range\s*\(/INSERT_RANGE($1, /gs' $PATCH_FILES
# append_range # append_range
perl -0777 -pi -e 's/([A-Za-z_][[:alnum:]_:.>\-]*?)\s*\.\s*append_range\s*\(/APPEND_RANGE($1, /gs' $PATCH_FILES perl -0777 -pi -e 's/([A-Za-z_][[:alnum:]_:.>\-]*?)\s*\.\s*append_range\s*\(/APPEND_RANGE($1, /gs' $PATCH_FILES
fi fi
# Replace #embed with an autogenerated bytes include for toolchains lacking it # Replace #embed with an autogenerated bytes include for toolchains lacking it
EX_CONF="$(pwd)/example/hyprland.conf" EX_CONF="$(pwd)/example/hyprland.conf"
EMBED_INC="$(pwd)/src/config/defaultConfig.bytes.inc" EMBED_INC="$(pwd)/src/config/defaultConfig.bytes.inc"
if [ -f "$EX_CONF" ]; then if [ -f "$EX_CONF" ]; then
xxd -i -g 1 -c 16 "$EX_CONF" | sed -n '/^{/{flag=1;next} /};/{flag=0} flag p' > "$EMBED_INC" || true xxd -i -g 1 -c 16 "$EX_CONF" | sed -n '/^{/{flag=1;next} /};/{flag=0} flag p' >"$EMBED_INC" || true
# Swap the directive in the header to include the generated bytes # Swap the directive in the header to include the generated bytes
sed -ri 's|^\s*#embed\s+"\.{0,2}/\.{0,2}/example/hyprland\.conf"\s*$|#include "defaultConfig.bytes.inc"|g' src/config/defaultConfig.hpp || true 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 fi
# Apply patch only if it applies cleanly; otherwise skip # Apply patch only if it applies cleanly; otherwise skip
if [ -f ../assets/0001-fix-hyprland-compile-issue.patch ]; then 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 if patch -p1 --dry-run <../assets/0001-fix-hyprland-compile-issue.patch >/dev/null 2>&1; then
patch -p1 < ../assets/0001-fix-hyprland-compile-issue.patch patch -p1 <../assets/0001-fix-hyprland-compile-issue.patch
else
echo "${NOTE} Hyprland compile patch does not apply on $tag; skipping."
fi
fi
# By default, build Hyprland with bundled hyprutils/hyprlang to avoid version mismatches
# You can force system libs by exporting USE_SYSTEM_HYPRLIBS=1 before running this script.
USE_SYSTEM=${USE_SYSTEM_HYPRLIBS:-1}
if [ "$USE_SYSTEM" = "1" ]; then
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:${PKG_CONFIG_PATH:-}"
export CMAKE_PREFIX_PATH="/usr/local:${CMAKE_PREFIX_PATH:-}"
SYSTEM_FLAGS=(
"-DUSE_SYSTEM_HYPRUTILS=ON"
"-DUSE_SYSTEM_HYPRLANG=ON"
"-DUSE_SYSTEM_HYPRWIRE=ON"
)
# Optional preflight: verify hyprwire is discoverable by CMake/pkg-config
if [ ! -e "/usr/local/lib/cmake/Hyprwire/HyprwireConfig.cmake" ] && ! pkg-config --exists hyprwire 2>/dev/null; then
echo "${NOTE} hyprwire not detected in /usr/local yet. Ensure install-scripts/hyprwire.sh ran successfully or set USE_SYSTEM_HYPRLIBS=0 to use subprojects."
fi
else else
echo "${NOTE} Hyprland compile patch does not apply on $tag; skipping." # Ensure we do not accidentally pick up mismatched system headers
unset PKG_CONFIG_PATH || true
SYSTEM_FLAGS=(
"-DUSE_SYSTEM_HYPRUTILS=OFF"
"-DUSE_SYSTEM_HYPRLANG=OFF"
"-DUSE_SYSTEM_HYPRWIRE=OFF"
)
fi fi
fi
# By default, build Hyprland with bundled hyprutils/hyprlang to avoid version mismatches # Make sure submodules are present when building bundled deps
# You can force system libs by exporting USE_SYSTEM_HYPRLIBS=1 before running this script. git submodule update --init --recursive || true
USE_SYSTEM=${USE_SYSTEM_HYPRLIBS:-1}
if [ "$USE_SYSTEM" = "1" ]; then # Force Clang toolchain to support required language features and flags
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:${PKG_CONFIG_PATH:-}" export CC="${CC:-clang}"
export CMAKE_PREFIX_PATH="/usr/local:${CMAKE_PREFIX_PATH:-}" export CXX="${CXX:-clang++}"
SYSTEM_FLAGS=( CONFIG_FLAGS=(
"-DUSE_SYSTEM_HYPRUTILS=ON" -DCMAKE_BUILD_TYPE=Release
"-DUSE_SYSTEM_HYPRLANG=ON" -DCMAKE_C_COMPILER="${CC}"
"-DUSE_SYSTEM_HYPRWIRE=ON" -DCMAKE_CXX_COMPILER="${CXX}"
-DCMAKE_CXX_STANDARD=23
-DCMAKE_CXX_STANDARD_REQUIRED=ON
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option -include ${RANGE_HDR}"
"${SYSTEM_FLAGS[@]}"
) )
# Optional preflight: verify hyprwire is discoverable by CMake/pkg-config cmake -S . -B build "${CONFIG_FLAGS[@]}"
if [ ! -e "/usr/local/lib/cmake/Hyprwire/HyprwireConfig.cmake" ] && ! pkg-config --exists hyprwire 2>/dev/null; then cmake --build build -j "$(nproc 2>/dev/null || getconf _NPROCESSORS_CONF)"
echo "${NOTE} hyprwire not detected in /usr/local yet. Ensure install-scripts/hyprwire.sh ran successfully or set USE_SYSTEM_HYPRLIBS=0 to use subprojects."
fi
else
# Ensure we do not accidentally pick up mismatched system headers
unset PKG_CONFIG_PATH || true
SYSTEM_FLAGS=(
"-DUSE_SYSTEM_HYPRUTILS=OFF"
"-DUSE_SYSTEM_HYPRLANG=OFF"
"-DUSE_SYSTEM_HYPRWIRE=OFF"
)
fi
# Make sure submodules are present when building bundled deps if [ $DO_INSTALL -eq 1 ]; then
git submodule update --init --recursive || true if sudo cmake --install build 2>&1 | tee -a "$MLOG"; then
printf "${OK} ${MAGENTA}Hyprland tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
# Force Clang toolchain to support required language features and flags else
export CC="${CC:-clang}" echo -e "${ERROR} Installation failed for ${YELLOW}Hyprland $tag${RESET}" 2>&1 | tee -a "$MLOG"
export CXX="${CXX:-clang++}" fi
CONFIG_FLAGS=(
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER="${CC}"
-DCMAKE_CXX_COMPILER="${CXX}"
-DCMAKE_CXX_STANDARD=23
-DCMAKE_CXX_STANDARD_REQUIRED=ON
-DCMAKE_CXX_EXTENSIONS=ON
-DCMAKE_CXX_FLAGS="-Wno-unknown-warning-option -include ${RANGE_HDR}"
"${SYSTEM_FLAGS[@]}"
)
cmake -S . -B build "${CONFIG_FLAGS[@]}"
cmake --build build -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} ${MAGENTA}Hyprland tag${RESET} installed successfully.\n" 2>&1 | tee -a "$MLOG"
else else
echo -e "${ERROR} Installation failed for ${YELLOW}Hyprland $tag${RESET}" 2>&1 | tee -a "$MLOG" echo "${NOTE} DRY RUN: Skipping installation of Hyprland $tag."
fi fi
else [ -f "$MLOG" ] && mv "$MLOG" ../Install-Logs/
echo "${NOTE} DRY RUN: Skipping installation of Hyprland $tag." cd ..
fi
[ -f "$MLOG" ] && mv "$MLOG" ../Install-Logs/
cd ..
else else
echo -e "${ERROR} Download failed for ${YELLOW}Hyprland $tag${RESET}" 2>&1 | tee -a "$LOG" echo -e "${ERROR} Download failed for ${YELLOW}Hyprland $tag${RESET}" 2>&1 | tee -a "$LOG"
fi fi
printf "\n%.0s" {1..2} printf "\n%.0s" {1..2}