diff options
author | Domen Kožar <domen@dev.si> | 2015-03-04 10:44:19 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-03-04 10:44:28 +0100 |
commit | 768594a1e1f4e8aec63346dabd4af8b4f8c266a4 (patch) | |
tree | c750183fc91ae59f931badf954d3d4f20a0a7995 /pkgs/applications | |
parent | b072ce228a48f0ab2ae105cfc7427813234f17ab (diff) |
teamviewer: add 10, set it as default
Diffstat (limited to 'pkgs/applications')
-rw-r--r-- | pkgs/applications/networking/remote/teamviewer/10.nix | 47 | ||||
-rw-r--r-- | pkgs/applications/networking/remote/teamviewer/default.nix | 53 |
2 files changed, 47 insertions, 53 deletions
diff --git a/pkgs/applications/networking/remote/teamviewer/10.nix b/pkgs/applications/networking/remote/teamviewer/10.nix new file mode 100644 index 0000000000000..6a54a0e7ff0b2 --- /dev/null +++ b/pkgs/applications/networking/remote/teamviewer/10.nix @@ -0,0 +1,47 @@ +{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wineUnstable, makeWrapper, libXau +, bash, patchelf, config }: + +let + topath = "${wineUnstable}/bin"; + + toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") + [ stdenv.cc.cc libX11 libXtst libXext libXdamage libXfixes wineUnstable ]); +in +stdenv.mkDerivation { + name = "teamviewer-10.0.37742"; + src = fetchurl { + url = config.teamviewer10.url or "http://download.teamviewer.com/download/teamviewer_amd64.deb"; + sha256 = config.teamviewer10.sha256 or "1j3zbvyj003gk8mm9sv1dld9x30l6fswwlhdyk46mixsqq5ayp6c"; + }; + + buildInputs = [ makeWrapper patchelf ]; + + unpackPhase = '' + ar x $src + tar xf data.tar.gz + ''; + + installPhase = '' + mkdir -p $out/share/teamviewer $out/bin + cp -a opt/teamviewer/* $out/share/teamviewer + rm -R $out/share/teamviewer/tv_bin/wine/{bin,lib,share} + + cat > $out/bin/teamviewer << EOF + #!${bash}/bin/sh + export LD_LIBRARY_PATH=${toldpath}\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} + export PATH=${topath}\''${PATH:+:\$PATH} + $out/share/teamviewer/tv_bin/script/teamviewer "\$@" + EOF + chmod +x $out/bin/teamviewer + + patchelf --set-rpath "${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib:${libX11}/lib:${libXext}/lib:${libXau}/lib:${libXdamage}/lib:${libXfixes}/lib" $out/share/teamviewer/tv_bin/teamviewerd + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/teamviewer/tv_bin/teamviewerd + ln -s $out/share/teamviewer/tv_bin/teamviewerd $out/bin/ + ''; + + meta = { + homepage = "http://www.teamviewer.com"; + license = stdenv.lib.licenses.unfree; + description = "Desktop sharing application, providing remote support and online meetings"; + }; +} diff --git a/pkgs/applications/networking/remote/teamviewer/default.nix b/pkgs/applications/networking/remote/teamviewer/default.nix deleted file mode 100644 index 55a5beb5093f9..0000000000000 --- a/pkgs/applications/networking/remote/teamviewer/default.nix +++ /dev/null @@ -1,53 +0,0 @@ -{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper -, bash, findutils, coreutils }: - -assert stdenv.system == "i686-linux"; -let - topath = "${wine}/bin"; - - toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") - [ stdenv.cc.cc libX11 libXtst libXext libXdamage libXfixes wine ]); -in -stdenv.mkDerivation { - name = "teamviewer-7.0.9377"; - src = fetchurl { - url = "http://download.teamviewer.com/download/version_7x/teamviewer_linux.tar.gz"; - sha256 = "1f8934jqj093m1z56yl6k2ah6njkk6pz1rjvpqnryi29pp5piaiy"; - }; - - buildInputs = [ makeWrapper ]; - - # I need patching, mainly for it not try to use its own 'wine' (in the tarball). - installPhase = '' - mkdir -p $out/share/teamviewer $out/bin - cp -a .tvscript/* $out/share/teamviewer - cp -a .wine/drive_c $out/share/teamviewer - sed -i -e 's/^tv_Run//' \ - -e 's/^ setup_tar_env//' \ - -e 's/^ setup_env//' \ - -e 's,^ TV_Wine_dir=.*, TV_Wine_dir=${wine},' \ - -e 's,progsrc=.*drive_c,progsrc='$out'"/share/teamviewer/drive_c,' \ - $out/share/teamviewer/wrapper - - 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" "\$@" - EOF - chmod +x $out/bin/teamviewer - ''; - - meta = { - homepage = "http://www.teamviewer.com"; - license = stdenv.lib.licenses.unfree; - description = "Desktop sharing application, providing remote support and online meetings"; - }; -} |