@@ -1,4 +1,5 @@
11{ stdenv
2+, lib
23, fetchurl
34, zlib
45, alsaLib
@@ -54,6 +55,7 @@ let
5455 else "_linux.i386"
5556 else throw "Flash Player is not supported on this platform";
5657
58+ is-i686 = (stdenv.system == "i686-linux");
5759in
5860stdenv.mkDerivation rec {
5961 name = "flashplayer-${version}";
@@ -67,19 +69,47 @@ stdenv.mkDerivation rec {
6769 buildInputs = [ unzip ];
6870
6971 postUnpack = ''
70− cd */*${arch}
71− tar -xvzf *${suffix}.tar.gz
72+ pushd $sourceRoot
73+ tar -xvzf *${arch}/*${suffix}.tar.gz
74+
75+ ${ lib.optionalString is-i686 ''
76+ tar -xvzf */*_sa.*.tar.gz
77+ tar -xvzf */*_sa_debug.*.tar.gz
78+ ''}
79+
80+ popd
7281 '';
7382
74− sourceRoot = ".";
83+ sourceRoot = "fp_${version}_archive";
7584
7685 dontStrip = true;
7786 dontPatchELF = true;
7887
88+ outputs = [ "out" ] ++ lib.optionals is-i686 ["sa" "saDbg" ];
89+
7990 installPhase = ''
8091 mkdir -p $out/lib/mozilla/plugins
8192 cp -pv libflashplayer.so $out/lib/mozilla/plugins
8293 patchelf --set-rpath "$rpath" $out/lib/mozilla/plugins/libflashplayer.so
94+
95+ ${ lib.optionalString is-i686 ''
96+ mkdir -p $sa/bin
97+ cp flashplayer $sa/bin/
98+
99+ patchelf \
100+ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
101+ --set-rpath "$rpath" \
102+ $sa/bin/flashplayer
103+
104+
105+ mkdir -p $saDbg/bin
106+ cp flashplayerdebugger $saDbg/bin/
107+
108+ patchelf \
109+ --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
110+ --set-rpath "$rpath" \
111+ $saDbg/bin/flashplayerdebugger
112+ ''}
83113 '';
84114
85115 passthru = {