Unverified Commit a0a0b4d6 authored by Bot_wxt1221's avatar Bot_wxt1221 Committed by GitHub
Browse files

rustdesk-flutter: add missing libayatana-appindicator patch (#343742)

* rustdesk-flutter: nixfmt

* rustdesk-flutter: add missing libayatana-appindicator patch
parent eaed8726
Loading
Loading
Loading
Loading
+74 −57
Original line number Diff line number Diff line
{ lib
, clangStdenv
, cargo
, copyDesktopItems
, fetchFromGitHub
, flutter316
, ffmpeg
, gst_all_1
, fuse3
, libXtst
, libaom
, libopus
, libpulseaudio
, libva
, libvdpau
, libvpx
, libxkbcommon
, libyuv
, pam
, makeDesktopItem
, rustPlatform
, rustc
, rustfmt
, xdotool
}: let
{
  lib,
  clangStdenv,
  cargo,
  copyDesktopItems,
  fetchFromGitHub,
  flutter316,
  ffmpeg,
  gst_all_1,
  fuse3,
  libXtst,
  libaom,
  libopus,
  libpulseaudio,
  libva,
  libvdpau,
  libvpx,
  libxkbcommon,
  libyuv,
  pam,
  makeDesktopItem,
  rustPlatform,
  libayatana-appindicator,
  rustc,
  rustfmt,
  xdotool,
}:
let

  flutterRustBridge = rustPlatform.buildRustPackage rec {
    pname = "flutter_rust_bridge_codegen";
@@ -36,13 +39,17 @@
    };

    cargoHash = "sha256-dDyiptG9TKes+fXx2atwx697SWH7Rltx6xVubtTn7FM=";
    cargoBuildFlags = [ "--package" "flutter_rust_bridge_codegen" ];
    cargoBuildFlags = [
      "--package"
      "flutter_rust_bridge_codegen"
    ];
    doCheck = false;
  };

  sharedLibraryExt = rustc.stdenv.hostPlatform.extensions.sharedLibrary;

in flutter316.buildFlutterApplication rec {
in
flutter316.buildFlutterApplication rec {
  pname = "rustdesk";
  version = "1.3.0";
  src = fetchFromGitHub {
@@ -147,11 +154,17 @@ in flutter316.buildFlutterApplication rec {
  prePatch = ''
    chmod -R +w ..
  '';
  patchFlags = [ "-p1" "-d" ".." ];
  patchFlags = [
    "-p1"
    "-d"
    ".."
  ];

  patches = [ ./make-build-reproducible.patch ];

  postPatch = ''
    substituteInPlace $cargoDepsCopy/libappindicator-sys-*/src/lib.rs \
      --replace-fail "libayatana-appindicator3.so.1" "${lib.getLib libayatana-appindicator}/lib/libayatana-appindicator3.so.1"
    substituteInPlace ../Cargo.toml --replace-fail ", \"staticlib\", \"rlib\"" ""
    # The supplied Cargo.lock doesn't work with our fetcher so copy over the fixed version
    cp ${./Cargo.lock} ../Cargo.lock
@@ -201,7 +214,11 @@ in flutter316.buildFlutterApplication rec {
      terminal = false;
      type = "Application";
      startupNotify = true;
      categories = [ "Network" "RemoteAccess" "GTK" ];
      categories = [
        "Network"
        "RemoteAccess"
        "GTK"
      ];
      keywords = [ "internet" ];
      actions.new-window = {
        name = "Open a New Window";