about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix184
1 files changed, 99 insertions, 85 deletions
diff --git a/nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix b/nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix
index 1f2972ee3127..2a06e3f9da56 100644
--- a/nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix
+++ b/nixpkgs/pkgs/applications/networking/remote/rustdesk/default.nix
@@ -1,106 +1,73 @@
 { lib
-, fetchFromGitHub
-, makeDesktopItem
-, copyDesktopItems
-, makeWrapper
 , rustPlatform
-, cmake
-, yasm
-, nasm
+, fetchFromGitHub
 , pkg-config
-, clang
+, wrapGAppsHook
+, atk
+, bzip2
+, cairo
+, dbus
+, gdk-pixbuf
+, glib
+, gst_all_1
 , gtk3
-, xdotool
-, libxcb
-, libXfixes
-, alsa-lib
-, pulseaudio
+, libgit2
+, libpulseaudio
+, libsodium
 , libXtst
 , libvpx
 , libyuv
 , libopus
+, libaom
+, libxkbcommon
 , libsciter
-, wrapGAppsHook
-, writeText
+, xdotool
+, pam
+, pango
+, zlib
+, zstd
+, stdenv
+, darwin
+, alsa-lib
+, makeDesktopItem
 }:
 
 rustPlatform.buildRustPackage rec {
   pname = "rustdesk";
-  version = "1.1.9";
+  version = "1.2.2";
 
   src = fetchFromGitHub {
     owner = "rustdesk";
     repo = "rustdesk";
     rev = version;
-    sha256 = "sha256-IlrfqwNyaSHE9Ct0mn7MUxEg7p1Ku34eOMYelEAYFW8=";
+    hash = "sha256-fgdhPBrC8HuuEKorzG9hY4K3KVwB8hENtE3RM5agGWk=";
   };
 
-  patches = [
-    # based on https://github.com/rustdesk/rustdesk/pull/1900
-    ./fix-for-rust-1.65.diff
-  ];
-
   cargoLock = {
     lockFile = ./Cargo.lock;
     outputHashes = {
-      "confy-0.4.0" = "sha256-e91cvEixhpPzIthAxzTa3fDY6eCsHUy/eZQAqs7QTDo=";
-      "parity-tokio-ipc-0.7.3-1" = "sha256-eULJePtBu0iBI3It/bPH0h82Obsb1PJALgwYwrnCFYI=";
-      "rdev-0.5.0-2" = "sha256-7CEZ2wIM4QAPfY1tGKqXfHplTaxHnccVqFRPjY21Svo=";
-      "tokio-socks-0.5.1-1" = "sha256-45QQ6FrhGU9uEhbKXTKd/mY6MDumO6p46NmlakdyDQk=";
-      "libappindicator-0.6.1" = "sha256-JGnnZrcwbh8WJ6+/4bYhfD3HvgF2C7XaaGb6TaMRWdw=";
-      "magnum-opus-0.4.0" = "sha256-U5uuN4YolOYDnFNbtPpwYefcBDTUUyioui0UCcW8dyo=";
+      "confy-0.4.0-2" = "sha256-r5VeggXrIq5Cwxc2WSrxQDI5Gvbw979qIUQfMKHgBUI=";
+      "evdev-0.11.5" = "sha256-aoPmjGi/PftnH6ClEWXHvIj0X3oh15ZC1q7wPC1XPr0=";
+      "hwcodec-0.1.1" = "sha256-EQGJr5kH8O48y1oSrzFF3QGGpGFKP3v4gn2JquAkdlY=";
+      "impersonate_system-0.1.0" = "sha256-qbaTw9gxMKDjX5pKdUrKlmIxCxWwb99YuWPDvD2A3kY=";
+      "keepawake-0.4.3" = "sha256-sLQf9q88dB2bkTN01UlxRWSpoF1kFsqqpYC4Sw6cbEY=";
+      "machine-uid-0.3.0" = "sha256-rEOyNThg6p5oqE9URnxSkPtzyW8D4zKzLi9pAnzTElE=";
+      "magnum-opus-0.4.0" = "sha256-T4qaYOl8lCK1h9jWa9KqGvnVfDViT9Ob5R+YgnSw2tg=";
+      "mouce-0.2.1" = "sha256-3PtNEmVMXgqKV4r3KiKTkk4oyCt4BKynniJREE+RyFk=";
+      "pam-0.7.0" = "sha256-qe2GH6sfGEUnqLiQucYLB5rD/GyAaVtm9pAxWRb1H3Q=";
+      "parity-tokio-ipc-0.7.3-2" = "sha256-WXDKcDBaJuq4K9gjzOKMozePOFiVX0EqYAFamAz/Yvw=";
+      "rdev-0.5.0-2" = "sha256-Agxx/hoV45/NGsrUZLYdm1Y9088Z9urUcDnjVjY/odk=";
+      "reqwest-0.11.18" = "sha256-3k2wcVD+DzJEdP/+8BqP9qz3tgEWcbWZj5/CjrZz5LY=";
       "rust-pulsectl-0.2.12" = "sha256-8jXTspWvjONFcvw9/Z8C43g4BuGZ3rsG32tvLMQbtbM=";
-      "sciter-rs-0.5.57" = "sha256-ZZnZDhMjK0LjgmK0da1yvB0uoKueLhhhQtzmjoN+1R0=";
-      "systray-0.4.1" = "sha256-p1PMr/8oS6zHx4+Ng4zCqt0xZ57cq3wAu6/agyWq5Jw=";
+      "sciter-rs-0.5.57" = "sha256-NQPDlMQ0sGY8c9lBMlplT82sNjbgJy2m/+REnF3fz8M=";
+      "tao-0.22.2" = "sha256-vZx7WM6vK9UarbFQ/FMnTNEEDS+tglhWcPXt/h7YMFA=";
+      "tfc-0.6.1" = "sha256-ukxJl7Z+pUXCjvTsG5Q0RiXocPERWGsnAyh3SIWm0HU=";
+      "tokio-socks-0.5.1-2" = "sha256-x3aFJKo0XLaCGkZLtG9GYA+A/cGGedVZ8gOztWiYVUY=";
+      "tray-icon-0.5.1" = "sha256-1VyUg8V4omgdRIYyXhfn8kUvhV5ef6D2cr2Djz2uQyc=";
+      "x11-2.19.0" = "sha256-GDCeKzUtvaLeBDmPQdyr499EjEfT6y4diBMzZVEptzc=";
     };
   };
 
-  # Change magnus-opus version to upstream so that it does not use
-  # vcpkg for libopus since it does not work.
-  cargoPatches = [
-    ./cargo.patch
-  ];
-
-  # Manually simulate a vcpkg installation so that it can link the libraries
-  # properly.
-  postUnpack =
-    let
-      vcpkg_target = "x64-linux";
-
-      updates_vcpkg_file = writeText "update_vcpkg_rustdesk"
-        ''
-          Package : libyuv
-          Architecture : ${vcpkg_target}
-          Version : 1.0
-          Status : is installed
-
-          Package : libvpx
-          Architecture : ${vcpkg_target}
-          Version : 1.0
-          Status : is installed
-        '';
-    in
-    ''
-      export VCPKG_ROOT="$TMP/vcpkg";
-
-      mkdir -p $VCPKG_ROOT/.vcpkg-root
-      mkdir -p $VCPKG_ROOT/installed/${vcpkg_target}/lib
-      mkdir -p $VCPKG_ROOT/installed/vcpkg/updates
-      ln -s ${updates_vcpkg_file} $VCPKG_ROOT/installed/vcpkg/status
-      mkdir -p $VCPKG_ROOT/installed/vcpkg/info
-      touch $VCPKG_ROOT/installed/vcpkg/info/libyuv_1.0_${vcpkg_target}.list
-      touch $VCPKG_ROOT/installed/vcpkg/info/libvpx_1.0_${vcpkg_target}.list
-
-      ln -s ${libvpx.out}/lib/* $VCPKG_ROOT/installed/${vcpkg_target}/lib/
-      ln -s ${libyuv.out}/lib/* $VCPKG_ROOT/installed/${vcpkg_target}/lib/
-    '';
-
-  nativeBuildInputs = [ pkg-config cmake makeWrapper copyDesktopItems yasm nasm clang wrapGAppsHook rustPlatform.bindgenHook ];
-  buildInputs = [ alsa-lib pulseaudio libXfixes libxcb xdotool gtk3 libvpx libopus libXtst libyuv ];
-
-  # Checks require an active X display.
-  doCheck = false;
-
   desktopItems = [
     (makeDesktopItem {
       name = "rustdesk";
@@ -113,17 +80,60 @@ rustPlatform.buildRustPackage rec {
     })
   ];
 
-  postPatch = ''
-    rm Cargo.lock
-    ln -s ${./Cargo.lock} Cargo.lock
-  '';
+  nativeBuildInputs = [
+    pkg-config
+    rustPlatform.bindgenHook
+    wrapGAppsHook
+  ];
+
+  buildFeatures = lib.optionals stdenv.isLinux [ "linux-pkg-config" ];
+
+  # Checks require an active X server
+  doCheck = false;
+
+  buildInputs = [
+    atk
+    bzip2
+    cairo
+    dbus
+    gdk-pixbuf
+    glib
+    gst_all_1.gst-plugins-base
+    gst_all_1.gstreamer
+    gtk3
+    libgit2
+    libpulseaudio
+    libsodium
+    libXtst
+    libvpx
+    libyuv
+    libopus
+    libaom
+    libxkbcommon
+    xdotool
+    pam
+    pango
+    zlib
+    zstd
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.AppKit
+    darwin.apple_sdk.frameworks.CoreAudio
+    darwin.apple_sdk.frameworks.CoreFoundation
+    darwin.apple_sdk.frameworks.CoreGraphics
+    darwin.apple_sdk.frameworks.Foundation
+    darwin.apple_sdk.frameworks.IOKit
+    darwin.apple_sdk.frameworks.Security
+    darwin.apple_sdk.frameworks.SystemConfiguration
+  ] ++ lib.optionals stdenv.isLinux [
+    alsa-lib
+  ];
 
   # Add static ui resources and libsciter to same folder as binary so that it
   # can find them.
   postInstall = ''
     mkdir -p $out/{share/src,lib/rustdesk}
 
-    # so needs to be next to the executable
+    # .so needs to be next to the executable
     mv $out/bin/rustdesk $out/lib/rustdesk
     ln -s ${libsciter}/lib/libsciter-gtk.so $out/lib/rustdesk
 
@@ -132,15 +142,19 @@ rustPlatform.buildRustPackage rec {
 
     cp -a $src/src/ui $out/share/src
 
-    install -Dm0644 $src/logo.svg $out/share/icons/hicolor/scalable/apps/rustdesk.svg
+    install -Dm0644 $src/res/logo.svg $out/share/icons/hicolor/scalable/apps/rustdesk.svg
   '';
 
+  env = {
+    SODIUM_USE_PKG_CONFIG = true;
+    ZSTD_SYS_USE_PKG_CONFIG = true;
+  };
+
   meta = with lib; {
-    description = "Yet another remote desktop software";
+    description = "Virtual / remote desktop infrastructure for everyone! Open source TeamViewer / Citrix alternative";
     homepage = "https://rustdesk.com";
-    license = licenses.gpl3Only;
+    license = licenses.agpl3Only;
     maintainers = with maintainers; [ ocfox leixb ];
-    platforms = [ "x86_64-linux" ];
     mainProgram = "rustdesk";
   };
 }