2015-12-03 14:56:21 +00:00
|
|
|
{ stdenv, lib, fetchurl, xdg_utils, pkgs, pkgsi686Linux }:
|
|
|
|
|
|
|
|
let
|
|
|
|
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"
|
2017-12-05 23:06:43 +00:00
|
|
|
else throw "Unsupported system ${stdenv.system}";
|
2015-12-03 14:56:21 +00:00
|
|
|
ld64 = "${stdenv.cc}/nix-support/dynamic-linker";
|
|
|
|
|
|
|
|
mkLdPath = ps: lib.makeLibraryPath (with ps; [ qt4 dbus alsaLib ]);
|
|
|
|
|
2017-04-13 00:14:03 +01:00
|
|
|
deps = ps: (with ps; [ dbus zlib alsaLib fontconfig freetype libpng12 libjpeg ]) ++ (with ps.xlibs; [ libX11 libXext libXdamage libXrandr libXrender libXfixes libSM libXtst libXinerama]);
|
2015-12-03 14:56:21 +00:00
|
|
|
tvldpath32 = lib.makeLibraryPath (with pkgsi686Linux; [ qt4 "$out/share/teamviewer/tv_bin/wine" ] ++ deps pkgsi686Linux);
|
|
|
|
tvldpath64 = lib.makeLibraryPath (deps pkgs);
|
|
|
|
in
|
2016-06-03 21:45:26 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2015-12-03 14:56:21 +00:00
|
|
|
name = "teamviewer-${version}";
|
2017-12-01 12:50:35 +00:00
|
|
|
version = "12.0.85001";
|
2016-06-03 21:45:26 +01:00
|
|
|
|
2015-12-03 14:56:21 +00:00
|
|
|
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.
|
2017-12-01 12:50:35 +00:00
|
|
|
url = "https://dl.tvcdn.de/download/version_12x/teamviewer_${version}_i386.deb";
|
|
|
|
sha256 = "01vzky22gisjxa4ihaygkb7jwhl4z9ldd9lli8fc863nxxbrawks";
|
2015-12-03 14:56:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 \
|
2017-04-13 00:14:03 +01:00
|
|
|
$out/share/teamviewer/tv_bin/xdg-utils \
|
2015-12-03 14:56:21 +00:00
|
|
|
$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
|
2016-12-17 18:04:48 +00:00
|
|
|
ln -s $out/share/teamviewer/tv_bin/desktop/com.teamviewer.*.desktop $out/share/applications
|
2015-12-03 14:56:21 +00:00
|
|
|
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 ''
|
2016-02-20 13:02:38 +00:00
|
|
|
sed -i "/TV_LD64_PATH=.*/d" script/tvw_config
|
2015-12-03 14:56:21 +00:00
|
|
|
''}
|
|
|
|
|
2016-12-17 18:04:48 +00:00
|
|
|
sed -i "s,/opt/teamviewer,$out/share/teamviewer,g" desktop/com.teamviewer.*.desktop
|
2015-12-03 14:56:21 +00:00
|
|
|
|
2017-04-13 00:14:03 +01:00
|
|
|
for i in teamviewer-config teamviewerd TeamViewer_Desktop TVGuiDelegate TVGuiSlave.32 wine/bin/* RTlib/libQtCore.so.4; do
|
2015-12-03 14:56:21 +00:00
|
|
|
echo "patching $i"
|
2017-04-13 00:14:03 +01:00
|
|
|
patchelf --set-interpreter $(cat ${ld32}) --set-rpath $out/share/teamviewer/tv_bin/RTlib:${tvldpath32} $i || true
|
2015-12-03 14:56:21 +00:00
|
|
|
done
|
2017-04-13 00:14:03 +01:00
|
|
|
for i in resources/*.so wine/drive_c/TeamViewer/tvwine.dll.so wine/lib/*.so* wine/lib/wine/*.so RTlib/*.so* ; do
|
2015-12-03 14:56:21 +00:00
|
|
|
echo "patching $i"
|
2017-04-13 00:14:03 +01:00
|
|
|
patchelf --set-rpath $out/share/teamviewer/tv_bin/RTlib:${tvldpath32} $i || true
|
2015-12-03 14:56:21 +00:00
|
|
|
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; {
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://www.teamviewer.com;
|
2015-12-03 14:56:21 +00:00
|
|
|
license = licenses.unfree;
|
|
|
|
description = "Desktop sharing application, providing remote support and online meetings";
|
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
2017-04-13 00:14:03 +01:00
|
|
|
maintainers = with maintainers; [ jagajaga dasuxullebt ];
|
2015-12-03 14:56:21 +00:00
|
|
|
};
|
|
|
|
}
|