2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
rustPlatform,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pkg-config,
|
|
|
|
wrapGAppsHook3,
|
|
|
|
atk,
|
|
|
|
bzip2,
|
|
|
|
cairo,
|
|
|
|
dbus,
|
|
|
|
gdk-pixbuf,
|
|
|
|
glib,
|
|
|
|
gst_all_1,
|
|
|
|
gtk3,
|
|
|
|
libayatana-appindicator,
|
|
|
|
libgit2,
|
|
|
|
libpulseaudio,
|
|
|
|
libsodium,
|
|
|
|
libXtst,
|
|
|
|
libvpx,
|
|
|
|
libyuv,
|
|
|
|
libopus,
|
|
|
|
libaom,
|
|
|
|
libxkbcommon,
|
|
|
|
libsciter,
|
|
|
|
xdotool,
|
|
|
|
pam,
|
|
|
|
pango,
|
|
|
|
zlib,
|
|
|
|
zstd,
|
|
|
|
stdenv,
|
|
|
|
darwin,
|
|
|
|
alsa-lib,
|
|
|
|
makeDesktopItem,
|
|
|
|
copyDesktopItems,
|
2022-03-10 19:12:11 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rustdesk";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "1.2.3";
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rustdesk";
|
|
|
|
repo = "rustdesk";
|
2022-07-14 12:49:19 +00:00
|
|
|
rev = version;
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-6TdirqEnWvuPgKOLzNIAm66EgKNdGVjD7vf2maqlxI8=";
|
2022-03-10 19:12:11 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
2023-10-09 19:29:22 +00:00
|
|
|
"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=";
|
2024-01-13 08:15:51 +00:00
|
|
|
"rdev-0.5.0-2" = "sha256-MJ4Uqp0yz1CcFvoZYyUYwNojUcfW1AyVowKShihhhbY=";
|
2023-10-09 19:29:22 +00:00
|
|
|
"reqwest-0.11.18" = "sha256-3k2wcVD+DzJEdP/+8BqP9qz3tgEWcbWZj5/CjrZz5LY=";
|
2023-04-12 12:48:02 +00:00
|
|
|
"rust-pulsectl-0.2.12" = "sha256-8jXTspWvjONFcvw9/Z8C43g4BuGZ3rsG32tvLMQbtbM=";
|
2023-10-09 19:29:22 +00:00
|
|
|
"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=";
|
2023-04-12 12:48:02 +00:00
|
|
|
};
|
|
|
|
};
|
2022-03-10 19:12:11 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
prePatch = ''
|
|
|
|
# Patch 404 repos
|
|
|
|
substituteInPlace Cargo.lock --replace-fail "fufesou" "rustdesk-org";
|
|
|
|
substituteInPlace Cargo.toml --replace-fail "fufesou" "rustdesk-org";
|
|
|
|
substituteInPlace libs/enigo/Cargo.toml --replace-fail "fufesou" "rustdesk-org";
|
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
desktopItems = [
|
|
|
|
(makeDesktopItem {
|
|
|
|
name = "rustdesk";
|
|
|
|
exec = meta.mainProgram;
|
|
|
|
icon = "rustdesk";
|
|
|
|
desktopName = "RustDesk";
|
|
|
|
comment = meta.description;
|
|
|
|
genericName = "Remote Desktop";
|
|
|
|
categories = [ "Network" ];
|
2024-02-07 01:22:34 +00:00
|
|
|
mimeTypes = [ "x-scheme-handler/rustdesk" ];
|
2023-04-12 12:48:02 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [
|
2024-05-15 15:35:15 +00:00
|
|
|
copyDesktopItems
|
2023-10-09 19:29:22 +00:00
|
|
|
pkg-config
|
|
|
|
rustPlatform.bindgenHook
|
2024-05-15 15:35:15 +00:00
|
|
|
wrapGAppsHook3
|
2023-10-09 19:29:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildFeatures = lib.optionals stdenv.isLinux [ "linux-pkg-config" ];
|
|
|
|
|
|
|
|
# Checks require an active X server
|
|
|
|
doCheck = false;
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
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
|
|
|
|
pam
|
|
|
|
pango
|
|
|
|
zlib
|
|
|
|
zstd
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin (
|
|
|
|
with darwin.apple_sdk.frameworks;
|
|
|
|
[
|
|
|
|
AppKit
|
|
|
|
CoreAudio
|
|
|
|
CoreFoundation
|
|
|
|
CoreGraphics
|
|
|
|
Foundation
|
|
|
|
IOKit
|
|
|
|
Security
|
|
|
|
SystemConfiguration
|
|
|
|
]
|
|
|
|
)
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
alsa-lib
|
|
|
|
xdotool
|
|
|
|
];
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
# 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}
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# .so needs to be next to the executable
|
2022-03-10 19:12:11 +00:00
|
|
|
mv $out/bin/rustdesk $out/lib/rustdesk
|
2024-07-27 06:49:29 +00:00
|
|
|
${lib.optionalString stdenv.isLinux "ln -s ${libsciter}/lib/libsciter-gtk.so $out/lib/rustdesk"}
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
makeWrapper $out/lib/rustdesk/rustdesk $out/bin/rustdesk \
|
2022-04-27 09:35:20 +00:00
|
|
|
--chdir "$out/share"
|
2022-03-10 19:12:11 +00:00
|
|
|
|
|
|
|
cp -a $src/src/ui $out/share/src
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
install -Dm0644 $src/res/logo.svg $out/share/icons/hicolor/scalable/apps/rustdesk.svg
|
2022-03-10 19:12:11 +00:00
|
|
|
'';
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
2024-01-02 11:29:13 +00:00
|
|
|
patchelf --add-rpath "${libayatana-appindicator}/lib" "$out/lib/rustdesk/rustdesk"
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
env = {
|
|
|
|
SODIUM_USE_PKG_CONFIG = true;
|
|
|
|
ZSTD_SYS_USE_PKG_CONFIG = true;
|
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
meta = {
|
2023-10-09 19:29:22 +00:00
|
|
|
description = "Virtual / remote desktop infrastructure for everyone! Open source TeamViewer / Citrix alternative";
|
2022-03-10 19:12:11 +00:00
|
|
|
homepage = "https://rustdesk.com";
|
2024-07-27 06:49:29 +00:00
|
|
|
license = lib.licenses.agpl3Only;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
ocfox
|
|
|
|
leixb
|
|
|
|
];
|
2022-03-10 19:12:11 +00:00
|
|
|
mainProgram = "rustdesk";
|
|
|
|
};
|
|
|
|
}
|