mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 14:13:35 +00:00
b9093f1c64
Built and run Beta and Stable locally. Dev is surrently superseded by Stable so it doesn't matter much. - Dev: 47.0.2508.0 -> 48.0.2564.22 - Beta: 46.0.2490.64 -> 48.0.2564.23 - Stable: 45.0.2454.101 -> 47.0.2526.73 Changed the SSL dependencies to the supported configuration on Linux (according to Torne @Freenode/#chromium-support). - NSS is a dependency since it is used to access the ceritiface store. - Dropped system OpenSSL support, the bundled BoringSSL is used. This probably fixes issue #10555. Note that without this adjustment the build fails even. Dropped uneeded old patches.
93 lines
2.5 KiB
Nix
93 lines
2.5 KiB
Nix
{ newScope, stdenv, makeWrapper, makeDesktopItem
|
|
|
|
# package customization
|
|
, channel ? "stable"
|
|
, enableSELinux ? false
|
|
, enableNaCl ? false
|
|
, enableHotwording ? false
|
|
, gnomeSupport ? false
|
|
, gnomeKeyringSupport ? false
|
|
, proprietaryCodecs ? true
|
|
, enablePepperFlash ? false
|
|
, enableWideVine ? false
|
|
, cupsSupport ? true
|
|
, pulseSupport ? false
|
|
, hiDPISupport ? false
|
|
}:
|
|
|
|
let
|
|
callPackage = newScope chromium;
|
|
|
|
chromium = {
|
|
source = callPackage ./source {
|
|
inherit channel;
|
|
# XXX: common config
|
|
};
|
|
|
|
mkChromiumDerivation = callPackage ./common.nix {
|
|
inherit enableSELinux enableNaCl enableHotwording gnomeSupport
|
|
gnomeKeyringSupport proprietaryCodecs cupsSupport pulseSupport
|
|
hiDPISupport;
|
|
};
|
|
|
|
browser = callPackage ./browser.nix { };
|
|
|
|
plugins = callPackage ./plugins.nix {
|
|
inherit enablePepperFlash enableWideVine;
|
|
};
|
|
};
|
|
|
|
desktopItem = makeDesktopItem {
|
|
name = "chromium";
|
|
exec = "chromium %U";
|
|
icon = "chromium";
|
|
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"
|
|
"x-scheme-handler/about"
|
|
"x-scheme-handler/unknown"
|
|
];
|
|
categories = "Network;WebBrowser";
|
|
};
|
|
|
|
suffix = if channel != "stable" then "-" + channel else "";
|
|
|
|
in stdenv.mkDerivation {
|
|
name = "chromium${suffix}-${chromium.browser.version}";
|
|
|
|
buildInputs = [ makeWrapper ] ++ chromium.plugins.enabledPlugins;
|
|
|
|
buildCommand = let
|
|
browserBinary = "${chromium.browser}/libexec/chromium/chromium";
|
|
mkEnvVar = key: val: "--set '${key}' '${val}'";
|
|
envVars = chromium.plugins.settings.envVars or {};
|
|
flags = chromium.plugins.settings.flags or [];
|
|
in with stdenv.lib; ''
|
|
mkdir -p "$out/bin" "$out/share/applications"
|
|
|
|
ln -s "${chromium.browser}/share" "$out/share"
|
|
makeWrapper "${browserBinary}" "$out/bin/chromium" \
|
|
${concatStrings (mapAttrsToList mkEnvVar envVars)} \
|
|
--add-flags "${concatStringsSep " " flags}"
|
|
|
|
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;
|
|
};
|
|
}
|