nixpkgs/pkgs/applications/networking/remote/anydesk/default.nix

80 lines
2.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, makeWrapper, makeDesktopItem
, atk, cairo, gdk_pixbuf, glib, gnome2, gtk2, libGLU_combined, pango, xorg
2017-07-13 06:59:23 +01:00
, lsb-release }:
let
sha256 = {
"x86_64-linux" = "0g19sac4j3m1nf400vn6qcww7prqg2p4k4zsj74i109kk1396aa2";
"i686-linux" = "1dd4ai2pclav9g872xil3x67bxy32gvz9pb3w76383pcsdh5zh45";
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
arch = {
"x86_64-linux" = "amd64";
"i686-linux" = "i686";
}."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
2018-07-08 17:03:41 +01:00
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";
};
2017-07-13 06:59:23 +01:00
in stdenv.mkDerivation rec {
name = "anydesk-${version}";
version = "2.9.4";
src = fetchurl {
url = "https://download.anydesk.com/linux/${name}-${arch}.tar.gz";
inherit sha256;
};
2018-07-08 17:03:41 +01:00
buildInputs = [
atk cairo gdk_pixbuf glib gtk2 stdenv.cc.cc pango
gnome2.gtkglext libGLU_combined
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
2017-07-13 06:59:23 +01:00
libXrandr libXtst
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
cp changelog copyright README $out/share/doc/anydesk
cp -r icons/* $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;
2017-07-13 06:59:23 +01:00
homepage = http://www.anydesk.com;
license = licenses.unfree;
platforms = platforms.linux;
maintainers = with maintainers; [ peterhoeg ];
};
}