2014-04-20 07:01:37 +02:00
|
|
|
{ newScope, stdenv, makeWrapper, makeDesktopItem
|
2012-12-03 17:55:09 +01:00
|
|
|
|
2012-12-03 18:23:49 +01:00
|
|
|
# package customization
|
2012-12-03 17:55:09 +01:00
|
|
|
, channel ? "stable"
|
2014-03-19 12:21:10 +01:00
|
|
|
, enableSELinux ? false
|
2012-12-03 18:23:49 +01:00
|
|
|
, enableNaCl ? false
|
2014-03-19 12:21:10 +01:00
|
|
|
, useOpenSSL ? false
|
|
|
|
, gnomeSupport ? false
|
|
|
|
, gnomeKeyringSupport ? false
|
2012-12-03 18:23:49 +01:00
|
|
|
, proprietaryCodecs ? true
|
2014-03-19 11:32:39 +01:00
|
|
|
, enablePepperFlash ? false
|
|
|
|
, enablePepperPDF ? false
|
2014-09-30 06:00:47 +02:00
|
|
|
, enableWideVine ? false
|
2012-12-03 18:23:49 +01:00
|
|
|
, cupsSupport ? false
|
2014-03-19 12:21:10 +01:00
|
|
|
, pulseSupport ? false
|
2014-09-16 00:33:25 +02: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 10:19:22 +02:00
|
|
|
}:
|
2009-10-30 09:45:58 +01: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 10:19:22 +02:00
|
|
|
let
|
2014-03-19 12:21:10 +01:00
|
|
|
callPackage = newScope chromium;
|
2014-03-19 11:32:39 +01:00
|
|
|
|
2014-03-19 12:21:10 +01:00
|
|
|
chromium = {
|
2014-03-24 15:04:41 +01:00
|
|
|
source = callPackage ./source {
|
2014-03-19 12:51:39 +01:00
|
|
|
inherit channel;
|
|
|
|
# XXX: common config
|
|
|
|
inherit useOpenSSL;
|
|
|
|
};
|
|
|
|
|
2014-04-01 07:36:26 +02:00
|
|
|
mkChromiumDerivation = callPackage ./common.nix {
|
2014-03-19 12:51:39 +01:00
|
|
|
inherit enableSELinux enableNaCl useOpenSSL gnomeSupport
|
2014-03-19 12:57:49 +01:00
|
|
|
gnomeKeyringSupport proprietaryCodecs cupsSupport
|
2014-09-16 00:33:25 +02:00
|
|
|
pulseSupport hiDPISupport;
|
2014-03-19 12:57:49 +01:00
|
|
|
};
|
|
|
|
|
2014-06-16 21:35:05 +02:00
|
|
|
browser = callPackage ./browser.nix { };
|
2014-03-22 17:05:14 +01:00
|
|
|
sandbox = callPackage ./sandbox.nix { };
|
|
|
|
|
2014-03-19 12:57:49 +01:00
|
|
|
plugins = callPackage ./plugins.nix {
|
2014-09-30 06:00:47 +02:00
|
|
|
inherit enablePepperFlash enablePepperPDF enableWideVine;
|
2014-03-19 11:32:39 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2014-03-16 13:32:39 +01:00
|
|
|
desktopItem = makeDesktopItem {
|
2014-04-27 16:39:11 +02:00
|
|
|
name = "chromium";
|
2014-03-16 13:32:39 +01:00
|
|
|
exec = "chromium";
|
2014-04-27 16:39:11 +02:00
|
|
|
icon = "${chromium.browser}/share/icons/hicolor/48x48/apps/chromium.png";
|
2014-03-16 13:32:39 +01:00
|
|
|
comment = "An open source web browser from Google";
|
|
|
|
desktopName = "Chromium";
|
|
|
|
genericName = "Web browser";
|
2014-04-20 07:01:37 +02: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-03-16 13:32:39 +01:00
|
|
|
categories = "Network;WebBrowser";
|
|
|
|
};
|
|
|
|
|
2014-03-22 17:05:14 +01:00
|
|
|
in stdenv.mkDerivation {
|
2014-10-03 17:47:30 +02:00
|
|
|
name = "chromium${if channel != "stable" then "-" + channel else ""}-${chromium.browser.version}";
|
2014-03-22 17:05:14 +01:00
|
|
|
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildCommand = let
|
|
|
|
browserBinary = "${chromium.browser}/libexec/chromium/chromium";
|
|
|
|
sandboxBinary = "${chromium.sandbox}/bin/chromium-sandbox";
|
|
|
|
in ''
|
2014-06-30 14:56:10 +02:00
|
|
|
mkdir -p "$out/bin" "$out/share/applications"
|
2012-06-15 10:19:26 +02:00
|
|
|
|
2014-03-22 17:05:14 +01:00
|
|
|
ln -s "${chromium.browser}/share" "$out/share"
|
|
|
|
makeWrapper "${browserBinary}" "$out/bin/chromium" \
|
|
|
|
--set CHROMIUM_SANDBOX_BINARY_PATH "${sandboxBinary}" \
|
|
|
|
--add-flags "${chromium.plugins.flagsEnabled}"
|
2012-06-15 10:19:26 +02:00
|
|
|
|
2014-09-19 07:51:11 +02:00
|
|
|
ln -s "$out/bin/chromium" "$out/bin/chromium-browser"
|
2014-04-27 16:39:11 +02:00
|
|
|
ln -s "${chromium.browser}/share/icons" "$out/share/icons"
|
2014-03-16 13:32:39 +01:00
|
|
|
cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
|
2014-03-22 17:05:14 +01:00
|
|
|
'';
|
2014-03-23 19:48:53 +01:00
|
|
|
|
2014-03-24 12:02:49 +01:00
|
|
|
inherit (chromium.browser) meta packageName;
|
2014-04-01 07:36:26 +02:00
|
|
|
|
|
|
|
passthru = {
|
|
|
|
mkDerivation = chromium.mkChromiumDerivation;
|
|
|
|
};
|
2014-03-22 17:05:14 +01:00
|
|
|
}
|