3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/applications/networking/remote/anydesk/default.nix

82 lines
2.4 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper, makeDesktopItem
2019-05-22 12:03:39 +01:00
, atk, cairo, gdk-pixbuf, glib, gnome2, gtk2, libGLU_combined, pango, xorg
, lsb-release, freetype, fontconfig, pangox_compat, polkit, polkit_gnome
, pulseaudio }:
2017-07-13 06:59:23 +01:00
let
sha256 = {
2019-10-01 16:27:17 +01:00
x86_64-linux = "0mixw2sk7li1hjagibwzdgbfnrih5acricczqmfks1gsinjqrn82";
i386-linux = "1gshd4vm8ysn636r1z44vmzdzrgybsmj8ma4zdabvs9jsbm2da3c";
2019-08-13 22:52:01 +01:00
}.${stdenv.hostPlatform.system} or (throw "system ${stdenv.hostPlatform.system} not supported");
2017-07-13 06:59:23 +01:00
arch = {
2019-08-13 22:52:01 +01:00
x86_64-linux = "amd64";
2019-10-01 16:27:17 +01:00
i386-linux = "i386";
2019-08-13 22:52:01 +01:00
}.${stdenv.hostPlatform.system} or (throw "system ${stdenv.hostPlatform.system} not supported");
2017-07-13 06:59:23 +01:00
2018-07-08 17:03:41 +01:00
description = "Desktop sharing application, providing remote support and online meetings";
2019-08-13 22:52:01 +01:00
desktopItem = makeDesktopItem {
2019-10-01 16:27:17 +01:00
name = "AnyDesk";
2018-07-08 17:03:41 +01:00
exec = "@out@/bin/anydesk";
icon = "anydesk";
2019-10-01 16:27:17 +01:00
desktopName = "AnyDesk";
2018-07-08 17:03:41 +01:00
genericName = description;
categories = "Application;Network;";
startupNotify = "false";
};
2017-07-13 06:59:23 +01:00
in stdenv.mkDerivation rec {
pname = "anydesk";
2019-10-01 16:27:17 +01:00
version = "5.1.2";
2017-07-13 06:59:23 +01:00
src = fetchurl {
url = "https://download.anydesk.com/linux/${pname}-${version}-${arch}.tar.gz";
2017-07-13 06:59:23 +01:00
inherit sha256;
};
2018-07-08 17:03:41 +01:00
buildInputs = [
2019-05-22 12:03:39 +01:00
atk cairo gdk-pixbuf glib gtk2 stdenv.cc.cc pango
2018-12-27 22:31:09 +00:00
gnome2.gtkglext libGLU_combined freetype fontconfig
pangox_compat polkit polkit_gnome pulseaudio
2017-07-13 06:59:23 +01:00
] ++ (with xorg; [
2018-07-08 17:03:41 +01:00
libxcb libX11 libXdamage libXext libXfixes libXi libXmu
2019-10-01 16:27:17 +01:00
libXrandr libXtst libXt libICE libSM libXrender
2018-07-08 17:03:41 +01:00
]);
2017-07-13 06:59:23 +01:00
nativeBuildInputs = [ makeWrapper ];
installPhase = ''
2018-07-08 17:03:41 +01:00
runHook preInstall
mkdir -p $out/bin $out/share/{applications,doc/anydesk,icons/hicolor}
2017-07-13 06:59:23 +01:00
install -m755 anydesk $out/bin/anydesk
2019-10-01 16:27:17 +01:00
cp copyright README $out/share/doc/anydesk
2019-10-17 22:33:43 +01:00
cp -r icons/hicolor/* $out/share/icons/hicolor/
2018-07-08 17:03:41 +01:00
cp ${desktopItem}/share/applications/*.desktop $out/share/applications
runHook postInstall
2017-07-13 06:59:23 +01:00
'';
postFixup = ''
patchelf \
--set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
2018-07-08 17:03:41 +01:00
--set-rpath "${stdenv.lib.makeLibraryPath buildInputs}" \
2017-07-13 06:59:23 +01:00
$out/bin/anydesk
wrapProgram $out/bin/anydesk \
--prefix PATH : ${stdenv.lib.makeBinPath [ lsb-release ]}
2018-07-08 17:03:41 +01:00
substituteInPlace $out/share/applications/*.desktop \
--subst-var out
2017-07-13 06:59:23 +01:00
'';
meta = with stdenv.lib; {
2018-07-08 17:03:41 +01:00
inherit description;
2019-04-10 14:30:33 +01:00
homepage = https://www.anydesk.com;
2017-07-13 06:59:23 +01:00
license = licenses.unfree;
platforms = platforms.linux;
2019-10-01 16:27:17 +01:00
maintainers = with maintainers; [ shyim ];
2017-07-13 06:59:23 +01:00
};
}