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

75 lines
3.1 KiB
Nix
Raw Normal View History

2021-02-01 08:05:09 +00:00
{ mkDerivation, lib, fetchurl, autoPatchelfHook, makeWrapper, xdg-utils, dbus
2019-08-22 22:43:43 +01:00
, qtbase, qtwebkit, qtx11extras, qtquickcontrols, glibc
, libXrandr, libX11, libXext, libXdamage, libXtst, libSM, libXfixes
, wrapQtAppsHook
}:
mkDerivation rec {
pname = "teamviewer";
2021-03-09 23:05:55 +00:00
version = "15.15.5";
src = fetchurl {
url = "https://dl.tvcdn.de/download/linux/version_15x/teamviewer_${version}_amd64.deb";
2021-03-09 23:05:55 +00:00
sha256 = "sha256-H/CSc2RcjI+Fm8awYcXm3ioAJpbSNEMwGVrTozMux3A=";
};
unpackPhase = ''
ar x $src
tar xf data.tar.*
'';
nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapQtAppsHook ];
buildInputs = [ dbus qtbase qtwebkit qtx11extras libX11 ];
propagatedBuildInputs = [ qtquickcontrols ];
installPhase = ''
mkdir -p $out/share/teamviewer $out/bin $out/share/applications
cp -a opt/teamviewer/* $out/share/teamviewer
rm -R \
$out/share/teamviewer/logfiles \
$out/share/teamviewer/config \
$out/share/teamviewer/tv_bin/xdg-utils \
$out/share/teamviewer/tv_bin/script/{teamviewer_setup,teamviewerd.sysv,teamviewerd.service,teamviewerd.*.conf,libdepend,tv-delayed-start.sh}
ln -s $out/share/teamviewer/tv_bin/script/teamviewer $out/bin
ln -s $out/share/teamviewer/tv_bin/teamviewerd $out/bin
2016-12-17 18:04:48 +00:00
ln -s $out/share/teamviewer/tv_bin/desktop/com.teamviewer.*.desktop $out/share/applications
ln -s /var/lib/teamviewer $out/share/teamviewer/config
ln -s /var/log/teamviewer $out/share/teamviewer/logfiles
2021-02-01 08:05:09 +00:00
ln -s ${xdg-utils}/bin $out/share/teamviewer/tv_bin/xdg-utils
2021-01-04 21:22:53 +00:00
for i in 16 20 24 32 48 256; do
size=$i"x"$i
mkdir -p $out/share/icons/hicolor/$size/apps
ln -s $out/share/teamviewer/tv_bin/desktop/teamviewer_$i.png $out/share/icons/hicolor/$size/apps/TeamViewer.png
done;
sed -i "s,/opt/teamviewer,$out/share/teamviewer,g" $out/share/teamviewer/tv_bin/desktop/com.teamviewer.*.desktop
substituteInPlace $out/share/teamviewer/tv_bin/script/tvw_aux \
--replace '/lib64/ld-linux-x86-64.so.2' '${glibc.out}/lib/ld-linux-x86-64.so.2'
substituteInPlace $out/share/teamviewer/tv_bin/script/tvw_config \
--replace '/var/run/' '/run/'
2019-08-22 22:43:43 +01:00
wrapProgram $out/share/teamviewer/tv_bin/script/teamviewer --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libXrandr libX11 ]}"
wrapProgram $out/share/teamviewer/tv_bin/teamviewerd --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libXrandr libX11 ]}"
2019-08-22 22:43:43 +01:00
wrapProgram $out/share/teamviewer/tv_bin/TeamViewer --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libXrandr libX11 ]}"
wrapProgram $out/share/teamviewer/tv_bin/TeamViewer_Desktop --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [libXrandr libX11 libXext libXdamage libXtst libSM libXfixes ]}"
2021-01-05 03:20:47 +00:00
wrapQtApp $out/share/teamviewer/tv_bin/script/teamviewer
wrapQtApp $out/bin/teamviewer
'';
dontStrip = true;
preferLocalBuild = true;
meta = with lib; {
homepage = "http://www.teamviewer.com";
license = licenses.unfree;
description = "Desktop sharing application, providing remote support and online meetings";
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ jagajaga dasuxullebt ];
};
}