teamviewer: init at 11.0.52520, remove older versions

This commit is contained in:
Nikolay Amiantov 2015-12-03 17:56:21 +03:00
parent c50d013d1f
commit c3d503d33d
6 changed files with 92 additions and 159 deletions

View File

@ -14,7 +14,7 @@ in
options = {
services.teamviewer.enable = mkEnableOption "teamviewer daemon";
services.teamviewer.enable = mkEnableOption "TeamViewer daemon";
};
@ -27,9 +27,9 @@ in
systemd.services.teamviewerd = {
description = "TeamViewer remote control daemon";
wantedBy = [ "graphical.target" ];
wantedBy = [ "multi-user.target" ];
after = [ "NetworkManager-wait-online.service" "network.target" ];
preStart = "mkdir -pv /var/tmp/teamviewer10/{logs,config}";
preStart = "mkdir -pv /var/lib/teamviewer /var/log/teamviewer";
serviceConfig = {
Type = "forking";

View File

@ -1,57 +0,0 @@
{ stdenv, fetchurl, libX11, libXtst, libXext, libXdamage, libXfixes,
wineUnstable, makeWrapper, libXau , patchelf, config }:
with stdenv.lib;
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 "10risay1a5a85ijbjaz2vxqbfxygpxslvh0dvzz32k988hr9p1gk";
};
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
#!${stdenv.shell}
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
ln -s $out/share/teamviewer/tv_bin/teamviewerd $out/bin/
rm -rf $out/share/teamviewer/logfiles $out/share/teamviewer/config
ln -sv /var/tmp/teamviewer10/logs/ $out/share/teamviewer/logfiles
ln -sv /var/tmp/teamviewer10/config/ $out/share/teamviewer/config
'';
# the fixupPhase undoes the rpath patch
postFixup = ''
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/teamviewer/tv_bin/teamviewerd
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
'';
meta = {
homepage = "http://www.teamviewer.com";
license = licenses.unfree;
description = "Desktop sharing application, providing remote support and online meetings";
maintainers = with maintainers; [ jagajaga ];
};
}

View File

@ -1,47 +0,0 @@
{ 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-8.0.17147";
src = fetchurl {
url = config.teamviewer8.url or "http://download.teamviewer.com/download/version_8x/teamviewer_linux_x64.deb";
sha256 = config.teamviewer8.sha256 or "0s5m15f99rdmspzwx3gb9mqd6jx1bgfm0d6rfd01k9rf7gi7qk0k";
};
buildInputs = [ makeWrapper patchelf ];
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
patchelf --set-rpath "${stdenv.cc.cc}/lib64:${stdenv.cc.cc}/lib:${libX11}/lib:${libXext}/lib:${libXau}/lib:${libXdamage}/lib:${libXfixes}/lib" $out/share/teamviewer8/tv_bin/teamviewerd
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/teamviewer8/tv_bin/teamviewerd
ln -s $out/share/teamviewer8/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";
};
}

View File

