2021-02-01 08:05:09 +00:00
|
|
|
{ mkDerivation, lib, fetchurl, autoPatchelfHook, makeWrapper, xdg-utils, dbus
|
2021-10-01 00:30:10 +01:00
|
|
|
, qtbase, qtwebkit, qtwebengine, qtx11extras, qtquickcontrols, getconf, glibc
|
2021-10-12 15:51:50 +01:00
|
|
|
, libXrandr, libX11, libXext, libXdamage, libXtst, libSM, libXfixes, coreutils
|
2019-08-22 12:17:29 +01:00
|
|
|
, wrapQtAppsHook
|
|
|
|
}:
|
2015-12-03 14:56:21 +00:00
|
|
|
|
2019-08-22 12:17:29 +01:00
|
|
|
mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "teamviewer";
|
2021-10-12 16:08:34 +01:00
|
|
|
version = "15.22.3";
|
2016-06-03 21:45:26 +01:00
|
|
|
|
2015-12-03 14:56:21 +00:00
|
|
|
src = fetchurl {
|
2019-12-20 22:39:11 +00:00
|
|
|
url = "https://dl.tvcdn.de/download/linux/version_15x/teamviewer_${version}_amd64.deb";
|
2021-10-12 16:08:34 +01:00
|
|
|
sha256 = "15fvzhdq7mnx2l2w4byvij8ww16qwdlkbadal60rm66yzv79mv9w";
|
2015-12-03 14:56:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
unpackPhase = ''
|
|
|
|
ar x $src
|
|
|
|
tar xf data.tar.*
|
|
|
|
'';
|
|
|
|
|
2019-08-22 12:17:29 +01:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapQtAppsHook ];
|
2021-10-01 00:30:10 +01:00
|
|
|
buildInputs = [ dbus getconf qtbase qtwebkit qtwebengine qtx11extras libX11 ];
|
2018-04-26 13:04:13 +01:00
|
|
|
propagatedBuildInputs = [ qtquickcontrols ];
|
|
|
|
|
2015-12-03 14:56:21 +00:00
|
|
|
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 \
|
2021-10-12 16:08:34 +01:00
|
|
|
$out/share/teamviewer/tv_bin/RTlib \
|
2017-04-13 00:14:03 +01:00
|
|
|
$out/share/teamviewer/tv_bin/xdg-utils \
|
2015-12-03 14:56:21 +00:00
|
|
|
$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
|
2015-12-03 14:56:21 +00:00
|
|
|
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
|
2015-12-03 14:56:21 +00:00
|
|
|
|
2021-09-30 20:19:50 +01:00
|
|
|
declare in_script_dir="./opt/teamviewer/tv_bin/script"
|
|
|
|
|
|
|
|
install -d "$out/share/dbus-1/services"
|
|
|
|
install -m 644 "$in_script_dir/com.teamviewer.TeamViewer.service" "$out/share/dbus-1/services"
|
|
|
|
substituteInPlace "$out/share/dbus-1/services/com.teamviewer.TeamViewer.service" \
|
|
|
|
--replace '/opt/teamviewer/tv_bin/TeamViewer' \
|
|
|
|
"$out/share/teamviewer/tv_bin/TeamViewer"
|
|
|
|
install -m 644 "$in_script_dir/com.teamviewer.TeamViewer.Desktop.service" "$out/share/dbus-1/services"
|
|
|
|
substituteInPlace "$out/share/dbus-1/services/com.teamviewer.TeamViewer.Desktop.service" \
|
|
|
|
--replace '/opt/teamviewer/tv_bin/TeamViewer_Desktop' \
|
|
|
|
"$out/share/teamviewer/tv_bin/TeamViewer_Desktop"
|
|
|
|
|
|
|
|
install -d "$out/share/dbus-1/system.d"
|
|
|
|
install -m 644 "$in_script_dir/com.teamviewer.TeamViewer.Daemon.conf" "$out/share/dbus-1/system.d"
|
|
|
|
|
|
|
|
install -d "$out/share/polkit-1/actions"
|
|
|
|
install -m 644 "$in_script_dir/com.teamviewer.TeamViewer.policy" "$out/share/polkit-1/actions"
|
|
|
|
substituteInPlace "$out/share/polkit-1/actions/com.teamviewer.TeamViewer.policy" \
|
|
|
|
--replace '/opt/teamviewer/tv_bin/script/execscript' \
|
|
|
|
"$out/share/teamviewer/tv_bin/script/execscript"
|
|
|
|
|
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;
|
|
|
|
|
2018-04-26 13:04:13 +01:00
|
|
|
sed -i "s,/opt/teamviewer,$out/share/teamviewer,g" $out/share/teamviewer/tv_bin/desktop/com.teamviewer.*.desktop
|
2015-12-03 14:56:21 +00:00
|
|
|
|
2018-04-26 13:04:13 +01:00
|
|
|
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/'
|
2021-10-12 15:35:35 +01:00
|
|
|
'';
|
2019-08-22 22:43:43 +01:00
|
|
|
|
2021-10-12 15:35:35 +01:00
|
|
|
makeWrapperArgs = [
|
2021-10-12 15:51:50 +01:00
|
|
|
"--prefix PATH : ${lib.makeBinPath [ getconf coreutils ]}"
|
2021-10-12 15:35:35 +01:00
|
|
|
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libXrandr libX11 libXext libXdamage libXtst libSM libXfixes dbus ]}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/share/teamviewer/tv_bin/teamviewerd ''${makeWrapperArgs[@]}
|
|
|
|
# tv_bin/script/teamviewer runs tvw_main which runs tv_bin/TeamViewer
|
|
|
|
wrapProgram $out/share/teamviewer/tv_bin/script/teamviewer ''${makeWrapperArgs[@]} ''${qtWrapperArgs[@]}
|
|
|
|
wrapProgram $out/share/teamviewer/tv_bin/teamviewer-config ''${makeWrapperArgs[@]} ''${qtWrapperArgs[@]}
|
|
|
|
wrapProgram $out/share/teamviewer/tv_bin/TeamViewer_Desktop ''${makeWrapperArgs[@]} ''${qtWrapperArgs[@]}
|
2015-12-03 14:56:21 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
2021-09-30 20:19:50 +01:00
|
|
|
dontWrapQtApps = true;
|
2019-09-12 21:22:31 +01:00
|
|
|
preferLocalBuild = true;
|
2015-12-03 14:56:21 +00:00
|
|
|
|
2019-08-22 12:17:29 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "http://www.teamviewer.com";
|
2015-12-03 14:56:21 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
description = "Desktop sharing application, providing remote support and online meetings";
|
2018-04-26 13:04:13 +01:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2021-09-30 20:19:50 +01:00
|
|
|
maintainers = with maintainers; [ jagajaga dasuxullebt jraygauthier ];
|
2015-12-03 14:56:21 +00:00
|
|
|
};
|
|
|
|
}
|