From d9da0fe05c8f0c8ccef2ae37571b14b5b9ab6da5 Mon Sep 17 00:00:00 2001 From: Boris Yumankulov Date: Fri, 3 Jul 2026 13:14:40 +0500 Subject: [PATCH] epm play sunshine: bundle fedora libs (eterbug #19183) Signed-off-by: Boris Yumankulov --- play.d/sunshine.sh | 8 +---- repack.d/Sunshine.sh | 76 ++++++++++++++++++++++---------------------- 2 files changed, 39 insertions(+), 45 deletions(-) diff --git a/play.d/sunshine.sh b/play.d/sunshine.sh index 5feda99f7..5c8b43d63 100644 --- a/play.d/sunshine.sh +++ b/play.d/sunshine.sh @@ -14,17 +14,11 @@ is_openssl_enough 3 || fatal "There is no needed OpenSSL 3 in the system." arch=$(epm print info -a) -# Newer Sunshine (>= 2026) is built against Fedora 45 and links libicuuc.so.78, -# which ALT (ICU <= 74) does not ship. Provide it first. -if ! ldconfig -p 2>/dev/null | grep -q 'libicuuc.so.78 ' ; then - epm play libicu78 || fatal "Can't install libicu78 (needed for libicuuc.so.78)" -fi - # Use GitHub releases (Fedora packages work for ALT via repack) if [ "$VERSION" != "*" ] ; then PKGURL="https://github.com/LizardByte/Sunshine/releases/download/v${VERSION}/Sunshine-${VERSION}-${RELEASE}.$arch.rpm" else - PKGURL=$(eget --list --latest https://github.com/LizardByte/Sunshine/releases "Sunshine-*-*.fc*.$arch.rpm") + PKGURL=$(eget --list --latest https://github.com/LizardByte/Sunshine/releases "Sunshine-*-*.fc42.$arch.rpm") fi install_pkgurl diff --git a/repack.d/Sunshine.sh b/repack.d/Sunshine.sh index 1203cc6c0..5263349c8 100755 --- a/repack.d/Sunshine.sh +++ b/repack.d/Sunshine.sh @@ -10,52 +10,52 @@ PRODUCT=sunshine add_conflicts sunshine -# Sunshine needs access to uinput to create mouse and gamepad events. -cat </dev/null ) || fatal "Can't extract libicu RPM" -# Replace fedora libboost to system libboost -for lib in ${BOOST_LIBS}; do - a='' patchelf --replace-needed "libboost_${lib}.so.${BOOST_FEDORA_VERSION}" "libboost_${lib}.so.${BOOST_REPO_VERSION}" "usr/bin/sunshine" +mkdir -p "$BUILDROOT$SUNSHINE_LIBDIR" || fatal +pack_dir "$SUNSHINE_LIBDIR" +find "$tmpdir/fedora-icu" \( -type f -o -type l \) -name 'libicu*.so*' | sort -V | while read -r lib ; do + dest="$SUNSHINE_LIBDIR/$(basename "$lib")" + cp -a "$lib" "$BUILDROOT$dest" || fatal + pack_file "$dest" + [ -L "$BUILDROOT$dest" ] || chmod 0755 "$BUILDROOT$dest" done -# Replace fedora libminiupnpc to system libminiupnpc -a='' patchelf --replace-needed "libminiupnpc.so.$MINIUPNPC_FEDORA_VERSION" "libminiupnpc.so.$MINIUPNPC_REPO_VERSION" "usr/bin/sunshine" +find "$BUILDROOT$SUNSHINE_LIBDIR" -type f -name 'libicu*.so*' | while read -r lib ; do + a='' patchelf --set-rpath '$ORIGIN' "$lib" || fatal +done +a='' patchelf --set-rpath '$ORIGIN/../share/sunshine/lib' "usr/bin/sunshine" a='' patchelf --replace-needed "libappindicator3.so.1" "libayatana-appindicator3.so.1" "usr/bin/sunshine" +fix_desktop_file "^Exec=.*" "Exec=sunshine" + +# The binary has libminiupnpc in NEEDED, but does not import any symbols from it. +# Loading Fedora's libminiupnpc on ALT can crash at process start, so drop this unused entry. +patchelf --print-needed "usr/bin/sunshine" | grep '^libminiupnpc\.so\.' | while read -r lib ; do + a='' patchelf --remove-needed "$lib" "usr/bin/sunshine" || fatal +done