@ -1,47 +0,0 @@
{ 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-9.0.32150";
src = fetchurl {
url = config.teamviewer9.url or "http://download.teamviewer.com/download/version_9x/teamviewer_linux_x64.deb";
sha256 = config.teamviewer9.sha256 or "0wpwbx0xzn3vlzavszxhfvfcaj3pijlpwvlz5m7w19mb6cky3q13";
};
buildInputs = [ makeWrapper patchelf ];
unpackPhase = ''
ar x $src
tar xf data.tar.gz
'';
installPhase = ''
mkdir -p $out/share/teamviewer9 $out/bin
cp -a opt/teamviewer9/* $out/share/teamviewer9
rm -R $out/share/teamviewer9/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/teamviewer9/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/teamviewer9/tv_bin/teamviewerd
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/teamviewer9/tv_bin/teamviewerd
ln -s $out/share/teamviewer9/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";
};
}

View File

@ -0,0 +1,86 @@
{ stdenv, lib, fetchurl, xdg_utils, pkgs, pkgsi686Linux }:
let
version = "11.0.52520";
ld32 =
if stdenv.system == "i686-linux" then "${stdenv.cc}/nix-support/dynamic-linker"
else if stdenv.system == "x86_64-linux" then "${stdenv.cc}/nix-support/dynamic-linker-m32"
else abort "Unsupported architecture";
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
mkLdPath = ps: lib.makeLibraryPath (with ps; [ qt4 dbus alsaLib ]);
deps = ps: (with ps; [ dbus alsaLib fontconfig freetype libpng libjpeg ]) ++ (with ps.xlibs; [ libX11 libXext libXdamage libXrandr libXrender libXfixes libSM libXtst ]);
tvldpath32 = lib.makeLibraryPath (with pkgsi686Linux; [ qt4 "$out/share/teamviewer/tv_bin/wine" ] ++ deps pkgsi686Linux);
tvldpath64 = lib.makeLibraryPath (deps pkgs);
in
stdenv.mkDerivation {
name = "teamviewer-${version}";
src = fetchurl {
# There is a 64-bit package, but it has no differences apart from Debian dependencies.
# Generic versioned packages (teamviewer_${version}_i386.tar.xz) are not available for some reason.
url = "http://download.teamviewer.com/download/teamviewer_${version}_i386.deb";
sha256 = "1430dimcv69plpj0ad0wsn10k15x9fwlk6fiq7yz51qbcr5l9wk6";
};
unpackPhase = ''
ar x $src
tar xf data.tar.*
'';
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 \
$out/share/teamviewer/tv_bin/{xdg-utils,RTlib} \
$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
ln -s $out/share/teamviewer/tv_bin/desktop/teamviewer-teamviewer*.desktop $out/share/applications
ln -s /var/lib/teamviewer $out/share/teamviewer/config
ln -s /var/log/teamviewer $out/share/teamviewer/logfiles
ln -s ${xdg_utils}/bin $out/share/teamviewer/tv_bin/xdg-utils
pushd $out/share/teamviewer/tv_bin
sed -i "s,TV_LD32_PATH=.*,TV_LD32_PATH=$(cat ${ld32})," script/tvw_config
${if stdenv.system == "x86_64-linux" then ''
sed -i "s,TV_LD64_PATH=.*,TV_LD64_PATH=$(cat ${ld64})," script/tvw_config
'' else ''
sed -i ",TV_LD64_PATH=.*,d" script/tvw_config
''}
sed -i "s,/opt/teamviewer,$out/share/teamviewer,g" desktop/teamviewer-*.desktop
for i in teamviewer-config teamviewerd TeamViewer_Desktop TVGuiDelegate TVGuiSlave.32 wine/bin/*; do
echo "patching $i"
patchelf --set-interpreter $(cat ${ld32}) --set-rpath ${tvldpath32} $i || true
done
for i in resources/*.so wine/drive_c/TeamViewer/tvwine.dll.so wine/lib/*.so* wine/lib/wine/*.so; do
echo "patching $i"
patchelf --set-rpath ${tvldpath32} $i || true
done
${if stdenv.system == "x86_64-linux" then ''
patchelf --set-interpreter $(cat ${ld64}) --set-rpath ${tvldpath64} TVGuiSlave.64
'' else ''
rm TVGuiSlave.64
''}
popd
'';
dontPatchELF = true;
dontStrip = true;
meta = with stdenv.lib; {
homepage = "http://www.teamviewer.com";
license = licenses.unfree;
description = "Desktop sharing application, providing remote support and online meetings";
platforms = [ "i686-linux" "x86_64-linux" ];
maintainers = with maintainers; [ jagajaga ];
};
}

View File

@ -3172,11 +3172,9 @@ let
tcpflow = callPackage ../tools/networking/tcpflow { };
teamviewer = callPackage_i686 ../applications/networking/remote/teamviewer/10.nix { };
teamviewer8 = lowPrio (callPackage_i686 ../applications/networking/remote/teamviewer/8.nix { });
teamviewer9 = lowPrio (callPackage_i686 ../applications/networking/remote/teamviewer/9.nix { });
teamviewer = callPackage ../applications/networking/remote/teamviewer {
stdenv = stdenv_32bit;
};
telnet = callPackage ../tools/networking/telnet { };