summary refs log tree commit diff
path: root/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
blob: 10ae0eb1da601b175f517e63763f625f69ea8419 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{stdenv, fetchurl, which, pkgconfig, file, glib, gtk2, gtk3, curl, libXt}:
let
  srcData = # Generated upstream information 
  rec {
    baseName="nspluginwrapper";
    version="1.4.4";
    name="${baseName}-${version}";
    hash="1fxjz9ifhw0drm12havlsl4jpsq1nv930gqa005kgddv5pa99vgj";
    url="http://nspluginwrapper.org/download/nspluginwrapper-1.4.4.tar.gz";
  };
in
stdenv.mkDerivation {
  inherit (srcData) name version;

  src = fetchurl{
    inherit (srcData) url;
    sha256 = srcData.hash;
  };

  preConfigure = ''
    sed -e 's@/usr/bin/@@g' -i configure
    sed -e '/gthread[.]h/d' -i src/npw-player.c
    export NIX_LDFLAGS="$NIX_LDFLAGS -lgthread-2.0"
    export configureFlags="$configureFlags --target-cpu=$(uname -m)"
  '';

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [which file glib gtk2 gtk3 curl libXt];

  preferLocalBuild = true;

  meta = {
    description = ''A wrapper to run browser plugins out-of-process'';
    homepage = http://nspluginwrapper.org/;
    license = stdenv.lib.licenses.gpl2;
    platforms = [ "x64_64-linux" "i686-linux" ];
    maintainers = [ stdenv.lib.maintainers.raskin ];
    inherit (srcData) version;
  };
}