2012-04-01 15:21:30 +00:00
|
|
|
{ stdenv, fetchurl, rpm, cpio, mesa, xorg, cairo
|
2013-06-26 14:48:45 +00:00
|
|
|
, libpng, gtk, glib, gdk_pixbuf, fontconfig, freetype, curl
|
2012-08-31 21:22:04 +00:00
|
|
|
, dbus_glib, alsaLib, pulseaudio, udev, pango
|
2011-07-18 14:44:28 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-09-01 19:36:46 +00:00
|
|
|
baseURL = "http://dl.google.com/linux/talkplugin/deb/pool/main/g/google-talkplugin";
|
2012-07-09 01:05:56 +00:00
|
|
|
|
2012-04-01 15:21:30 +00:00
|
|
|
rpathPlugin = makeLibraryPath
|
|
|
|
[ mesa
|
2011-07-18 14:44:28 +00:00
|
|
|
xorg.libXt
|
|
|
|
xorg.libX11
|
|
|
|
cairo
|
2013-06-26 14:48:45 +00:00
|
|
|
libpng
|
2011-07-18 14:44:28 +00:00
|
|
|
gtk
|
|
|
|
glib
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
|
2012-04-01 15:21:30 +00:00
|
|
|
rpathProgram = makeLibraryPath
|
|
|
|
[ gdk_pixbuf
|
|
|
|
glib
|
|
|
|
gtk
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcomposite
|
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXrender
|
|
|
|
xorg.libXrandr
|
|
|
|
stdenv.gcc.gcc
|
|
|
|
alsaLib
|
|
|
|
pulseaudio
|
|
|
|
dbus_glib
|
|
|
|
udev
|
|
|
|
curl
|
2012-08-31 21:22:04 +00:00
|
|
|
pango
|
|
|
|
cairo
|
2011-07-18 14:44:28 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2012-07-09 01:05:56 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "google-talk-plugin-${version}";
|
2014-02-28 10:01:32 +00:00
|
|
|
|
|
|
|
# You can get the upstream version and SHA-1 hash from the following URLs:
|
2014-02-28 15:47:05 +00:00
|
|
|
# http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-amd64/Packages
|
2014-02-28 10:01:32 +00:00
|
|
|
# http://dl.google.com/linux/talkplugin/deb/dists/stable/main/binary-i386/Packages
|
|
|
|
version = "5.1.5.0";
|
2011-07-18 14:44:28 +00:00
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2012-09-01 19:36:46 +00:00
|
|
|
url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb";
|
2014-02-28 10:01:32 +00:00
|
|
|
sha1 = "fc830f4c7f5816f4578ec73e6d4aef059ad4a0b1";
|
2011-07-18 14:44:28 +00:00
|
|
|
}
|
2012-04-02 09:59:25 +00:00
|
|
|
else if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2012-09-01 19:36:46 +00:00
|
|
|
url = "${baseURL}/google-talkplugin_${version}-1_i386.deb";
|
2014-02-28 10:01:32 +00:00
|
|
|
sha1 = "9b7043c3585b3479ba11aabb7b8af755a61df963";
|
2012-04-02 09:59:25 +00:00
|
|
|
}
|
|
|
|
else throw "Google Talk does not support your platform.";
|
2011-07-18 14:44:28 +00:00
|
|
|
|
2012-07-09 01:05:56 +00:00
|
|
|
unpackPhase = ''
|
|
|
|
ar p "$src" data.tar.gz | tar xz
|
|
|
|
'';
|
2011-07-18 14:44:28 +00:00
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
2012-04-01 15:21:30 +00:00
|
|
|
plugins=$out/lib/mozilla/plugins
|
|
|
|
mkdir -p $plugins
|
|
|
|
cp opt/google/talkplugin/libnp*.so $plugins
|
2011-07-18 14:44:28 +00:00
|
|
|
|
2012-04-01 15:21:30 +00:00
|
|
|
patchelf --set-rpath "${makeLibraryPath [ stdenv.gcc.gcc xorg.libX11 ]}:${stdenv.gcc.gcc}/lib64" \
|
|
|
|
$plugins/libnpgoogletalk.so
|
2011-07-18 14:44:28 +00:00
|
|
|
|
2012-04-01 15:21:30 +00:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib:${rpathPlugin}:${stdenv.gcc.gcc}/lib64" \
|
|
|
|
$plugins/libnpgtpo3dautoplugin.so
|
2011-07-18 14:44:28 +00:00
|
|
|
|
|
|
|
mkdir -p $out/libexec/google/talkplugin
|
2013-06-27 12:27:03 +00:00
|
|
|
cp -prd opt/google/talkplugin/{GoogleTalkPlugin,locale,windowpicker.glade} $out/libexec/google/talkplugin/
|
|
|
|
|
2011-07-18 14:44:28 +00:00
|
|
|
mkdir -p $out/libexec/google/talkplugin/lib
|
|
|
|
cp opt/google/talkplugin/lib/libCg* $out/libexec/google/talkplugin/lib/
|
|
|
|
|
2012-04-01 15:21:30 +00:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib" \
|
2013-06-27 12:27:03 +00:00
|
|
|
$out/libexec/google/talkplugin/lib/libCgGL.so
|
2012-04-01 15:21:30 +00:00
|
|
|
|
2011-07-18 14:44:28 +00:00
|
|
|
patchelf \
|
2012-04-01 15:21:30 +00:00
|
|
|
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${rpathProgram}:${stdenv.gcc.gcc}/lib64" \
|
2011-07-18 14:44:28 +00:00
|
|
|
$out/libexec/google/talkplugin/GoogleTalkPlugin
|
2012-04-01 15:21:30 +00: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
|
2011-07-18 14:44:28 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
2013-06-27 12:27:03 +00:00
|
|
|
|
2011-07-18 14:44:28 +00:00
|
|
|
passthru.mozillaPlugin = "/lib/mozilla/plugins";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.google.com/chat/video/;
|
|
|
|
license = "unfree";
|
2012-04-01 15:21:30 +00:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
2011-07-18 14:44:28 +00:00
|
|
|
};
|
2011-08-26 11:21:56 +00:00
|
|
|
}
|