1{ lib, stdenv, fetchurl, bash, cabextract, curl, gnupg, libX11, libGLU, libGL, wine-staging }:
2
3let
4 wine_custom = wine-staging;
5
6 mozillaPluginPath = "/lib/mozilla/plugins";
7
8
9in stdenv.mkDerivation rec {
10
11 version = "0.2.8.2";
12
13 pname = "pipelight";
14
15 src = fetchurl {
16 url = "https://bitbucket.org/mmueller2012/pipelight/get/v${version}.tar.gz";
17 sha256 = "1kyy6knkr42k34rs661r0f5sf6l1s2jdbphdg89n73ynijqmzjhk";
18 };
19
20 buildInputs = [ wine_custom libX11 libGLU libGL curl ];
21
22 env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ];
23
24 patches = [
25 ./pipelight.patch
26 ./wine-6.13-new-args.patch
27 # https://source.winehq.org/git/wine.git/commit/cf4a781e987a98a8d48610362a20a320c4a1016d
28 # adds ControlMask as a static variable.
29 ./wine-7.10-ControlMask.patch
30 ];
31
32 configurePhase = ''
33 patchShebangs .
34 ./configure \
35 --prefix=$out \
36 --moz-plugin-path=$out/${mozillaPluginPath} \
37 --wine-path=${wine_custom} \
38 --gpg-exec=${gnupg}/bin/gpg \
39 --bash-interp=${bash}/bin/bash \
40 --downloader=${curl.bin}/bin/curl
41 $configureFlags
42 '';
43
44 passthru = {
45 mozillaPlugin = mozillaPluginPath;
46 wine = wine_custom;
47 };
48
49 postInstall = ''
50 $out/bin/pipelight-plugin --create-mozilla-plugins
51 '';
52
53 preFixup = ''
54 substituteInPlace $out/share/pipelight/install-dependency \
55 --replace cabextract ${cabextract}/bin/cabextract
56 '';
57
58 enableParallelBuilding = true;
59
60 meta = {
61 homepage = "http://pipelight.net/";
62 license = with lib.licenses; [ mpl11 gpl2Only lgpl21 ];
63 description = "A wrapper for using Windows plugins in Linux browsers";
64 maintainers = with lib.maintainers; [ ];
65 platforms = [ "x86_64-linux" "i686-linux" ];
66 mainProgram = "pipelight-plugin";
67 };
68}