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