toxic: 0.15.1 -> 0.16.0
[NixPkgs.git] / pkgs / by-name / ru / rustdesk / package.nix
bloba1f5b24910209d902f153b717abbb8b9f8a4365a
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   pkg-config,
6   wrapGAppsHook3,
7   atk,
8   bzip2,
9   cairo,
10   dbus,
11   gdk-pixbuf,
12   glib,
13   gst_all_1,
14   gtk3,
15   libayatana-appindicator,
16   libgit2,
17   libpulseaudio,
18   libsodium,
19   libXtst,
20   libvpx,
21   libyuv,
22   libopus,
23   libaom,
24   libxkbcommon,
25   libsciter,
26   xdotool,
27   pam,
28   pango,
29   zlib,
30   zstd,
31   stdenv,
32   darwin,
33   alsa-lib,
34   makeDesktopItem,
35   copyDesktopItems,
38 rustPlatform.buildRustPackage rec {
39   pname = "rustdesk";
40   version = "1.3.1";
42   src = fetchFromGitHub {
43     owner = "rustdesk";
44     repo = "rustdesk";
45     rev = version;
46     hash = "sha256-PioaSdvgJ9oXC5DAbl+em7rxcGx1om9+sjCMdrvox90=";
47   };
49   cargoLock = {
50     lockFile = ./Cargo.lock;
51     outputHashes = {
52       "android-wakelock-0.1.0" = "sha256-09EH/U1BBs3l4galQOrTKmPUYBgryUjfc/rqPZhdYc4=";
53       "arboard-3.4.0" = "sha256-xuMfMakHVj/zjiUr6PVFy+aNQxwsXtAAFlTYxUt12fU=";
54       "cacao-0.4.0-beta2" = "sha256-U5tCLeVxjmZCm7ti1u71+i116xmozPaR69pCsA4pxrM=";
55       "clipboard-master-4.0.0-beta.6" = "sha256-GZyzGMQOZ0iwGNZa/ZzFp8gU2tQVWZBpAbim8yb6yZA=";
56       "confy-0.4.0-2" = "sha256-V7BCKISrkJIxWC3WT5+B5Vav86YTQvdO9TO6A++47FU=";
57       "core-foundation-0.9.3" = "sha256-iB4OVmWZhuWbs9RFWvNc+RNut6rip2/50o5ZM6c0c3g=";
58       "evdev-0.11.5" = "sha256-aoPmjGi/PftnH6ClEWXHvIj0X3oh15ZC1q7wPC1XPr0=";
59       "hwcodec-0.7.0" = "sha256-SswZI2BJ4pRXT379cziJlisPsc5sOiOiDqJ5WaPETnA=";
60       "impersonate_system-0.1.0" = "sha256-pIV7s2qGoCIUrhaRovBDCJaGQ/pMdJacDXJmeBpkcyI=";
61       "keepawake-0.4.3" = "sha256-cqSpkq/PCz+5+ZUyPy5hF6rP3fBzuZDywyxMUQ50Rk4=";
62       "machine-uid-0.3.0" = "sha256-rEOyNThg6p5oqE9URnxSkPtzyW8D4zKzLi9pAnzTElE=";
63       "magnum-opus-0.4.0" = "sha256-T4qaYOl8lCK1h9jWa9KqGvnVfDViT9Ob5R+YgnSw2tg=";
64       "pam-0.7.0" = "sha256-o47tVoFlW9RiL7O8Lvuwz7rMYQHO+5TG27XxkAdHEOE=";
65       "pam-sys-1.0.0-alpha4" = "sha256-5HIErVWnanLo5054NgU+DEKC2wwyiJ8AHvbx0BGbyWo=";
66       "parity-tokio-ipc-0.7.3-4" = "sha256-PKw2Twd2ap+tRrQxqg8T1FvpoeKn0hvBqn1Z44F1LcY=";
67       "rdev-0.5.0-2" = "sha256-G+PvnA5mZyN080uoI5CGj/dQ9B1J4h5iYd7214MKBR8=";
68       "reqwest-0.11.23" = "sha256-kEUT+gs4ziknDiGdPMLnj5pmxC5SBpLopZ8jZ34GDWc=";
69       "rust-pulsectl-0.2.12" = "sha256-8jXTspWvjONFcvw9/Z8C43g4BuGZ3rsG32tvLMQbtbM=";
70       "sciter-rs-0.5.57" = "sha256-5Nd9npdx8yQJEczHv7WmSmrE1lBfvp5z7BubTbYBg3E=";
71       "sysinfo-0.29.10" = "sha256-/UsFAvlWs/F7X1xT+97Fx+pnpCguoPHU3hTynqYMEs4=";
72       "tao-0.25.0" = "sha256-kLmx1z9Ybn/hDt2OcszEjtZytQIE+NKTIn9zNr9oEQk=";
73       "tfc-0.7.0" = "sha256-4plK8ttbHsBPat3/rS+4RhGzirq2Ked2wrU8cQEU1zo=";
74       "tokio-socks-0.5.2-1" = "sha256-i1dfNatqN4dinMcyAdLhj9hJWVsT10OWpCXsxl7pifI=";
75       "tray-icon-0.14.3" = "sha256-dSX7LucZaLplRrh6zLwmFzyZN4ZtwIXzAEdZzlu3gQg=";
76       "wallpaper-3.2.0" = "sha256-p9NRmusdA0wvF6onp1UTL0/4t7XnEAc19sqyGDnfg/Q=";
77       "webm-1.1.0" = "sha256-p4BMej7yvb8c/dJynRWZmwo2hxAAY96Qx6Qx2DbT8hE=";
78       "x11-2.19.0" = "sha256-GDCeKzUtvaLeBDmPQdyr499EjEfT6y4diBMzZVEptzc=";
79       "x11-clipboard-0.8.1" = "sha256-PtqmSD2MwkbLVWbfTSXZW3WEvEnUlo04qieUTjN2whE=";
80     };
81   };
83   postPatch = ''
84     # Overwrite cargo.lock because the one in the upstream repo has duplicates entries.
85     # It should probably be removed in the next rustdesk update (if they fix their cargoLock)
86     cp ${./Cargo.lock} Cargo.lock
87   '';
89   desktopItems = [
90     (makeDesktopItem {
91       name = "rustdesk";
92       exec = meta.mainProgram;
93       icon = "rustdesk";
94       desktopName = "RustDesk";
95       comment = meta.description;
96       genericName = "Remote Desktop";
97       categories = [ "Network" ];
98       mimeTypes = [ "x-scheme-handler/rustdesk" ];
99     })
100   ];
102   nativeBuildInputs = [
103     copyDesktopItems
104     pkg-config
105     rustPlatform.bindgenHook
106     wrapGAppsHook3
107   ];
109   buildFeatures = lib.optionals stdenv.hostPlatform.isLinux [ "linux-pkg-config" ];
111   # Checks require an active X server
112   doCheck = false;
114   buildInputs =
115     [
116       atk
117       bzip2
118       cairo
119       dbus
120       gdk-pixbuf
121       glib
122       gst_all_1.gst-plugins-base
123       gst_all_1.gstreamer
124       gtk3
125       libgit2
126       libpulseaudio
127       libsodium
128       libXtst
129       libvpx
130       libyuv
131       libopus
132       libaom
133       libxkbcommon
134       pam
135       pango
136       zlib
137       zstd
138     ]
139     ++ lib.optionals stdenv.hostPlatform.isDarwin (
140       with darwin.apple_sdk.frameworks;
141       [
142         AppKit
143         CoreAudio
144         CoreFoundation
145         CoreGraphics
146         Foundation
147         IOKit
148         Security
149         SystemConfiguration
150       ]
151     )
152     ++ lib.optionals stdenv.hostPlatform.isLinux [
153       alsa-lib
154       xdotool
155     ];
157   # Add static ui resources and libsciter to same folder as binary so that it
158   # can find them.
159   postInstall = ''
160     mkdir -p $out/{share/src,lib/rustdesk}
162     # .so needs to be next to the executable
163     mv $out/bin/rustdesk $out/lib/rustdesk
164     ${lib.optionalString stdenv.hostPlatform.isLinux "ln -s ${libsciter}/lib/libsciter-gtk.so $out/lib/rustdesk"}
166     makeWrapper $out/lib/rustdesk/rustdesk $out/bin/rustdesk \
167       --chdir "$out/share"
169     cp -a $src/src/ui $out/share/src
171     install -Dm0644 $src/res/logo.svg $out/share/icons/hicolor/scalable/apps/rustdesk.svg
172   '';
174   postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
175     patchelf --add-rpath "${libayatana-appindicator}/lib" "$out/lib/rustdesk/rustdesk"
176   '';
178   env = {
179     SODIUM_USE_PKG_CONFIG = true;
180     ZSTD_SYS_USE_PKG_CONFIG = true;
181   };
183   meta = {
184     description = "Virtual / remote desktop infrastructure for everyone! Open source TeamViewer / Citrix alternative";
185     homepage = "https://rustdesk.com";
186     license = lib.licenses.agpl3Only;
187     maintainers = with lib.maintainers; [
188       ocfox
189       leixb
190     ];
191     mainProgram = "rustdesk";
192     badPlatforms = lib.platforms.darwin;
193   };