### 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 # Clone the main repo with submodules git clone --recurse-submodules https://github.com/rustdesk/rustdesk.git rustdesk cd rustdesk git submodule update --init --recursive # Download prebuilt Sciter library 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 < in webm-sys C++ source MKVPARSER=vendor/webm-sys/libwebm/mkvparser/mkvparser.cc if grep -q 'common/webmids.h' "$MKVPARSER"; then echo "🔧 Patching mkvparser.cc to include " sed -i '/common\/webmids\.h/a #include ' "$MKVPARSER" else echo "❌ mkvparser.cc patch failed" exit 1 fi # --- Patch magnum-opus --- MAGNUM_RS=vendor/magnum-opus/build.rs MAGNUM_TOML=vendor/magnum-opus/Cargo.toml if [ -f "$MAGNUM_RS" ]; then echo "⚙️ Patching $MAGNUM_RS" sed -i 's/^\s*panic!.*VCPKG_ROOT.*/pkg_config::probe_library("opus").unwrap();/' "$MAGNUM_RS" 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 # Ensure pkg-config is declared as build dependency if [ -f "$MAGNUM_TOML" ]; then echo "📦 Ensuring build-dependency on pkg-config" sed -i '/pkg-config = /d' "$MAGNUM_TOML" if grep -q '^\[build-dependencies\]' "$MAGNUM_TOML"; then sed -i '/^\[build-dependencies\]/a pkg-config = "0.3"' "$MAGNUM_TOML" else echo -e '\n[build-dependencies]\npkg-config = "0.3"' >> "$MAGNUM_TOML" fi # Declare the dummy feature "linux-pkg-config" if ! grep -q '^\[features\]' "$MAGNUM_TOML"; then echo -e '\n[features]\nlinux-pkg-config = []' >> "$MAGNUM_TOML" elif ! grep -q '^linux-pkg-config' "$MAGNUM_TOML"; then sed -i '/^\[features\]/a linux-pkg-config = []' "$MAGNUM_TOML" fi else echo "❌ $MAGNUM_TOML not found" exit 1 fi # Step 3: Override patch sources AFTER vendoring cat >> Cargo.toml <