Skip to content

Adding compilation support for Fedora 41 #6780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 53 additions & 12 deletions scripts/install/linux_compilation_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,66 @@
#!/bin/bash

# exit when any command fails on CI
# Exit when any command fails on CI
if [[ ! -z "$CI" ]]; then
set -e
set -e
fi

if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
echo "This script must be run as root"
exit 1
fi

alias apt='apt --option="APT::Acquire::Retries=3"'
apt update
apt install --yes git lsb-release cmake swig libglu1-mesa-dev libglib2.0-dev libfreeimage3 libfreetype6-dev libxml2-dev libboost-dev libssh-gcrypt-dev libzip-dev libreadline-dev pbzip2 wget zip unzip python3 python3-pip libopenal-dev

UBUNTU_VERSION=$(lsb_release -rs)
if [[ $UBUNTU_VERSION == "22.04" || $UBUNTU_VERSION == "24.04" ]]; then
apt install --yes libzip4 openssl
# Detect the operating system
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
VERSION_ID=$VERSION_ID
else
echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported."
echo "Cannot determine the operating system."
exit 1
fi

# Function to install packages on Ubuntu
install_ubuntu_packages() {
alias apt='apt --option="APT::Acquire::Retries=3"'
apt update
apt install --yes git lsb-release cmake swig libglu1-mesa-dev libglib2.0-dev libfreeimage3 libfreetype6-dev libxml2-dev libboost-dev libssh-gcrypt-dev libzip-dev libreadline-dev pbzip2 wget zip unzip python3 python3-pip libopenal-dev

if [[ $VERSION_ID == "20.04" ]]; then
apt install --yes libzip5 perl libtext-template-perl
elif [[ $VERSION_ID == "22.04" || $VERSION_ID == "24.04" ]]; then
apt install --yes libzip4 openssl
else
echo "Unsupported Ubuntu version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported."
fi
}

# Function to install packages on Fedora
install_fedora_packages() {
dnf install -y git cmake swig mesa-libGLU-devel glib2-devel freeimage freetype-devel libxml2-devel boost-devel libssh-devel libzip-devel readline-devel pbzip2 wget zip unzip python3 python3-pip openal-soft-devel glm-devel stb-devel
# Resolve lsb-release conflict issue
if dnf list installed lsb_release &>/dev/null; then
echo "Removing conflicting lsb_release package..."
dnf remove -y lsb_release
fi

# Install redhat-lsb-core safely
dnf install -y redhat-lsb-core --allowerasing
}

# Determine the operating system and call the appropriate function
case "$OS" in
ubuntu)
install_ubuntu_packages
;;
fedora)
install_fedora_packages
;;
*)
echo "Unsupported operating system: $OS"
exit 1
;;
esac

script_full_path=$(dirname "$0")
$script_full_path/linux_runtime_dependencies.sh
72 changes: 57 additions & 15 deletions scripts/install/linux_runtime_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,67 @@
#!/bin/bash

# exit when any command fails on CI
# Exit when any command fails on CI
if [[ ! -z "$CI" ]]; then
set -e
set -e
fi

if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
echo "This script must be run as root"
exit 1
fi

alias apt='apt --option="APT::Acquire::Retries=3"'
apt update
apt install --yes lsb-release g++ make libavcodec-extra libglu1-mesa libegl1 libxkbcommon-x11-dev libxcb-keysyms1 libxcb-image0 libxcb-icccm4 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcomposite-dev libxtst6 libnss3 libxcb-cursor0
if [[ -z "$DISPLAY" ]]; then
apt install --yes xvfb
fi

UBUNTU_VERSION=$(lsb_release -rs)
if [[ $UBUNTU_VERSION == "22.04" || $UBUNTU_VERSION == "24.04" ]]; then
apt install --yes ffmpeg
# Detect the operating system
if [ -f /etc/os-release ]; then
. /etc/os-release
OS=$ID
VERSION_ID=$VERSION_ID
else
echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported."
echo "Cannot determine the operating system."
exit 1
fi

# Function to install runtime dependencies on Ubuntu
install_ubuntu_runtime_packages() {
alias apt='apt --option="APT::Acquire::Retries=3"'
apt update
apt install --yes lsb-release g++ make libavcodec-extra libglu1-mesa libegl1 \
libxkbcommon-x11-dev libxcb-keysyms1 libxcb-image0 libxcb-icccm4 libxcb-randr0 \
libxcb-render-util0 libxcb-xinerama0 libxcomposite-dev libxtst6 libnss3 libxcb-cursor0

if [[ -z "$DISPLAY" ]]; then
apt install --yes xvfb
fi

UBUNTU_VERSION=$(lsb_release -rs)
if [[ $UBUNTU_VERSION == "22.04" || $UBUNTU_VERSION == "24.04" ]]; then
apt install --yes ffmpeg
else
echo "Unsupported Linux version: dependencies may not be completely installed. Only the two latest Ubuntu LTS are supported."
fi
}

# Function to install runtime dependencies on Fedora
install_fedora_runtime_packages() {
dnf install -y redhat-lsb-core gcc-c++ make mesa-libGLU libEGL \
xkeyboard-config libxcb libXcomposite libXtst nss xcb-util xcb-util-image \
xcb-util-keysyms xcb-util-renderutil xcb-util-wm xcb-util-cursor \
ffmpeg

if [[ -z "$DISPLAY" ]]; then
dnf install -y xorg-x11-server-Xvfb
fi
}

# Determine the operating system and call the appropriate function
case "$OS" in
ubuntu)
install_ubuntu_runtime_packages
;;
fedora)
install_fedora_runtime_packages
;;
*)
echo "Unsupported operating system: $OS"
exit 1
;;
esac