summary refs log tree commit diff
path: root/pkgs/applications/networking/remote
diff options
context:
space:
mode:
authorBjørn Forsman <bjorn.forsman@gmail.com>2014-04-06 00:21:30 +0200
committerBjørn Forsman <bjorn.forsman@gmail.com>2014-04-06 00:23:59 +0200
commit31ab1fd7aee16ac755a08067c91def333a09d521 (patch)
treea193f6487f5cc06bc3029418663e8cca7ab94376 /pkgs/applications/networking/remote
parent866c3a329d0df0590dcc5fc7501ebf0bc4fa0138 (diff)
downloadnixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.tar
nixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.tar.gz
nixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.tar.bz2
nixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.tar.lz
nixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.tar.xz
nixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.tar.zst
nixpkgs-31ab1fd7aee16ac755a08067c91def333a09d521.zip
teamviewer: fix brokenness after updates / GC
Teamviewer puts symlinks to nix store paths in ~/.teamviewer. When those
paths become garbage collected, teamviewer crashes upon start because of
those broken symlinks. An easy workaround to this behaviour is simply to
delete all symlinks before we start teamviewer. Teamviewer will fixup
the symlinks, just like it did the first time the user ran it.
Diffstat (limited to 'pkgs/applications/networking/remote')
-rw-r--r--pkgs/applications/networking/remote/teamviewer/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/applications/networking/remote/teamviewer/default.nix b/pkgs/applications/networking/remote/teamviewer/default.nix
index 8c629519764..1bf40eabfae 100644
--- a/pkgs/applications/networking/remote/teamviewer/default.nix
+++ b/pkgs/applications/networking/remote/teamviewer/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper
-, bash }:
+, bash, findutils, coreutils }:
 
 assert stdenv.system == "i686-linux";
 let
@@ -31,6 +31,13 @@ stdenv.mkDerivation {
 
     cat > $out/bin/teamviewer << EOF
     #!${bash}/bin/sh
+    # Teamviewer puts symlinks to nix store paths in ~/.teamviewer. When those
+    # paths become garbage collected, teamviewer crashes upon start because of
+    # those broken symlinks. An easy workaround to this behaviour is simply to
+    # delete all symlinks before we start teamviewer. Teamviewer will fixup the
+    # symlinks, just like it did the first time the user ran it.
+    ${findutils}/bin/find "\$HOME"/.teamviewer/*/*/"Program Files/TeamViewer/" -type l -print0 | ${findutils}/bin/xargs -0 ${coreutils}/bin/rm
+
     export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
     export PATH=${topath}\''${PATH:+:\$PATH}
     $out/share/teamviewer/wrapper wine "c:\Program Files\TeamViewer\Version7\TeamViewer.exe" "\$@"