about summary refs log tree commit diff
path: root/pkgs/applications/networking
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2016-11-01 11:39:34 +0100
committeraszlig <aszlig@redmoonstudios.org>2016-11-08 20:12:20 +0100
commitb84e3379fed770557a983b4c1f7642b0fc7b11de (patch)
tree2ed74eb0807699675f63d774a836404759f35fe5 /pkgs/applications/networking
parent5f53fddf1ef784e2279bd4236c9f7566a038e89c (diff)
downloadnixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.tar
nixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.tar.gz
nixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.tar.bz2
nixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.tar.lz
nixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.tar.xz
nixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.tar.zst
nixlib-b84e3379fed770557a983b4c1f7642b0fc7b11de.zip
chromium: Bring back pepper flash from Adobe
So far we had the bundled Flash player plugin that came with Chrome, but
since version 54 the Chrome package doesn't include PPAPI Flash anymore.

Instead we're going to download the PPAPI Flash plugin directly from
Adobe and try to use them for all release channels of Chromium.

Of course it would be nice if we'd have an updater for it but for now
it's important that we don't break things for people who are currently
forced to use Flash.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/chromium/plugins.nix57
2 files changed, 51 insertions, 8 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index bf4e4cf8ae36..b59cda875b69 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -28,7 +28,7 @@ let
     browser = callPackage ./browser.nix { inherit channel; };
 
     plugins = callPackage ./plugins.nix {
-      inherit enableWideVine;
+      inherit enablePepperFlash enableWideVine;
     };
   };
 
diff --git a/pkgs/applications/networking/browsers/chromium/plugins.nix b/pkgs/applications/networking/browsers/chromium/plugins.nix
index f611bfd02759..9b779ab98928 100644
--- a/pkgs/applications/networking/browsers/chromium/plugins.nix
+++ b/pkgs/applications/networking/browsers/chromium/plugins.nix
@@ -1,5 +1,7 @@
 { stdenv
 , jshon
+, fetchzip
+, enablePepperFlash ? false
 , enableWideVine ? false
 
 , upstream-info
@@ -8,6 +10,8 @@
 with stdenv.lib;
 
 let
+  mkrpath = p: "${makeSearchPathOutput "lib" "lib64" p}:${makeLibraryPath p}";
+
   # Generate a shell fragment that emits flags appended to the
   # final makeWrapper call for wrapping the browser's main binary.
   #
@@ -59,16 +63,13 @@ let
       ! find -iname '*.so' -exec ldd {} + | grep 'not found'
     '';
 
-    patchPhase = let
-      rpaths = [ stdenv.cc.cc ];
-      mkrpath = p: "${makeSearchPathOutput "lib" "lib64" p}:${makeLibraryPath p}";
-    in ''
+    patchPhase = ''
       for sofile in libwidevinecdm.so libwidevinecdmadapter.so; do
         chmod +x "$sofile"
-        patchelf --set-rpath "${mkrpath rpaths}" "$sofile"
+        patchelf --set-rpath "${mkrpath [ stdenv.cc.cc ]}" "$sofile"
       done
 
-      patchelf --set-rpath "$out/lib:${mkrpath rpaths}" \
+      patchelf --set-rpath "$out/lib:${mkrpath [ stdenv.cc.cc ]}" \
         libwidevinecdmadapter.so
     '';
 
@@ -90,6 +91,48 @@ let
       }}
     '';
   };
+
+  flash = stdenv.mkDerivation rec {
+    name = "flashplayer-ppapi-${version}";
+    version = "23.0.0.205";
+
+    src = fetchzip {
+      url = "https://fpdownload.adobe.com/pub/flashplayer/pdc/"
+          + "${version}/flash_player_ppapi_linux.x86_64.tar.gz";
+      sha256 = "0gj5d8475qcplm3iqs3hkq0i6qkmbhci1zp3ljnhafc6xz0avyhj";
+      stripRoot = false;
+    };
+
+    patchPhase = ''
+      chmod +x libpepflashplayer.so
+      patchelf --set-rpath "${mkrpath [ stdenv.cc.cc ]}" libpepflashplayer.so
+    '';
+
+    doCheck = true;
+    checkPhase = ''
+      ! find -iname '*.so' -exec ldd {} + | grep 'not found'
+    '';
+
+    installPhase = ''
+      flashVersion="$(
+        "${jshon}/bin/jshon" -F manifest.json -e version -u
+      )"
+
+      install -vD libpepflashplayer.so "$out/lib/libpepflashplayer.so"
+
+      ${mkPluginInfo {
+        allowedVars = [ "out" "flashVersion" ];
+        flags = [
+          "--ppapi-flash-path=@out@/lib/libpepflashplayer.so"
+          "--ppapi-flash-version=@flashVersion@"
+        ];
+      }}
+    '';
+
+    dontStrip = true;
+  };
+
 in {
-  enabled = optional enableWideVine widevine;
+  enabled = optional enableWideVine widevine
+         ++ optional enablePepperFlash flash;
 }