Skip to content

Commit

Permalink
Add support for building on openSUSE Tumbleweed
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Feb 20, 2025
1 parent ecd0f9b commit e044b0f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 15 deletions.
35 changes: 21 additions & 14 deletions cmake/packaging/linux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,20 +55,27 @@ set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
libx11-6, \
miniupnpc, \
openssl | libssl3")
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PLATFORM_PACKAGE_REQUIRES} \
libcap >= 2.22, \
libcurl >= 7.0, \
libdrm >= 2.4.97, \
libevdev >= 1.5.6, \
libopusenc >= 0.2.1, \
libva >= 2.14.0, \
libwayland-client >= 1.20.0, \
libX11 >= 1.7.3.1, \
miniupnpc >= 2.2.4, \
numactl-libs >= 2.0.14, \
openssl >= 3.0.2, \
pulseaudio-libs >= 10.0")

if (SUNSHINE_BUILD_DISTRO STREQUAL "opensuse")
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PLATFORM_PACKAGE_REQUIRES} \
libcap-progs")
ELSE()
set(CPACK_RPM_PACKAGE_REQUIRES "\
${CPACK_RPM_PLATFORM_PACKAGE_REQUIRES} \
libcap >= 2.22, \
libcurl >= 7.0, \
libdrm >= 2.4.97, \
libevdev >= 1.5.6, \
libopusenc >= 0.2.1, \
libva >= 2.14.0, \
libwayland-client >= 1.20.0, \
libX11 >= 1.7.3.1, \
miniupnpc >= 2.2.4, \
numactl-libs >= 2.0.14, \
openssl >= 3.0.2, \
pulseaudio-libs >= 10.0")
ENDIF()

if(NOT BOOST_USE_STATIC)
set(CPACK_DEBIAN_PACKAGE_DEPENDS "\
Expand Down
44 changes: 43 additions & 1 deletion scripts/linux_build.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,34 @@ function add_ubuntu_deps() {
)
}

function add_opensuse_deps() {
dependencies+=(
"git"
"gcc-c++"
"libappindicator3-devel"
"libcap-devel"
"libcurl-devel"
"libdrm-devel"
"libevdev-devel"
"libminiupnpc-devel"
"libnotify-devel"
"libnuma-devel"
"libopenssl-devel"
"libopus-devel"
"libpulse-devel"
"ninja"
"nodejs"
"rpm-build"
"udev"
)

if [ "$skip_libva" == 0 ]; then
dependencies+=(
"libva-devel" # VA-API
)
fi
}

function add_fedora_deps() {
dependencies+=(
"cmake"
Expand Down Expand Up @@ -248,6 +276,9 @@ function check_version() {
installed_version=$(dpkg -s "$package_name" 2>/dev/null | grep '^Version:' | awk '{print $2}')
elif [ "$distro" == "fedora" ]; then
installed_version=$(rpm -q --queryformat '%{VERSION}' "$package_name" 2>/dev/null)
elif [ "$distro" == "opensuse" ]; then
# avoid using system packages on openSUSE - boost and doxygen versions cause errors
return 1
else
echo "Unsupported Distro"
return 1
Expand Down Expand Up @@ -283,6 +314,8 @@ function run_install() {
"-DSUNSHINE_ENABLE_DRM=ON"
)

cmake_args+=("-DSUNSHINE_BUILD_DISTRO='${distro}'")

if [ "$appimage_build" == 1 ]; then
cmake_args+=("-DSUNSHINE_BUILD_APPIMAGE=ON")
fi
Expand All @@ -308,6 +341,8 @@ function run_install() {
elif [ "$distro" == "fedora" ]; then
add_fedora_deps
${sudo_cmd} dnf group install "Development Tools" -y
elif [ "$distro" == "opensuse" ]; then
add_opensuse_deps
fi

# Install the dependencies
Expand Down Expand Up @@ -395,6 +430,8 @@ function run_install() {
install_cuda
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=ON")
cmake_args+=("-DCMAKE_CUDA_COMPILER:PATH=${build_dir}/cuda/bin/nvcc")
else
cmake_args+=("-DSUNSHINE_ENABLE_CUDA=OFF")
fi

# Cmake stuff here
Expand All @@ -408,7 +445,7 @@ function run_install() {
if [ "$skip_package" == 0 ]; then
if [ "$distro" == "debian" ] || [ "$distro" == "ubuntu" ]; then
cpack -G DEB --config ./build/CPackConfig.cmake
elif [ "$distro" == "fedora" ]; then
elif [ "$distro" == "fedora" ] || [ "$distro" == "opensuse" ]; then
cpack -G RPM --config ./build/CPackConfig.cmake
fi
fi
Expand Down Expand Up @@ -479,6 +516,11 @@ elif grep -q "Ubuntu 24.04" /etc/os-release; then
cuda_build="520.61.05"
gcc_version="11"
nvm_node=0
elif grep -q "opensuse-tumbleweed" /etc/os-release; then
distro="opensuse"
version="tumbleweed"
package_update_command="${sudo_cmd} zypper dup"
package_install_command="${sudo_cmd} zypper in -y"
else
echo "Unsupported Distro or Version"
exit 1
Expand Down

0 comments on commit e044b0f

Please sign in to comment.