diff options
Diffstat (limited to 'pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin')
-rw-r--r-- | pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix | 117 | ||||
-rw-r--r-- | pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/preload.c | 60 |
2 files changed, 0 insertions, 177 deletions
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix deleted file mode 100644 index 9923b100afa1..000000000000 --- a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix +++ /dev/null @@ -1,117 +0,0 @@ -{ stdenv, fetchurl, libGL, xorg, cairo -, libpng, gtk2, glib, gdk-pixbuf, fontconfig, freetype, curl -, dbus-glib, alsaLib, libpulseaudio, systemd, pango -}: - -with stdenv.lib; - -let - - baseURL = "http://dl.google.com/linux/talkplugin/deb/pool/main/g/google-talkplugin"; - - rpathPlugin = makeLibraryPath - [ libGL - xorg.libXt - xorg.libX11 - xorg.libXrender - cairo - libpng - gtk2 - glib - fontconfig - freetype - curl - ]; - - rpathProgram = makeLibraryPath - [ gdk-pixbuf - glib - gtk2 - xorg.libX11 - xorg.libXcomposite - xorg.libXfixes - xorg.libXrender - xorg.libXrandr - xorg.libXext - stdenv.cc.cc - alsaLib - libpulseaudio - dbus-glib - systemd - curl - pango - cairo - ]; - -in - -stdenv.mkDerivation rec { - pname = "google-talk-plugin"; - - # 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' - version = "5.41.3.0"; - - src = - if stdenv.hostPlatform.system == "x86_64-linux" then - fetchurl { - url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb"; - sha256 = "af7e23d2b6215afc547f96615b99f04e0561557cc58c0c9302364b5a3840d97d"; - } - else if stdenv.hostPlatform.system == "i686-linux" then - fetchurl { - url = "${baseURL}/google-talkplugin_${version}-1_i386.deb"; - sha256 = "4c46d2b7f2018640288cd7ac49adc47e309d0beadfd979eb03030e672016b4a7"; - } - else throw "Google Talk does not support your platform."; - - unpackPhase = '' - ar p "$src" data.tar.gz | tar xz - ''; - - installPhase = - '' - plugins=$out/lib/mozilla/plugins - mkdir -p $plugins - cp opt/google/talkplugin/*.so $plugins - - for i in libnpgoogletalk.so libppgoogletalk.so libppo1d.so; do - patchelf --set-rpath "${makeLibraryPath [ stdenv.cc.cc xorg.libX11 ]}:${stdenv.cc.cc.lib}/lib64" $plugins/$i - done - - for i in libgoogletalkremoting.so libnpo1d.so; do - patchelf --set-rpath "$out/libexec/google/talkplugin/lib:${rpathPlugin}:${stdenv.cc.cc.lib}/lib64" $plugins/$i - done - - mkdir -p $out/libexec/google/talkplugin - cp -prd opt/google/talkplugin/{data,GoogleTalkPlugin,locale,remoting24x24.png,windowpicker.glade} $out/libexec/google/talkplugin/ - - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${rpathProgram}:${stdenv.cc.cc.lib}/lib64" \ - $out/libexec/google/talkplugin/GoogleTalkPlugin - - # 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 - - # Prevent a dependency on gcc. - strip -S $preload - patchELF $preload - ''; - - dontStrip = true; - dontPatchELF = true; - - passthru.mozillaPlugin = "/lib/mozilla/plugins"; - - meta = { - homepage = "http://www.google.com/chat/video/"; - license = stdenv.lib.licenses.unfree; - maintainers = [ stdenv.lib.maintainers.eelco ]; - }; -} diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/preload.c b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/preload.c deleted file mode 100644 index 1e2c31d9527a..000000000000 --- a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/preload.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Google Talk Plugin executes a helper program in /opt. This - LD_PRELOAD library intercepts execvp() calls to redirect them to - the corresponding location in $out. */ - -#define _GNU_SOURCE -#include <stdio.h> -#include <stdarg.h> -#include <stdlib.h> -#include <string.h> -#include <dlfcn.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -#include <limits.h> - -char origDir [] = "/opt/google/talkplugin"; -char realDir [] = OUT "/libexec/google/talkplugin"; - -const char * rewrite(const char * path, char * buf) -{ - if (strncmp(path, origDir, sizeof(origDir) - 1) != 0) return path; - if (snprintf(buf, PATH_MAX, "%s%s", realDir, path + sizeof(origDir) - 1) >= PATH_MAX) - abort(); - return buf; -} - -int execvp(const char * path, char * const argv[]) -{ - int (*_execvp) (const char *, char * const argv[]) = dlsym(RTLD_NEXT, "execvp"); - char buf[PATH_MAX]; - return _execvp(rewrite(path, buf), argv); -} - -int open(const char *path, int flags, ...) -{ - char buf[PATH_MAX]; - int (*_open) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open"); - mode_t mode = 0; - if (flags & O_CREAT) { - va_list ap; - va_start(ap, flags); - mode = va_arg(ap, mode_t); - va_end(ap); - } - return _open(rewrite(path, buf), flags, mode); -} - -int open64(const char *path, int flags, ...) -{ - char buf[PATH_MAX]; - int (*_open64) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open64"); - mode_t mode = 0; - if (flags & O_CREAT) { - va_list ap; - va_start(ap, flags); - mode = va_arg(ap, mode_t); - va_end(ap); - } - return _open64(rewrite(path, buf), flags, mode); -} |