You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

default.nix 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. { stdenv, fetchurl, makeWrapper, makeDesktopItem
  2. , atk, cairo, gdk-pixbuf, glib, gnome2, gtk2, libGLU_combined, pango, xorg
  3. , lsb-release, freetype, fontconfig, pangox_compat, polkit, polkit_gnome }:
  4. let
  5. sha256 = {
  6. x86_64-linux = "0mixw2sk7li1hjagibwzdgbfnrih5acricczqmfks1gsinjqrn82";
  7. i386-linux = "1gshd4vm8ysn636r1z44vmzdzrgybsmj8ma4zdabvs9jsbm2da3c";
  8. }.${stdenv.hostPlatform.system} or (throw "system ${stdenv.hostPlatform.system} not supported");
  9. arch = {
  10. x86_64-linux = "amd64";
  11. i386-linux = "i386";
  12. }.${stdenv.hostPlatform.system} or (throw "system ${stdenv.hostPlatform.system} not supported");
  13. description = "Desktop sharing application, providing remote support and online meetings";
  14. desktopItem = makeDesktopItem {
  15. name = "AnyDesk";
  16. exec = "@out@/bin/anydesk";
  17. icon = "anydesk";
  18. desktopName = "AnyDesk";
  19. genericName = description;
  20. categories = "Application;Network;";
  21. startupNotify = "false";
  22. };
  23. in stdenv.mkDerivation rec {
  24. pname = "anydesk";
  25. version = "5.1.2";
  26. src = fetchurl {
  27. url = "https://download.anydesk.com/linux/${pname}-${version}-${arch}.tar.gz";
  28. inherit sha256;
  29. };
  30. buildInputs = [
  31. atk cairo gdk-pixbuf glib gtk2 stdenv.cc.cc pango
  32. gnome2.gtkglext libGLU_combined freetype fontconfig
  33. pangox_compat polkit polkit_gnome
  34. ] ++ (with xorg; [
  35. libxcb libX11 libXdamage libXext libXfixes libXi libXmu
  36. libXrandr libXtst libXt libICE libSM libXrender
  37. ]);
  38. nativeBuildInputs = [ makeWrapper ];
  39. installPhase = ''
  40. runHook preInstall
  41. mkdir -p $out/bin $out/share/{applications,doc/anydesk,icons/hicolor}
  42. install -m755 anydesk $out/bin/anydesk
  43. cp copyright README $out/share/doc/anydesk
  44. cp -r icons/* $out/share/icons/hicolor/
  45. cp ${desktopItem}/share/applications/*.desktop $out/share/applications
  46. runHook postInstall
  47. '';
  48. postFixup = ''
  49. patchelf \
  50. --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
  51. --set-rpath "${stdenv.lib.makeLibraryPath buildInputs}" \
  52. $out/bin/anydesk
  53. wrapProgram $out/bin/anydesk \
  54. --prefix PATH : ${stdenv.lib.makeBinPath [ lsb-release ]}
  55. substituteInPlace $out/share/applications/*.desktop \
  56. --subst-var out
  57. '';
  58. meta = with stdenv.lib; {
  59. inherit description;
  60. homepage = https://www.anydesk.com;
  61. license = licenses.unfree;
  62. platforms = platforms.linux;
  63. maintainers = with maintainers; [ shyim ];
  64. };
  65. }