lol

chromium: Add WideVine content decryption plugin.

Seems to be needed in order to view Netflix content, but this only pulls
in the proprietary plugin and doesn't yet compile Chromium with support
for it, so this is only in preparation for the bright and shiny future
(where we all have rootkits implanted in our body).

Of course, this plugin is disabled by default as well as all the other
proprietary plugins.

For the plugin derivation, we now do the checkPhase _after_ the
installPhase, to make sure we also detect RPATHs pointing to the plugin
directory itself, because the shared object files only exist after the
installPhase.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>

aszlig d3a7c503 b159458c

+29 -6
+2 -1
pkgs/applications/networking/browsers/chromium/default.nix
··· 10 10 , proprietaryCodecs ? true 11 11 , enablePepperFlash ? false 12 12 , enablePepperPDF ? false 13 + , enableWideVine ? false 13 14 , cupsSupport ? false 14 15 , pulseSupport ? false 15 16 , hiDPISupport ? false ··· 35 36 sandbox = callPackage ./sandbox.nix { }; 36 37 37 38 plugins = callPackage ./plugins.nix { 38 - inherit enablePepperFlash enablePepperPDF; 39 + inherit enablePepperFlash enablePepperPDF enableWideVine; 39 40 }; 40 41 }; 41 42
+27 -5
pkgs/applications/networking/browsers/chromium/plugins.nix
··· 1 1 { stdenv 2 2 , enablePepperFlash ? false 3 3 , enablePepperPDF ? false 4 + , enableWideVine ? false 4 5 5 6 , source 6 7 }: ··· 14 15 # XXX: Only temporary and has to be version-specific 15 16 src = source.plugins; 16 17 17 - phases = [ "unpackPhase" "patchPhase" "checkPhase" "installPhase" ]; 18 - outputs = [ "pdf" "flash" ]; 18 + phases = [ "unpackPhase" "patchPhase" "installPhase" "checkPhase" ]; 19 + outputs = [ "pdf" "flash" "widevine" ]; 19 20 20 21 unpackCmd = let 21 22 chan = if source.channel == "dev" then "chrome-unstable" ··· 25 26 mkdir -p plugins 26 27 ar p "$src" data.tar.lzma | tar xJ -C plugins --strip-components=4 \ 27 28 ./opt/google/${chan}/PepperFlash \ 28 - ./opt/google/${chan}/libpdf.so 29 + ./opt/google/${chan}/libpdf.so \ 30 + ./opt/google/${chan}/libwidevinecdm.so \ 31 + ./opt/google/${chan}/libwidevinecdmadapter.so 29 32 ''; 30 33 31 34 doCheck = true; ··· 37 40 rpaths = [ stdenv.gcc.gcc ]; 38 41 mkrpath = p: "${makeSearchPath "lib64" p}:${makeSearchPath "lib" p}"; 39 42 in '' 40 - for sofile in PepperFlash/libpepflashplayer.so libpdf.so; do 43 + for sofile in PepperFlash/libpepflashplayer.so libpdf.so \ 44 + libwidevinecdm.so libwidevinecdmadapter.so; do 41 45 chmod +x "$sofile" 42 46 patchelf --set-rpath "${mkrpath rpaths}" "$sofile" 43 47 done 48 + 49 + patchelf --set-rpath "$widevine/lib:${mkrpath rpaths}" \ 50 + libwidevinecdmadapter.so 44 51 ''; 45 52 46 53 installPhase = let ··· 51 58 "application/x-google-chrome-print-preview-pdf" 52 59 ]; 53 60 pdfInfo = "#${pdfName}#${pdfDescription};${pdfMimeTypes}"; 61 + 62 + wvName = "Widevine Content Decryption Module"; 63 + wvDescription = "Playback of encrypted HTML audio/video content"; 64 + wvMimeTypes = "application/x-ppapi-widevine-cdm"; 65 + wvModule = "$widevine/lib/libwidevinecdmadapter.so"; 66 + wvInfo = "#${wvName}#${wvDescription}:${wvMimeTypes}"; 54 67 in '' 55 68 install -vD libpdf.so "$pdf/lib/libpdf.so" 56 69 mkdir -p "$pdf/nix-support" ··· 67 80 echo "--ppapi-flash-path='$flash/lib/libpepflashplayer.so'" \ 68 81 "--ppapi-flash-version=$flashVersion" \ 69 82 > "$flash/nix-support/chromium-flags" 83 + 84 + install -vD libwidevinecdm.so \ 85 + "$widevine/lib/libwidevinecdm.so" 86 + install -vD libwidevinecdmadapter.so \ 87 + "$widevine/lib/libwidevinecdmadapter.so" 88 + mkdir -p "$widevine/nix-support" 89 + echo "--register-pepper-plugins='${wvModule}${wvInfo}'" \ 90 + > "$widevine/nix-support/chromium-flags" 70 91 ''; 71 92 72 93 passthru.flagsEnabled = let 73 94 enabledPlugins = optional enablePepperFlash plugins.flash 74 - ++ optional enablePepperPDF plugins.pdf; 95 + ++ optional enablePepperPDF plugins.pdf 96 + ++ optional enableWideVine plugins.widevine; 75 97 getFlags = plugin: "$(< ${plugin}/nix-support/chromium-flags)"; 76 98 in concatStringsSep " " (map getFlags enabledPlugins); 77 99 };