summary refs log tree commit diff
path: root/pkgs/applications/networking/remote/teamviewer/8.nix
blob: 8113e33e0a72f051d2871707bff70bf722df52cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes, wine, makeWrapper
, bash }:

# Work in progress.

# It doesn't want to start unless teamviewerd is running as root.
# I haven't tried to make the daemon run.

assert stdenv.system == "i686-linux";
let
  topath = "${wine}/bin";

  toldpath = stdenv.lib.concatStringsSep ":" (map (x: "${x}/lib") 
    [ stdenv.gcc.gcc libX11 libXtst libXext libXdamage libXfixes wine ]);
in
stdenv.mkDerivation {
  name = "teamviewer-8.0.17147";
  src = fetchurl {
    url = "http://download.teamviewer.com/download/teamviewer_linux_x64.deb";
    sha256 = "01iynk954pphl5mq4avs843xyzvdfzng1lpsy7skgwvw0k9cx5ab";
  };

  buildInputs = [ makeWrapper ];

  unpackPhase = ''
    ar x $src
    tar xf data.tar.gz
  '';

  installPhase = ''
    mkdir -p $out/share/teamviewer8 $out/bin
    cp -a opt/teamviewer8/* $out/share/teamviewer8
    rm -R $out/share/teamviewer8/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/teamviewer8/tv_bin/script/teamviewer
    EOF
    chmod +x $out/bin/teamviewer
  '';

  meta = {
    homepage = "http://www.teamviewer.com";
    license = "unfree";
    description = "Desktop sharing application, providing remote support and online meetings";
  };
}