build(linux): fix gcc version and disable docs for build on arch (#3846)
This commit is contained in:
parent
a846ea909a
commit
c435d0fe56
1 changed files with 17 additions and 8 deletions
|
|
@ -96,6 +96,8 @@ function add_arch_deps() {
|
||||||
'base-devel'
|
'base-devel'
|
||||||
'cmake'
|
'cmake'
|
||||||
'curl'
|
'curl'
|
||||||
|
"gcc${gcc_version}"
|
||||||
|
"gcc${gcc_version}-libs"
|
||||||
'git'
|
'git'
|
||||||
'libayatana-appindicator'
|
'libayatana-appindicator'
|
||||||
'libcap'
|
'libcap'
|
||||||
|
|
@ -293,6 +295,7 @@ function install_cuda() {
|
||||||
function check_version() {
|
function check_version() {
|
||||||
local package_name=$1
|
local package_name=$1
|
||||||
local min_version=$2
|
local min_version=$2
|
||||||
|
local max_version=$3
|
||||||
local installed_version
|
local installed_version
|
||||||
|
|
||||||
echo "Checking if $package_name is installed and at least version $min_version"
|
echo "Checking if $package_name is installed and at least version $min_version"
|
||||||
|
|
@ -313,11 +316,12 @@ function check_version() {
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]; then
|
if [[ "$(printf '%s\n' "$installed_version" "$min_version" | sort -V | head -n1)" = "$min_version" ]] && \
|
||||||
echo "$package_name version $installed_version is at least $min_version"
|
[[ "$(printf '%s\n' "$installed_version" "$max_version" | sort -V | head -n1)" = "$installed_version" ]]; then
|
||||||
|
echo "Installed version is within range"
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
echo "$package_name version $installed_version is less than $min_version"
|
echo "$package_name version $installed_version is out of range"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
@ -382,8 +386,11 @@ function run_install() {
|
||||||
"gcc-ranlib"
|
"gcc-ranlib"
|
||||||
)
|
)
|
||||||
|
|
||||||
# update alternatives for gcc and g++ if a debian based distro
|
#set gcc version based on distros
|
||||||
if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then
|
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
|
for file in "${gcc_alternative_files[@]}"; do
|
||||||
file_path="/etc/alternatives/$file"
|
file_path="/etc/alternatives/$file"
|
||||||
if [ -e "$file_path" ]; then
|
if [ -e "$file_path" ]; then
|
||||||
|
|
@ -402,7 +409,7 @@ function run_install() {
|
||||||
# compile cmake if the version is too low
|
# compile cmake if the version is too low
|
||||||
cmake_min="3.25.0"
|
cmake_min="3.25.0"
|
||||||
target_cmake_version="3.30.1"
|
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"
|
cmake_prefix="https://github.com/Kitware/CMake/releases/download/v"
|
||||||
if [ "$architecture" == "x86_64" ]; then
|
if [ "$architecture" == "x86_64" ]; then
|
||||||
cmake_arch="x86_64"
|
cmake_arch="x86_64"
|
||||||
|
|
@ -420,7 +427,8 @@ function run_install() {
|
||||||
# compile doxygen if version is too low
|
# compile doxygen if version is too low
|
||||||
doxygen_min="1.10.0"
|
doxygen_min="1.10.0"
|
||||||
_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
|
if [ "${SUNSHINE_COMPILE_DOXYGEN}" == "true" ]; then
|
||||||
echo "Compiling doxygen"
|
echo "Compiling doxygen"
|
||||||
doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz"
|
doxygen_url="https://github.com/doxygen/doxygen/releases/download/Release_${_doxygen_min}/doxygen-${doxygen_min}.src.tar.gz"
|
||||||
|
|
@ -432,7 +440,7 @@ function run_install() {
|
||||||
ninja -C "build" -j"${num_processors}"
|
ninja -C "build" -j"${num_processors}"
|
||||||
ninja -C "build" install
|
ninja -C "build" install
|
||||||
else
|
else
|
||||||
echo "Doxygen version too low, skipping docs"
|
echo "Doxygen version not in range, skipping docs"
|
||||||
cmake_args+=("-DBUILD_DOCS=OFF")
|
cmake_args+=("-DBUILD_DOCS=OFF")
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
@ -498,6 +506,7 @@ if grep -q "Arch Linux" /etc/os-release; then
|
||||||
package_update_command="${sudo_cmd} pacman -Syu --noconfirm"
|
package_update_command="${sudo_cmd} pacman -Syu --noconfirm"
|
||||||
package_install_command="${sudo_cmd} pacman -Sy --needed"
|
package_install_command="${sudo_cmd} pacman -Sy --needed"
|
||||||
nvm_node=0
|
nvm_node=0
|
||||||
|
gcc_version="14"
|
||||||
elif grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then
|
elif grep -q "Debian GNU/Linux 12 (bookworm)" /etc/os-release; then
|
||||||
distro="debian"
|
distro="debian"
|
||||||
version="12"
|
version="12"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue