2012-04-01 17:21:30 +02:00
|
|
|
{ stdenv, fetchurl, rpm, cpio, mesa, xorg, cairo
|
|
|
|
, libpng12, gtk, glib, gdk_pixbuf, fontconfig, freetype, curl
|
|
|
|
, dbus_glib, alsaLib, pulseaudio, udev
|
2011-07-18 16:44:28 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-04-01 17:21:30 +02:00
|
|
|
rpathPlugin = makeLibraryPath
|
|
|
|
[ mesa
|
2011-07-18 16:44:28 +02:00
|
|
|
xorg.libXt
|
|
|
|
xorg.libX11
|
|
|
|
cairo
|
2012-04-01 17:21:30 +02:00
|
|
|
libpng12
|
2011-07-18 16:44:28 +02:00
|
|
|
gtk
|
|
|
|
glib
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
|
2012-04-01 17:21:30 +02: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
|
2011-07-18 16:44:28 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2012-04-01 17:21:30 +02:00
|
|
|
name = "google-talk-plugin-2.8.5.0";
|
2011-07-18 16:44:28 +02:00
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
|
|
|
url = "http://dl.google.com/linux/direct/google-talkplugin_current_x86_64.rpm";
|
2012-04-01 17:21:30 +02:00
|
|
|
sha256 = "15909wnhspjci0fspvh5j87v1xl7dfix36zrpvk6fpc3m0vys0nh";
|
2011-07-18 16:44:28 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
throw "Google Talk does not support your platform.";
|
|
|
|
|
|
|
|
buildInputs = [ rpm cpio ];
|
|
|
|
|
|
|
|
unpackPhase =
|
|
|
|
''
|
|
|
|
rpm2cpio $src | cpio -i --make-directories -v
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase =
|
|
|
|
''
|
2012-04-01 17:21:30 +02:00
|
|
|
plugins=$out/lib/mozilla/plugins
|
|
|
|
mkdir -p $plugins
|
|
|
|
cp opt/google/talkplugin/libnp*.so $plugins
|
2011-07-18 16:44:28 +02:00
|
|
|
|
2012-04-01 17:21:30 +02:00
|
|
|
patchelf --set-rpath "${makeLibraryPath [ stdenv.gcc.gcc xorg.libX11 ]}:${stdenv.gcc.gcc}/lib64" \
|
|
|
|
$plugins/libnpgoogletalk.so
|
2011-07-18 16:44:28 +02:00
|
|
|
|
2012-04-01 17:21:30 +02:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib:${rpathPlugin}:${stdenv.gcc.gcc}/lib64" \
|
|
|
|
$plugins/libnpgtpo3dautoplugin.so
|
2011-07-18 16:44:28 +02:00
|
|
|
|
|
|
|
mkdir -p $out/libexec/google/talkplugin
|
|
|
|
cp opt/google/talkplugin/GoogleTalkPlugin $out/libexec/google/talkplugin/
|
|
|
|
|
|
|
|
mkdir -p $out/libexec/google/talkplugin/lib
|
|
|
|
cp opt/google/talkplugin/lib/libCg* $out/libexec/google/talkplugin/lib/
|
|
|
|
|
2012-04-01 17:21:30 +02:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib" \
|
|
|
|
$out/libexec/google/talkplugin/lib/libCgGL.so
|
|
|
|
|
2011-07-18 16:44:28 +02:00
|
|
|
patchelf \
|
2012-04-01 17:21:30 +02:00
|
|
|
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${rpathProgram}:${stdenv.gcc.gcc}/lib64" \
|
2011-07-18 16:44:28 +02:00
|
|
|
$out/libexec/google/talkplugin/GoogleTalkPlugin
|
2012-04-01 17:21:30 +02: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 16:44:28 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
passthru.mozillaPlugin = "/lib/mozilla/plugins";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.google.com/chat/video/;
|
|
|
|
license = "unfree";
|
2012-04-01 17:21:30 +02:00
|
|
|
maintainers = [ stdenv.lib.maintainers.eelco ];
|
2011-07-18 16:44:28 +02:00
|
|
|
};
|
2011-08-26 13:21:56 +02:00
|
|
|
}
|