### REF: https://rustdesk.com/docs/en/dev/build/linux/ Name: rustdesk Version: 1.4.0 Release: 1%{?dist} Summary: Remote desktop software for control and file transfer License: GPL-3.0-only URL: https://github.com/rustdesk/rustdesk Source0: %{url}/archive/refs/tags/%{version}.tar.gz BuildRequires: gcc-c++ git curl wget nasm yasm gcc gtk3-devel clang BuildRequires: libxcb-devel libxdo-devel libXfixes-devel pulseaudio-libs-devel BuildRequires: cmake alsa-lib-devel openssl-devel rust cargo BuildRequires: gstreamer1-devel gstreamer1-plugins-base-devel libvpx-devel BuildRequires: rust cargo gcc-c++ libvpx-devel pam-devel BuildRequires: opus-devel libyuv-devel pkgconfig ExclusiveArch: x86_64 %description RuskDesk is a remote desktop software that allows you to access and control computers remotely. %prep git clone --recurse-submodules https://github.com/rustdesk/rustdesk.git rustdesk cd rustdesk git submodule update --init --recursive # Download libsciter mkdir -p target/debug wget -O target/debug/libsciter-gtk.so https://raw.githubusercontent.com/c-smile/sciter-sdk/master/bin.lnx/x64/libsciter-gtk.so # Set up cargo config for vendoring mkdir -p .cargo cat > .cargo/config.toml <' "$MKVPARSER" else echo "❌ mkvparser.cc patch failed" exit 1 fi # Patch magnum-opus to use system pkg-config for opus MAGNUM_RS=vendor/magnum-opus/build.rs MAGNUM_TOML=vendor/magnum-opus/Cargo.toml if [ -f "$MAGNUM_RS" ]; then echo "⚙️ Patching $MAGNUM_RS" # Replace panic with pkg-config probe sed -i 's/^\s*panic!.*VCPKG_ROOT.*/pkg_config::probe_library("opus").unwrap();/' "$MAGNUM_RS" # Ensure extern crate line grep -q '^extern crate pkg_config;' "$MAGNUM_RS" || \ sed -i '1i extern crate pkg_config;' "$MAGNUM_RS" else echo "❌ $MAGNUM_RS not found" exit 1 fi # Fix Cargo.toml to add pkg-config in build-dependencies if [ -f "$MAGNUM_TOML" ]; then echo "📦 Ensuring build-dependency on pkg-config" # Remove any bad/inline [dependencies] entry if needed sed -i '/pkg-config = /d' "$MAGNUM_TOML" # Inject pkg-config in [build-dependencies] if [ -f "$MAGNUM_TOML" ]; then echo "📦 Ensuring build-dependency on pkg-config" # Remove any invalid or duplicate pkg-config lines sed -i '/^\[build-dependencies\.pkg-config\]/,/^$/d' "$MAGNUM_TOML" sed -i '/^\s*pkg-config\s*=/d' "$MAGNUM_TOML" # Ensure [build-dependencies] exists if ! grep -q '^\[build-dependencies\]' "$MAGNUM_TOML"; then echo -e '\n[build-dependencies]' >> "$MAGNUM_TOML" fi # Append the valid entry sed -i '/^\[build-dependencies\]/a pkg-config = "0.3"' "$MAGNUM_TOML" else echo "❌ $MAGNUM_TOML not found" exit 1 fi else echo "❌ $MAGNUM_TOML not found" exit 1 fi # Step 3: NOW override the patch sources after vendoring cat >> Cargo.toml <