From edb5261c67a7d845082b4f987a18b79089632b36 Mon Sep 17 00:00:00 2001 From: Clutchnp Date: Mon, 5 May 2025 09:08:46 +0530 Subject: [PATCH 1/3] linux_build gcc version + docs_disable --- scripts/linux_build.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 3b541d95b71..832505858c6 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -96,6 +96,8 @@ function add_arch_deps() { 'base-devel' 'cmake' 'curl' + "gcc-${gcc_version}" + "gcc${gcc_version}-libs" 'git' 'libayatana-appindicator' 'libcap' @@ -358,6 +360,8 @@ function run_install() { if [ "$distro" == "arch" ]; then add_arch_deps + #docs currently broken for arch + cmake_args+=("-DBUILD_DOCS=OFF") elif [ "$distro" == "debian" ]; then add_debian_deps elif [ "$distro" == "ubuntu" ]; then @@ -382,8 +386,11 @@ function run_install() { "gcc-ranlib" ) - # update alternatives for gcc and g++ if a debian based distro - if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then + #set gcc version based on distros + if [ "$distro" == "arch" ]; then + export CC=gcc-14 + export CXX=g++-14 + elif [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then for file in "${gcc_alternative_files[@]}"; do file_path="/etc/alternatives/$file" if [ -e "$file_path" ]; then @@ -498,6 +505,7 @@ if grep -q "Arch Linux" /etc/os-release; then package_update_command="${sudo_cmd} pacman -Syu --noconfirm" package_install_command="${sudo_cmd} pacman -Sy --needed" nvm_node=0 + gcc_version="14" elif grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then distro="debian" version="12" From 63eb8f378ef6ecc8675b67ba6262c04bade5133d Mon Sep 17 00:00:00 2001 From: Clutchnp Date: Mon, 5 May 2025 19:47:02 +0530 Subject: [PATCH 2/3] add an upper bound check instead of removing manually per distro --- scripts/linux_build.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 832505858c6..58c26617751 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -295,6 +295,7 @@ function install_cuda() { function check_version() { local package_name=$1 local min_version=$2 + local max_version=$3 local installed_version echo "Checking if $package_name is installed and at least version $min_version" @@ -315,11 +316,12 @@ function check_version() { return 1 fi - if [ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]; then - echo "$package_name version $installed_version is at least $min_version" +if [[ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]] && \ + [[ "$(printf '%s\n' "$installed_version" "$max_version" | sort -V | head -n1)" = "$installed_version" ]]; then + echo "Installed version is within range" return 0 else - echo "$package_name version $installed_version is less than $min_version" + echo "$package_name version $installed_version is out of range" return 1 fi } @@ -360,8 +362,6 @@ function run_install() { if [ "$distro" == "arch" ]; then add_arch_deps - #docs currently broken for arch - cmake_args+=("-DBUILD_DOCS=OFF") elif [ "$distro" == "debian" ]; then add_debian_deps elif [ "$distro" == "ubuntu" ]; then @@ -409,7 +409,7 @@ function run_install() { # compile cmake if the version is too low cmake_min="3.25.0" target_cmake_version="3.30.1" - if ! check_version "cmake" "$cmake_min"; then + if ! check_version "cmake" "$cmake_min" "inf"; then cmake_prefix="https://github.com/Kitware/CMake/releases/download/v" if [ "$architecture" == "x86_64" ]; then cmake_arch="x86_64" @@ -427,7 +427,8 @@ function run_install() { # compile doxygen if version is too low doxygen_min="1.10.0" _doxygen_min="1_10_0" - if ! check_version "doxygen" "$doxygen_min"; then + doxygen_max="1.12.0" + if ! check_version "doxygen" "$doxygen_min" "$doxygen_max"; then if [ "${SUNSHINE_COMPILE_DOXYGEN}" == "true" ]; then echo "Compiling doxygen" doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz" @@ -439,7 +440,7 @@ function run_install() { ninja -C "build" -j"${num_processors}" ninja -C "build" install else - echo "Doxygen version too low, skipping docs" + echo "Doxygen version not in range, skipping docs" cmake_args+=("-DBUILD_DOCS=OFF") fi fi From ff3b8b464701b472eebc0a45098ca8287e939c31 Mon Sep 17 00:00:00 2001 From: Clutchnp Date: Mon, 5 May 2025 20:20:03 +0530 Subject: [PATCH 3/3] fix wrong name for gcc on arch --- scripts/linux_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/linux_build.sh b/scripts/linux_build.sh index 58c26617751..1ac5f162650 100755 --- a/scripts/linux_build.sh +++ b/scripts/linux_build.sh @@ -96,7 +96,7 @@ function add_arch_deps() { 'base-devel' 'cmake' 'curl' - "gcc-${gcc_version}" + "gcc${gcc_version}" "gcc${gcc_version}-libs" 'git' 'libayatana-appindicator'