Unverified Commit 9de3945f authored by Artturi's avatar Artturi Committed by GitHub
Browse files

Merge pull request #225266 from ocfox/rustdesk

parents c5b01a14 09462c7f
Loading
Loading
Loading
Loading
+5193 −0

File added.

Preview size limit exceeded, changes collapsed.

+0 −35
Original line number Diff line number Diff line
diff --git a/Cargo.lock b/Cargo.lock
index fb17c7e..ef157e5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2332,10 +2332,10 @@ dependencies = [
 [[package]]
 name = "magnum-opus"
 version = "0.4.0"
-source = "git+https://github.com/open-trade/magnum-opus#3c3d0b86ae95c84930bebffe4bcb03b3bd83342b"
+source = "git+https://github.com/TheRadioGuy/magnum-opus#171e1d021004626f7444d1e39b98f50bc3cb2604"
 dependencies = [
- "bindgen",
- "target_build_utils",
+ "libc",
+ "opusic-sys",
 ]
 
 [[package]]
@@ -2796,6 +2796,16 @@ version = "0.1.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
 
+[[package]]
+name = "opusic-sys"
+version = "0.3.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5eace752ce07a037241dba8f02c654799f051e431b27028056bcb480e83b54f5"
+dependencies = [
+ "cmake",
+ "libc",
+]
+
 [[package]]
 name = "os_str_bytes"
 version = "6.0.0"
diff --git a/Cargo.toml b/Cargo.toml
index 1b715bd..960e8da 100644
--- a/Cargo.toml
+62 −42
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, makeDesktopItem
, copyDesktopItems
@@ -8,7 +7,6 @@
, cmake
, yasm
, nasm
, zip
, pkg-config
, clang
, gtk3
@@ -43,10 +41,23 @@ rustPlatform.buildRustPackage rec {
    ./fix-for-rust-1.65.diff
  ];

  cargoSha256 = "sha256-1OMWEk+DerltF7kwdo4d04rbgIFLHBRq3vZaL7jtrdE=";

  LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";

  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=";
      "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=";
    };
  };

  # Change magnus-opus version to upstream so that it does not use
  # vcpkg for libopus since it does not work.
  cargoPatches = [
@@ -55,7 +66,8 @@ rustPlatform.buildRustPackage rec {

  # Manually simulate a vcpkg installation so that it can link the libaries
  # properly.
  postUnpack = let
  postUnpack =
    let
      vcpkg_target = "x64-linux";

      updates_vcpkg_file = writeText "update_vcpkg_rustdesk"
@@ -70,7 +82,8 @@ rustPlatform.buildRustPackage rec {
          Version : 1.0
          Status : is installed
        '';
  in ''
    in
    ''
      export VCPKG_ROOT="$TMP/vcpkg";

      mkdir -p $VCPKG_ROOT/.vcpkg-root
@@ -91,7 +104,8 @@ rustPlatform.buildRustPackage rec {
  # Checks require an active X display.
  doCheck = false;

  desktopItems = [ (makeDesktopItem {
  desktopItems = [
    (makeDesktopItem {
      name = "rustdesk";
      exec = meta.mainProgram;
      icon = "rustdesk";
@@ -99,7 +113,13 @@ rustPlatform.buildRustPackage rec {
      comment = meta.description;
      genericName = "Remote Desktop";
      categories = [ "Network" ];
  }) ];
    })
  ];

  postPatch = ''
    rm Cargo.lock
    ln -s ${./Cargo.lock} Cargo.lock
  '';

  # Add static ui resources and libsciter to same folder as binary so that it
  # can find them.
@@ -122,7 +142,7 @@ rustPlatform.buildRustPackage rec {
    description = "Yet another remote desktop software";
    homepage = "https://rustdesk.com";
    license = licenses.gpl3Only;
    maintainers = with maintainers; [ leixb ];
    maintainers = with maintainers; [ ocfox leixb ];
    platforms = [ "x86_64-linux" ];
    mainProgram = "rustdesk";
  };