2018-07-21 01:44:44 +01:00
|
|
|
{ stdenv, fetchurl, libGL, xorg, cairo
|
2019-05-22 12:03:39 +01:00
|
|
|
, libpng, gtk2, glib, gdk-pixbuf, fontconfig, freetype, curl
|
2018-02-25 02:23:58 +00:00
|
|
|
, dbus-glib, alsaLib, libpulseaudio, systemd, pango
|
2011-07-18 15:44:28 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-09-01 20:36:46 +01:00
|
|
|
baseURL = "http://dl.google.com/linux/talkplugin/deb/pool/main/g/google-talkplugin";
|
2012-07-09 02:05:56 +01:00
|
|
|
|
2012-04-01 16:21:30 +01:00
|
|
|
rpathPlugin = makeLibraryPath
|
2018-02-24 12:06:44 +00:00
|
|
|
[ libGL
|
2011-07-18 15:44:28 +01:00
|
|
|
xorg.libXt
|
|
|
|
xorg.libX11
|
2014-07-08 21:31:16 +01:00
|
|
|
xorg.libXrender
|
2011-07-18 15:44:28 +01:00
|
|
|
cairo
|
2013-06-26 15:48:45 +01:00
|
|
|
libpng
|
2016-09-11 22:24:51 +01:00
|
|
|
gtk2
|
2011-07-18 15:44:28 +01:00
|
|
|
glib
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
|
2012-04-01 16:21:30 +01:00
|
|
|
rpathProgram = makeLibraryPath
|
2019-05-22 12:03:39 +01:00
|
|
|
[ gdk-pixbuf
|
2012-04-01 16:21:30 +01:00
|
|
|
glib
|
2016-09-11 22:24:51 +01:00
|
|
|
gtk2
|
2012-04-01 16:21:30 +01:00
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXrandr
|
2016-05-11 19:17:54 +01:00
|
|
|
xorg.libXext
|
2015-01-15 04:25:26 +00:00
|
|
|
stdenv.cc.cc
|
2012-04-01 16:21:30 +01:00
|
|
|
alsaLib
|
2015-05-27 20:42:15 +01:00
|
|
|
libpulseaudio
|
2018-02-25 02:23:58 +00:00
|
|
|
dbus-glib
|
2016-09-05 17:59:00 +01:00
|
|
|
systemd
|
2012-04-01 16:21:30 +01:00
|
|
|
curl
|
2012-08-31 22:22:04 +01:00
|
|
|
pango
|
|
|
|
cairo
|
2011-07-18 15:44:28 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2012-07-09 02:05:56 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "google-talk-plugin";
|
2014-02-28 10:01:32 +00:00
|
|
|
|
2020-01-07 17:24:18 +00:00
|
|
|
# You can get the upstream version and SHA-256 hash from the following URLs:
|
|
|
|
# curl -s http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-amd64/Packages | grep -E 'Version|SHA256'
|
|
|
|
# curl -s http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-i386/Packages | grep -E 'Version|SHA256'
|
2017-01-13 19:24:24 +00:00
|
|
|
version = "5.41.3.0";
|
2011-07-18 15:44:28 +01:00
|
|
|
|
|
|
|
src =
|
2018-08-20 20:11:29 +01:00
|
|
|
if stdenv.hostPlatform.system == "x86_64-linux" then
|
2011-07-18 15:44:28 +01:00
|
|
|
fetchurl {
|
2012-09-01 20:36:46 +01:00
|
|
|
url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb";
|
2020-01-07 17:24:18 +00:00
|
|
|
sha256 = "af7e23d2b6215afc547f96615b99f04e0561557cc58c0c9302364b5a3840d97d";
|
2011-07-18 15:44:28 +01:00
|
|
|
}
|
2018-08-20 20:11:29 +01:00
|
|
|
else if stdenv.hostPlatform.system == "i686-linux" then
|
2012-04-02 10:59:25 +01:00
|
|
|
fetchurl {
|
2012-09-01 20:36:46 +01:00
|
|
|
url = "${baseURL}/google-talkplugin_${version}-1_i386.deb";
|
2020-01-07 17:24:18 +00:00
|
|
|
sha256 = "4c46d2b7f2018640288cd7ac49adc47e309d0beadfd979eb03030e672016b4a7";
|
2012-04-02 10:59:25 +01:00
|
|
|
}
|
|
|
|
else throw "Google Talk does not support your platform.";
|
2011-07-18 15:44:28 +01:00
|
|
|
|
2012-07-09 02:05:56 +01:00
|
|
|
unpackPhase = ''
|
|
|
|
ar p "$src" data.tar.gz | tar xz
|
|
|
|
'';
|
2011-07-18 15:44:28 +01:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
2012-04-01 16:21:30 +01:00
|
|
|
plugins=$out/lib/mozilla/plugins
|
|
|
|
mkdir -p $plugins
|
2014-07-08 21:31:16 +01:00
|
|
|
cp opt/google/talkplugin/*.so $plugins
|
2011-07-18 15:44:28 +01:00
|
|
|
|
2014-07-08 21:31:16 +01:00
|
|
|
for i in libnpgoogletalk.so libppgoogletalk.so libppo1d.so; do
|
2016-04-30 21:56:43 +01:00
|
|
|
patchelf --set-rpath "${makeLibraryPath [ stdenv.cc.cc xorg.libX11 ]}:${stdenv.cc.cc.lib}/lib64" $plugins/$i
|
2014-07-08 21:31:16 +01:00
|
|
|
done
|
2011-07-18 15:44:28 +01:00
|
|
|
|
2014-07-08 21:31:16 +01:00
|
|
|
for i in libgoogletalkremoting.so libnpo1d.so; do
|
2016-04-30 21:56:43 +01:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib:${rpathPlugin}:${stdenv.cc.cc.lib}/lib64" $plugins/$i
|
2014-07-08 21:31:16 +01:00
|
|
|
done
|
2011-07-18 15:44:28 +01:00
|
|
|
|
|
|
|
mkdir -p $out/libexec/google/talkplugin
|
2014-07-08 21:31:16 +01:00
|
|
|
cp -prd opt/google/talkplugin/{data,GoogleTalkPlugin,locale,remoting24x24.png,windowpicker.glade} $out/libexec/google/talkplugin/
|
2012-04-01 16:21:30 +01:00
|
|
|
|
2011-07-18 15:44:28 +01:00
|
|
|
patchelf \
|
2014-12-17 18:11:30 +00:00
|
|
|
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2016-04-30 21:56:43 +01:00
|
|
|
--set-rpath "${rpathProgram}:${stdenv.cc.cc.lib}/lib64" \
|
2011-07-18 15:44:28 +01:00
|
|
|
$out/libexec/google/talkplugin/GoogleTalkPlugin
|
2012-04-01 16:21:30 +01:00
|
|
|
|
|
|
|
# Generate an LD_PRELOAD wrapper to redirect execvp() calls to
|
|
|
|
# /opt/../GoogleTalkPlugin.
|
|
|
|
preload=$out/libexec/google/talkplugin/libpreload.so
|
|
|
|
mkdir -p $(dirname $preload)
|
|
|
|
gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
|
|
|
|
echo $preload > $plugins/extra-ld-preload
|
2016-09-19 12:57:17 +01:00
|
|
|
|
|
|
|
# Prevent a dependency on gcc.
|
|
|
|
strip -S $preload
|
|
|
|
patchELF $preload
|
2011-07-18 15:44:28 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
2013-06-27 13:27:03 +01:00
|
|
|
|
2011-07-18 15:44:28 +01:00
|
|
|
passthru.mozillaPlugin = "/lib/mozilla/plugins";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.google.com/chat/video/;
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2012-04-01 16:21:30 +01:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
2011-07-18 15:44:28 +01:00
|
|
|
};
|
2011-08-26 12:21:56 +01:00
|
|
|
}
|