about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorPeter Hoeg <peter@hoeg.com>2018-07-09 21:51:57 +0800
committerGitHub <noreply@github.com>2018-07-09 21:51:57 +0800
commitb4bc6a639925e2b8380c69e61e7ea6ad5cf9441e (patch)
tree9eaaf185979762a3b4cccc2c7b1606638cc224f9 /pkgs/applications
parentf759a0d0a65cb9a66107ab8d10a90e66355ccae0 (diff)
parentbe3ee6f44071ebe7ed4b5027a816a1d731f61fd5 (diff)
downloadnixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.tar
nixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.tar.gz
nixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.tar.bz2
nixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.tar.lz
nixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.tar.xz
nixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.tar.zst
nixlib-b4bc6a639925e2b8380c69e61e7ea6ad5cf9441e.zip
Merge pull request #43225 from peterhoeg/f/anydesk
anydesk: fix application shortcut
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/remote/anydesk/default.nix40
1 files 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;