[Backport release-21.05] teamviewer: fix #96633, #44307 and #97148 + 15.15.5 -> 15.18.5 -> 15.22.3 (#141439)
* teamviewer: fix issue #96633 Fix teamviewer's breakage post 15.5.3 -> 15.15.5. Teamviewer client was no longer able to connect to its backing server as it now uses dbus to do so. Following changes were required: - add missing dbus and polkit service/policy files to package. - add missing dbus lib to `LD_LIBRARY_PATH`. Changes to the nixos module as a separate changeset. (cherry picked from commit 506966d15658d8a411f364f47bbc0f3f9366dba3) * nixos/teamviewer: fix issue #96633 Add teamviewer package as a dbus package now that the client / server communication depends on dbus. (cherry picked from commit 200e959995fa8088b5722bc8255109c03f2a4f78) * nixos/teamviewer: fix issue #44307 Move to a forefront launch of the daemon. Doing so allowed us to move the service from forking to simple to avoid the missing pid error log. Also: - Make the dbus dependency explicit. (cherry picked from commit 953bbc0d7373102cf89625dc3bb7ab8e91134069) * teamviewer: 15.15.5 -> 15.18.5 Upgrading to the last version still using qt5.14. Later version will be using qt5.15 which is not in 21.05 stable branch. This fixes us the crash observed in 15.15.5 when stopping the service. (cherry picked from commit db889eb9137a859eedfc5b402de84271c0659662) * teamviewer: refactor executable wrapping This centralizes `PATH` and `LD_LIBRARY_PATH`, avoid multiple layers of wrappers. Refactor as suggested by @Artturin in PR provided patch: <https://github.com/NixOS/nixpkgs/pull/140076#issuecomment-934770391>. (cherry picked from commit c55bc5bfd3377d54f5b6153d09c033cceadfcc05) * teamviewer: fix 97148 (busybox installed issue) Simply add `coreutils` as a runtime dependency which will prevent teamviewer from using incomplete busybox implementation of expected gnu binaries. As suggested by @Artturin in PR comment: <https://github.com/NixOS/nixpkgs/pull/140076#issuecomment-934770391>. (cherry picked from commit 4fb188e1d190f2e08053dba3e2e95fff1e29183a) * teamviewer: 15.18.5 -> 15.22.3 Required move from libsForQt514 -> libsForQt515. Note that this changset won't be backportable to 21.05. (cherry picked from commit 975ab7f3a02ac0232afe7920a8f7d78fc22d5ccb) Co-authored-by: Raymond Gauthier <jraygauthier@gmail.com>
This commit is contained in:
parent
83070001ea
commit
e882bcae43
|
@ -24,18 +24,21 @@ in
|
|||
|
||||
environment.systemPackages = [ pkgs.teamviewer ];
|
||||
|
||||
services.dbus.packages = [ pkgs.teamviewer ];
|
||||
|
||||
systemd.services.teamviewerd = {
|
||||
description = "TeamViewer remote control daemon";
|
||||
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "NetworkManager-wait-online.service" "network.target" ];
|
||||
after = [ "NetworkManager-wait-online.service" "network.target" "dbus.service" ];
|
||||
requires = [ "dbus.service" ];
|
||||
preStart = "mkdir -pv /var/lib/teamviewer /var/log/teamviewer";
|
||||
|
||||
startLimitIntervalSec = 60;
|
||||
startLimitBurst = 10;
|
||||
serviceConfig = {
|
||||
Type = "forking";
|
||||
ExecStart = "${pkgs.teamviewer}/bin/teamviewerd -d";
|
||||
Type = "simple";
|
||||
ExecStart = "${pkgs.teamviewer}/bin/teamviewerd -f";
|
||||
PIDFile = "/run/teamviewerd.pid";
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
Restart = "on-abort";
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
{ mkDerivation, lib, fetchurl, autoPatchelfHook, makeWrapper, xdg-utils, dbus
|
||||
, qtbase, qtwebkit, qtx11extras, qtquickcontrols, glibc
|
||||
, libXrandr, libX11, libXext, libXdamage, libXtst, libSM, libXfixes
|
||||
, qtbase, qtwebkit, qtwebengine, qtx11extras, qtquickcontrols, getconf, glibc
|
||||
, libXrandr, libX11, libXext, libXdamage, libXtst, libSM, libXfixes, coreutils
|
||||
, wrapQtAppsHook
|
||||
}:
|
||||
|
||||
mkDerivation rec {
|
||||
pname = "teamviewer";
|
||||
version = "15.15.5";
|
||||
version = "15.22.3";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dl.tvcdn.de/download/linux/version_15x/teamviewer_${version}_amd64.deb";
|
||||
sha256 = "sha256-H/CSc2RcjI+Fm8awYcXm3ioAJpbSNEMwGVrTozMux3A=";
|
||||
sha256 = "15fvzhdq7mnx2l2w4byvij8ww16qwdlkbadal60rm66yzv79mv9w";
|
||||
};
|
||||
|
||||
unpackPhase = ''
|
||||
|
@ -19,7 +19,7 @@ mkDerivation rec {
|
|||
'';
|
||||
|
||||
nativeBuildInputs = [ autoPatchelfHook makeWrapper wrapQtAppsHook ];
|
||||
buildInputs = [ dbus qtbase qtwebkit qtx11extras libX11 ];
|
||||
buildInputs = [ dbus getconf qtbase qtwebkit qtwebengine qtx11extras libX11 ];
|
||||
propagatedBuildInputs = [ qtquickcontrols ];
|
||||
|
||||
installPhase = ''
|
||||
|
@ -28,6 +28,7 @@ mkDerivation rec {
|
|||
rm -R \
|
||||
$out/share/teamviewer/logfiles \
|
||||
$out/share/teamviewer/config \
|
||||
$out/share/teamviewer/tv_bin/RTlib \
|
||||
$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}
|
||||
|
||||
|
@ -38,6 +39,27 @@ mkDerivation rec {
|
|||
ln -s /var/log/teamviewer $out/share/teamviewer/logfiles
|
||||
ln -s ${xdg-utils}/bin $out/share/teamviewer/tv_bin/xdg-utils
|
||||
|
||||
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"
|
||||
|
||||
for i in 16 20 24 32 48 256; do
|
||||
size=$i"x"$i
|
||||
|
||||
|
@ -51,17 +73,23 @@ mkDerivation rec {
|
|||
--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/'
|
||||
'';
|
||||
|
||||
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 ]}"
|
||||
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 ]}"
|
||||
makeWrapperArgs = [
|
||||
"--prefix PATH : ${lib.makeBinPath [ getconf coreutils ]}"
|
||||
"--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libXrandr libX11 libXext libXdamage libXtst libSM libXfixes dbus ]}"
|
||||
];
|
||||
|
||||
wrapQtApp $out/share/teamviewer/tv_bin/script/teamviewer
|
||||
wrapQtApp $out/bin/teamviewer
|
||||
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[@]}
|
||||
'';
|
||||
|
||||
dontStrip = true;
|
||||
dontWrapQtApps = true;
|
||||
preferLocalBuild = true;
|
||||
|
||||
meta = with lib; {
|
||||
|
@ -69,6 +97,6 @@ mkDerivation rec {
|
|||
license = licenses.unfree;
|
||||
description = "Desktop sharing application, providing remote support and online meetings";
|
||||
platforms = [ "x86_64-linux" ];
|
||||
maintainers = with maintainers; [ jagajaga dasuxullebt ];
|
||||
maintainers = with maintainers; [ jagajaga dasuxullebt jraygauthier ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -8959,7 +8959,7 @@ in
|
|||
|
||||
ted = callPackage ../tools/typesetting/ted { };
|
||||
|
||||
teamviewer = libsForQt514.callPackage ../applications/networking/remote/teamviewer { };
|
||||
teamviewer = libsForQt515.callPackage ../applications/networking/remote/teamviewer { };
|
||||
|
||||
teleconsole = callPackage ../tools/misc/teleconsole { };
|
||||
|
||||
|
|
Loading…
Reference in New Issue