2014-04-20 06:01:37 +01:00
|
|
|
{ newScope, stdenv, makeWrapper, makeDesktopItem
|
2012-12-03 16:55:09 +00:00
|
|
|
|
2012-12-03 17:23:49 +00:00
|
|
|
# package customization
|
2012-12-03 16:55:09 +00:00
|
|
|
, channel ? "stable"
|
2014-03-19 11:21:10 +00:00
|
|
|
, enableSELinux ? false
|
2012-12-03 17:23:49 +00:00
|
|
|
, enableNaCl ? false
|
2015-06-19 03:15:49 +01:00
|
|
|
, enableHotwording ? false
|
2014-03-19 11:21:10 +00:00
|
|
|
, useOpenSSL ? false
|
|
|
|
, gnomeSupport ? false
|
|
|
|
, gnomeKeyringSupport ? false
|
2012-12-03 17:23:49 +00:00
|
|
|
, proprietaryCodecs ? true
|
2014-03-19 10:32:39 +00:00
|
|
|
, enablePepperFlash ? false
|
2014-09-30 05:00:47 +01:00
|
|
|
, enableWideVine ? false
|
2014-12-07 13:52:36 +00:00
|
|
|
, cupsSupport ? true
|
2014-03-19 11:21:10 +00:00
|
|
|
, pulseSupport ? false
|
2014-09-15 23:33:25 +01:00
|
|
|
, hiDPISupport ? false
|
chromium: Minimal build (no install) from source.
This only gets chromium to build so far, installation is missing by upstream, so
we need to manually copy the corresponding files. And I guess with nix, we also
need to patch a few paths on installation.
Another issue is that at the moment, a lot of dependencies are used from the
source tree, rather than from the system.
Also, it would be nice to build using LLVM, as it really speeds up compilation a
*LOT* and also has the side effect of resulting in smaller binaries.
Working unit tests would be nice, too. Unfortunately they're quite heavyweight
and take hours to run, so I guess "someday" would be the most appropriate time
to integrate.
Further todo's:
- Allow to disable GConf, GIO and CUPS.
- Option to disable the sandbox (for whatever reason the user might have).
- Integrate gold binutils.
- Pulseaudio support.
- Clearly separate Linux specific stuff.
2012-06-12 09:19:22 +01:00
|
|
|
}:
|
2009-10-30 08:45:58 +00:00
|
|
|
|
chromium: Minimal build (no install) from source.
This only gets chromium to build so far, installation is missing by upstream, so
we need to manually copy the corresponding files. And I guess with nix, we also
need to patch a few paths on installation.
Another issue is that at the moment, a lot of dependencies are used from the
source tree, rather than from the system.
Also, it would be nice to build using LLVM, as it really speeds up compilation a
*LOT* and also has the side effect of resulting in smaller binaries.
Working unit tests would be nice, too. Unfortunately they're quite heavyweight
and take hours to run, so I guess "someday" would be the most appropriate time
to integrate.
Further todo's:
- Allow to disable GConf, GIO and CUPS.
- Option to disable the sandbox (for whatever reason the user might have).
- Integrate gold binutils.
- Pulseaudio support.
- Clearly separate Linux specific stuff.
2012-06-12 09:19:22 +01:00
|
|
|
let
|
2014-03-19 11:21:10 +00:00
|
|
|
callPackage = newScope chromium;
|
2014-03-19 10:32:39 +00:00
|
|
|
|
2014-03-19 11:21:10 +00:00
|
|
|
chromium = {
|
2014-03-24 14:04:41 +00:00
|
|
|
source = callPackage ./source {
|
2014-03-19 11:51:39 +00:00
|
|
|
inherit channel;
|
|
|
|
# XXX: common config
|
|
|
|
inherit useOpenSSL;
|
|
|
|
};
|
|
|
|
|
2014-04-01 06:36:26 +01:00
|
|
|
mkChromiumDerivation = callPackage ./common.nix {
|
2015-06-19 03:15:49 +01:00
|
|
|
inherit enableSELinux enableNaCl enableHotwording useOpenSSL gnomeSupport
|
|
|
|
gnomeKeyringSupport proprietaryCodecs cupsSupport pulseSupport
|
|
|
|
hiDPISupport;
|
2014-03-19 11:57:49 +00:00
|
|
|
};
|
|
|
|
|
2014-06-16 20:35:05 +01:00
|
|
|
browser = callPackage ./browser.nix { };
|
2014-03-22 16:05:14 +00:00
|
|
|
|
2014-03-19 11:57:49 +00:00
|
|
|
plugins = callPackage ./plugins.nix {
|
2014-11-21 15:34:05 +00:00
|
|
|
inherit enablePepperFlash enableWideVine;
|
2014-03-19 10:32:39 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2014-03-16 12:32:39 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
2014-04-27 15:39:11 +01:00
|
|
|
name = "chromium";
|
2015-08-04 22:35:13 +01:00
|
|
|
exec = "chromium %U";
|
2015-08-14 04:19:38 +01:00
|
|
|
icon = "chromium";
|
2014-03-16 12:32:39 +00:00
|
|
|
comment = "An open source web browser from Google";
|
|
|
|
desktopName = "Chromium";
|
|
|
|
genericName = "Web browser";
|
2014-04-20 06:01:37 +01:00
|
|
|
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"
|
2014-11-24 11:10:20 +00:00
|
|
|
"x-scheme-handler/about"
|
|
|
|
"x-scheme-handler/unknown"
|
2014-04-20 06:01:37 +01:00
|
|
|
];
|
2014-03-16 12:32:39 +00:00
|
|
|
categories = "Network;WebBrowser";
|
|
|
|
};
|
|
|
|
|
2014-11-25 09:08:28 +00:00
|
|
|
suffix = if channel != "stable" then "-" + channel else "";
|
|
|
|
|
2014-03-22 16:05:14 +00:00
|
|
|
in stdenv.mkDerivation {
|
2014-11-25 09:08:28 +00:00
|
|
|
name = "chromium${suffix}-${chromium.browser.version}";
|
2014-03-22 16:05:14 +00:00
|
|
|
|
2015-01-26 07:47:42 +00:00
|
|
|
buildInputs = [ makeWrapper ] ++ chromium.plugins.enabledPlugins;
|
2014-03-22 16:05:14 +00:00
|
|
|
|
|
|
|
buildCommand = let
|
|
|
|
browserBinary = "${chromium.browser}/libexec/chromium/chromium";
|
2014-11-25 12:39:16 +00:00
|
|
|
mkEnvVar = key: val: "--set '${key}' '${val}'";
|
|
|
|
envVars = chromium.plugins.settings.envVars or {};
|
|
|
|
flags = chromium.plugins.settings.flags or [];
|
|
|
|
in with stdenv.lib; ''
|
2014-06-30 13:56:10 +01:00
|
|
|
mkdir -p "$out/bin" "$out/share/applications"
|
2012-06-15 09:19:26 +01:00
|
|
|
|
2014-03-22 16:05:14 +00:00
|
|
|
ln -s "${chromium.browser}/share" "$out/share"
|
|
|
|
makeWrapper "${browserBinary}" "$out/bin/chromium" \
|
2014-11-25 12:39:16 +00:00
|
|
|
${concatStrings (mapAttrsToList mkEnvVar envVars)} \
|
|
|
|
--add-flags "${concatStringsSep " " flags}"
|
2012-06-15 09:19:26 +01:00
|
|
|
|
2014-09-19 06:51:11 +01:00
|
|
|
ln -s "$out/bin/chromium" "$out/bin/chromium-browser"
|
2014-04-27 15:39:11 +01:00
|
|
|
ln -s "${chromium.browser}/share/icons" "$out/share/icons"
|
2014-03-16 12:32:39 +00:00
|
|
|
cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
|
2014-03-22 16:05:14 +00:00
|
|
|
'';
|
2014-03-23 18:48:53 +00:00
|
|
|
|
2014-03-24 11:02:49 +00:00
|
|
|
inherit (chromium.browser) meta packageName;
|
2014-04-01 06:36:26 +01:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
mkDerivation = chromium.mkChromiumDerivation;
|
|
|
|
};
|
2014-03-22 16:05:14 +00:00
|
|
|
}
|