Merge pull request #328822 from khaneliman/rustdesk

rustdesk: fix build
This commit is contained in:
Marcus Ramberg 2024-07-21 23:55:52 +02:00 committed by GitHub
commit 6168e94f3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 97 additions and 82 deletions

View File

@ -1962,7 +1962,7 @@ dependencies = [
[[package]]
name = "evdev"
version = "0.11.5"
source = "git+https://github.com/fufesou/evdev#cec616e37790293d2cd2aa54a96601ed6b1b35a9"
source = "git+https://github.com/rustdesk-org/evdev#cec616e37790293d2cd2aa54a96601ed6b1b35a9"
dependencies = [
"bitvec",
"libc",
@ -3724,7 +3724,7 @@ dependencies = [
[[package]]
name = "mouce"
version = "0.2.1"
source = "git+https://github.com/fufesou/mouce.git#ed83800d532b95d70e39915314f6052aa433e9b9"
source = "git+https://github.com/rustdesk-org/mouce.git#ed83800d532b95d70e39915314f6052aa433e9b9"
dependencies = [
"glob",
]
@ -4192,7 +4192,7 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39"
[[package]]
name = "pam"
version = "0.7.0"
source = "git+https://github.com/fufesou/pam#10da2cbbabe32cbc9de22a66abe44738e7ec0ea0"
source = "git+https://github.com/rustdesk-org/pam#10da2cbbabe32cbc9de22a66abe44738e7ec0ea0"
dependencies = [
"libc",
"pam-macros",
@ -4881,7 +4881,7 @@ dependencies = [
[[package]]
name = "rdev"
version = "0.5.0-2"
source = "git+https://github.com/fufesou/rdev#2e8221d653f4995c831ad52966e79a514516b1fa"
source = "git+https://github.com/rustdesk-org/rdev#2e8221d653f4995c831ad52966e79a514516b1fa"
dependencies = [
"cocoa",
"core-foundation",
@ -6040,7 +6040,7 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d"
[[package]]
name = "tfc"
version = "0.6.1"
source = "git+https://github.com/fufesou/The-Fat-Controller#9dd86151525fd010dc93f6bc9b6aedd1a75cc342"
source = "git+https://github.com/rustdesk-org/The-Fat-Controller#9dd86151525fd010dc93f6bc9b6aedd1a75cc342"
dependencies = [
"anyhow",
"core-graphics",

View File

@ -1,37 +1,38 @@
{ 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
{
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,
}:
rustPlatform.buildRustPackage rec {
@ -70,6 +71,13 @@ rustPlatform.buildRustPackage rec {
};
};
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";
'';
desktopItems = [
(makeDesktopItem {
name = "rustdesk";
@ -95,42 +103,48 @@ rustPlatform.buildRustPackage rec {
# 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
];
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
];
# Add static ui resources and libsciter to same folder as binary so that it
# can find them.
@ -139,7 +153,7 @@ rustPlatform.buildRustPackage rec {
# .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
${lib.optionalString stdenv.isLinux "ln -s ${libsciter}/lib/libsciter-gtk.so $out/lib/rustdesk"}
makeWrapper $out/lib/rustdesk/rustdesk $out/bin/rustdesk \
--chdir "$out/share"
@ -149,7 +163,7 @@ rustPlatform.buildRustPackage rec {
install -Dm0644 $src/res/logo.svg $out/share/icons/hicolor/scalable/apps/rustdesk.svg
'';
postFixup = ''
postFixup = lib.optionalString stdenv.isLinux ''
patchelf --add-rpath "${libayatana-appindicator}/lib" "$out/lib/rustdesk/rustdesk"
'';
@ -158,11 +172,14 @@ rustPlatform.buildRustPackage rec {
ZSTD_SYS_USE_PKG_CONFIG = true;
};
meta = with lib; {
meta = {
description = "Virtual / remote desktop infrastructure for everyone! Open source TeamViewer / Citrix alternative";
homepage = "https://rustdesk.com";
license = licenses.agpl3Only;
maintainers = with maintainers; [ ocfox leixb ];
license = lib.licenses.agpl3Only;
maintainers = with lib.maintainers; [
ocfox
leixb
];
mainProgram = "rustdesk";
};
}

View File

@ -12443,8 +12443,6 @@ with pkgs;
inherit (darwin.apple_sdk.frameworks) Security;
};
rustdesk = callPackage ../applications/networking/remote/rustdesk { };
rustfilt = callPackage ../development/tools/rust/rustfilt { };
rustscan = callPackage ../tools/security/rustscan {