1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00

chromium: Switch to use open-source PDF plugin.

The Chromium PDF plugin is now available as open source software and is
already included in the Chromium source tree in current stable, so there
is no need to extract it from the Chrome binary package anymore.

See release announcement at http://blog.foxitsoftware.com/?p=641

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
This commit is contained in:
aszlig 2014-11-21 16:34:05 +01:00
parent 45c4d68960
commit 7eb4d3a3a9
No known key found for this signature in database
GPG key ID: D0EBD0EC8C2DC961
4 changed files with 4 additions and 22 deletions

View file

@ -12,7 +12,7 @@ mkChromiumDerivation (base: rec {
cp -v "$buildPath/"*.pak "$libExecPath/"
cp -v "$buildPath/icudtl.dat" "$libExecPath/"
cp -vLR "$buildPath/locales" "$buildPath/resources" "$libExecPath/"
cp -v $buildPath/libffmpegsumo.so "$libExecPath/"
cp -v "$buildPath/libpdf.so" "$buildPath/libffmpegsumo.so" "$libExecPath/"
cp -v "$buildPath/chrome" "$libExecPath/$packageName"

View file

@ -9,7 +9,6 @@
, gnomeKeyringSupport ? false
, proprietaryCodecs ? true
, enablePepperFlash ? false
, enablePepperPDF ? false
, enableWideVine ? false
, cupsSupport ? false
, pulseSupport ? false
@ -36,7 +35,7 @@ let
sandbox = callPackage ./sandbox.nix { };
plugins = callPackage ./plugins.nix {
inherit enablePepperFlash enablePepperPDF enableWideVine;
inherit enablePepperFlash enableWideVine;
};
};

View file

@ -1,6 +1,5 @@
{ stdenv
, enablePepperFlash ? false
, enablePepperPDF ? false
, enableWideVine ? false
, source
@ -16,7 +15,7 @@ let
src = source.plugins;
phases = [ "unpackPhase" "patchPhase" "installPhase" "checkPhase" ];
outputs = [ "pdf" "flash" "widevine" ];
outputs = [ "flash" "widevine" ];
unpackCmd = let
chan = if source.channel == "dev" then "chrome-unstable"
@ -26,7 +25,6 @@ let
mkdir -p plugins
ar p "$src" data.tar.lzma | tar xJ -C plugins --strip-components=4 \
./opt/google/${chan}/PepperFlash \
./opt/google/${chan}/libpdf.so \
./opt/google/${chan}/libwidevinecdm.so \
./opt/google/${chan}/libwidevinecdmadapter.so
'';
@ -40,7 +38,7 @@ let
rpaths = [ stdenv.gcc.gcc ];
mkrpath = p: "${makeSearchPath "lib64" p}:${makeSearchPath "lib" p}";
in ''
for sofile in PepperFlash/libpepflashplayer.so libpdf.so \
for sofile in PepperFlash/libpepflashplayer.so \
libwidevinecdm.so libwidevinecdmadapter.so; do
chmod +x "$sofile"
patchelf --set-rpath "${mkrpath rpaths}" "$sofile"
@ -51,25 +49,12 @@ let
'';
installPhase = let
pdfName = "Chrome PDF Viewer";
pdfDescription = "Portable Document Format";
pdfMimeTypes = concatStringsSep ";" [
"application/pdf"
"application/x-google-chrome-print-preview-pdf"
];
pdfInfo = "#${pdfName}#${pdfDescription};${pdfMimeTypes}";
wvName = "Widevine Content Decryption Module";
wvDescription = "Playback of encrypted HTML audio/video content";
wvMimeTypes = "application/x-ppapi-widevine-cdm";
wvModule = "$widevine/lib/libwidevinecdmadapter.so";
wvInfo = "#${wvName}#${wvDescription}:${wvMimeTypes}";
in ''
install -vD libpdf.so "$pdf/lib/libpdf.so"
mkdir -p "$pdf/nix-support"
echo "--register-pepper-plugins='$pdf/lib/libpdf.so${pdfInfo}'" \
> "$pdf/nix-support/chromium-flags"
flashVersion="$(
sed -n -r 's/.*"version": "([^"]+)",.*/\1/p' PepperFlash/manifest.json
)"
@ -94,7 +79,6 @@ let
passthru = let
enabledPlugins = optional enablePepperFlash plugins.flash
++ optional enablePepperPDF plugins.pdf
++ optional enableWideVine plugins.widevine;
getFlags = plugin: "$(< ${plugin}/nix-support/chromium-flags)";
getEnvVars = plugin: "$(< ${plugin}/nix-support/chromium-env-vars)";

View file

@ -9120,7 +9120,6 @@ let
channel = "stable";
pulseSupport = config.pulseaudio or true;
enablePepperFlash = config.chromium.enablePepperFlash or false;
enablePepperPDF = config.chromium.enablePepperPDF or false;
hiDPISupport = config.chromium.hiDPISupport or false;
};