mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-24 13:53:24 +00:00
7eb4d3a3a9
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>
90 lines
2.5 KiB
Nix
90 lines
2.5 KiB
Nix
{ newScope, stdenv, makeWrapper, makeDesktopItem
|
|
|
|
# package customization
|
|
, channel ? "stable"
|
|
, enableSELinux ? false
|
|
, enableNaCl ? false
|
|
, useOpenSSL ? false
|
|
, gnomeSupport ? false
|
|
, gnomeKeyringSupport ? false
|
|
, proprietaryCodecs ? true
|
|
, enablePepperFlash ? false
|
|
, enableWideVine ? false
|
|
, cupsSupport ? false
|
|
, pulseSupport ? false
|
|
, hiDPISupport ? false
|
|
}:
|
|
|
|
let
|
|
callPackage = newScope chromium;
|
|
|
|
chromium = {
|
|
source = callPackage ./source {
|
|
inherit channel;
|
|
# XXX: common config
|
|
inherit useOpenSSL;
|
|
};
|
|
|
|
mkChromiumDerivation = callPackage ./common.nix {
|
|
inherit enableSELinux enableNaCl useOpenSSL gnomeSupport
|
|
gnomeKeyringSupport proprietaryCodecs cupsSupport
|
|
pulseSupport hiDPISupport;
|
|
};
|
|
|
|
browser = callPackage ./browser.nix { };
|
|
sandbox = callPackage ./sandbox.nix { };
|
|
|
|
plugins = callPackage ./plugins.nix {
|
|
inherit enablePepperFlash enableWideVine;
|
|
};
|
|
};
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = "chromium";
|
|
exec = "chromium";
|
|
icon = "${chromium.browser}/share/icons/hicolor/48x48/apps/chromium.png";
|
|
comment = "An open source web browser from Google";
|
|
desktopName = "Chromium";
|
|
genericName = "Web browser";
|
|
mimeType = stdenv.lib.concatStringsSep ";" [
|
|
"text/html"
|
|
"text/xml"
|
|
"application/xhtml+xml"
|
|
"x-scheme-handler/http"
|
|
"x-scheme-handler/https"
|
|
"x-scheme-handler/ftp"
|
|
"x-scheme-handler/mailto"
|
|
"x-scheme-handler/webcal"
|
|
];
|
|
categories = "Network;WebBrowser";
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
|
name = "chromium${if channel != "stable" then "-" + channel else ""}-${chromium.browser.version}";
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
buildCommand = let
|
|
browserBinary = "${chromium.browser}/libexec/chromium/chromium";
|
|
sandboxBinary = "${chromium.sandbox}/bin/chromium-sandbox";
|
|
in ''
|
|
mkdir -p "$out/bin" "$out/share/applications"
|
|
|
|
ln -s "${chromium.browser}/share" "$out/share"
|
|
makeWrapper "${browserBinary}" "$out/bin/chromium" \
|
|
--set CHROMIUM_SANDBOX_BINARY_PATH "${sandboxBinary}" \
|
|
--run "export ${chromium.plugins.envVarsEnabled}" \
|
|
--add-flags "${chromium.plugins.flagsEnabled}"
|
|
|
|
ln -s "$out/bin/chromium" "$out/bin/chromium-browser"
|
|
ln -s "${chromium.browser}/share/icons" "$out/share/icons"
|
|
cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
|
|
'';
|
|
|
|
inherit (chromium.browser) meta packageName;
|
|
|
|
passthru = {
|
|
mkDerivation = chromium.mkChromiumDerivation;
|
|
};
|
|
}
|