From be3ee6f44071ebe7ed4b5027a816a1d731f61fd5 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Mon, 9 Jul 2018 00:03:41 +0800 Subject: [PATCH] anydesk: fix application shortcut --- .../networking/remote/anydesk/default.nix | 40 ++++++++++++++----- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/pkgs/applications/networking/remote/anydesk/default.nix b/pkgs/applications/networking/remote/anydesk/default.nix index a6858a7b5fdf..19e85a9711d1 100644 --- a/pkgs/applications/networking/remote/anydesk/default.nix +++ b/pkgs/applications/networking/remote/anydesk/default.nix @@ -1,5 +1,5 @@ -{ stdenv, fetchurl, makeWrapper -, cairo, gdk_pixbuf, glib, gnome2, gtk2, pango, xorg +{ stdenv, fetchurl, autoPatchelfHook, makeWrapper, makeDesktopItem +, atk, cairo, freetype, gdk_pixbuf, glib, gnome2, gtk2, libGLU_combined, pango, xorg , lsb-release }: let @@ -13,6 +13,18 @@ let "i686-linux" = "i686"; }."${stdenv.system}" or (throw "system ${stdenv.system} not supported"); + description = "Desktop sharing application, providing remote support and online meetings"; + + desktopItem = makeDesktopItem rec { + name = "anydesk"; + exec = "@out@/bin/anydesk"; + icon = "anydesk"; + desktopName = "anydesk"; + genericName = description; + categories = "Application;Network;"; + startupNotify = "false"; + }; + in stdenv.mkDerivation rec { name = "anydesk-${version}"; version = "2.9.4"; @@ -22,35 +34,43 @@ in stdenv.mkDerivation rec { inherit sha256; }; - libPath = stdenv.lib.makeLibraryPath ([ - cairo gdk_pixbuf glib gtk2 stdenv.cc.cc pango - gnome2.gtkglext + buildInputs = [ + atk cairo gdk_pixbuf glib gtk2 stdenv.cc.cc pango + gnome2.gtkglext libGLU_combined ] ++ (with xorg; [ - libxcb libX11 libXdamage libXext libXfixes libXi + libxcb libX11 libXdamage libXext libXfixes libXi libXmu libXrandr libXtst - ])); + ]); nativeBuildInputs = [ makeWrapper ]; installPhase = '' - mkdir -p $out/{bin,share/icons/hicolor,share/doc/anydesk} + runHook preInstall + + mkdir -p $out/bin $out/share/{applications,doc/anydesk,icons/hicolor} install -m755 anydesk $out/bin/anydesk cp changelog copyright README $out/share/doc/anydesk cp -r icons/* $out/share/icons/hicolor/ + cp ${desktopItem}/share/applications/*.desktop $out/share/applications + + runHook postInstall ''; postFixup = '' patchelf \ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ - --set-rpath "${libPath}" \ + --set-rpath "${stdenv.lib.makeLibraryPath buildInputs}" \ $out/bin/anydesk wrapProgram $out/bin/anydesk \ --prefix PATH : ${stdenv.lib.makeBinPath [ lsb-release ]} + + substituteInPlace $out/share/applications/*.desktop \ + --subst-var out ''; meta = with stdenv.lib; { - description = "Desktop sharing application, providing remote support and online meetings"; + inherit description; homepage = http://www.anydesk.com; license = licenses.unfree; platforms = platforms.linux;