2012-04-01 16:21:30 +01:00
|
|
|
{ stdenv, fetchurl, rpm, cpio, mesa, xorg, cairo
|
|
|
|
, libpng12, gtk, glib, gdk_pixbuf, fontconfig, freetype, curl
|
|
|
|
, dbus_glib, alsaLib, pulseaudio, udev
|
2011-07-18 15:44:28 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
|
2012-07-09 02:05:56 +01:00
|
|
|
baseURL = "http://dl.google.com/linux/talkplugin/deb/pool/main/g/google-talkplugin";
|
|
|
|
|
2012-04-01 16:21:30 +01:00
|
|
|
rpathPlugin = makeLibraryPath
|
|
|
|
[ mesa
|
2011-07-18 15:44:28 +01:00
|
|
|
xorg.libXt
|
|
|
|
xorg.libX11
|
|
|
|
cairo
|
2012-04-01 16:21:30 +01:00
|
|
|
libpng12
|
2011-07-18 15:44:28 +01:00
|
|
|
gtk
|
|
|
|
glib
|
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
curl
|
|
|
|
];
|
|
|
|
|
2012-04-01 16:21:30 +01: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 15:44:28 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2012-07-09 02:05:56 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "google-talk-plugin-${version}";
|
|
|
|
version = "3.2.4.0";
|
2011-07-18 15:44:28 +01:00
|
|
|
|
|
|
|
src =
|
|
|
|
if stdenv.system == "x86_64-linux" then
|
|
|
|
fetchurl {
|
2012-07-09 02:05:56 +01:00
|
|
|
url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb";
|
|
|
|
sha256 = "0hd8iyv092fr4bz760xjawiad581hphddv608d0dvzy2bhnl17g1";
|
2011-07-18 15:44:28 +01:00
|
|
|
}
|
2012-04-02 10:59:25 +01:00
|
|
|
else if stdenv.system == "i686-linux" then
|
|
|
|
fetchurl {
|
2012-07-09 02:05:56 +01:00
|
|
|
url = "${baseURL}/google-talkplugin_${version}-1_i386.deb";
|
|
|
|
sha256 = "13vqs4k16a6bzc5i4zpnakh31nkdqp7m9cv7p16r1sq5smv1331i";
|
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
|
|
|
|
cp opt/google/talkplugin/libnp*.so $plugins
|
2011-07-18 15:44:28 +01:00
|
|
|
|
2012-04-01 16:21:30 +01:00
|
|
|
patchelf --set-rpath "${makeLibraryPath [ stdenv.gcc.gcc xorg.libX11 ]}:${stdenv.gcc.gcc}/lib64" \
|
|
|
|
$plugins/libnpgoogletalk.so
|
2011-07-18 15:44:28 +01:00
|
|
|
|
2012-04-01 16:21:30 +01:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib:${rpathPlugin}:${stdenv.gcc.gcc}/lib64" \
|
|
|
|
$plugins/libnpgtpo3dautoplugin.so
|
2011-07-18 15:44:28 +01: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 16:21:30 +01:00
|
|
|
patchelf --set-rpath "$out/libexec/google/talkplugin/lib" \
|
|
|
|
$out/libexec/google/talkplugin/lib/libCgGL.so
|
|
|
|
|
2011-07-18 15:44:28 +01:00
|
|
|
patchelf \
|
2012-04-01 16:21:30 +01:00
|
|
|
--set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
|
|
|
|
--set-rpath "${rpathProgram}:${stdenv.gcc.gcc}/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
|
2011-07-18 15:44:28 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
|
|
|
passthru.mozillaPlugin = "/lib/mozilla/plugins";
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = http://www.google.com/chat/video/;
|
|
|
|
license = "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
|
|
|
}
|