mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 03:17:13 +00:00
111caaad53
This results in a new function called mkChromiumDerivation, which can be used to easily build packages that are based on the Chromium source tree. We pass through this function as mkDerivation in the chromium wrappre, so in the end if you want to create such a package, something like: chromium.mkDerivation (base: { name = "your-shiny-package-based-on-chromium"; ... }) will suffice. Of course, this is only the first step towards this functionality, because right now I'm not even sure the Chromium browser itself will build. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
63 lines
1.5 KiB
Nix
63 lines
1.5 KiB
Nix
{ newScope, stdenv, makeWrapper
|
|
|
|
# package customization
|
|
, channel ? "stable"
|
|
, enableSELinux ? false
|
|
, enableNaCl ? false
|
|
, useOpenSSL ? false
|
|
, gnomeSupport ? false
|
|
, gnomeKeyringSupport ? false
|
|
, proprietaryCodecs ? true
|
|
, enablePepperFlash ? false
|
|
, enablePepperPDF ? false
|
|
, cupsSupport ? false
|
|
, pulseSupport ? 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;
|
|
};
|
|
|
|
browser = callPackage ./browser.nix { };
|
|
sandbox = callPackage ./sandbox.nix { };
|
|
|
|
plugins = callPackage ./plugins.nix {
|
|
inherit enablePepperFlash enablePepperPDF;
|
|
};
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
|
name = "chromium-${channel}-${chromium.browser.version}";
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
buildCommand = let
|
|
browserBinary = "${chromium.browser}/libexec/chromium/chromium";
|
|
sandboxBinary = "${chromium.sandbox}/bin/chromium-sandbox";
|
|
in ''
|
|
ensureDir "$out/bin"
|
|
ln -s "${chromium.browser}/share" "$out/share"
|
|
makeWrapper "${browserBinary}" "$out/bin/chromium" \
|
|
--set CHROMIUM_SANDBOX_BINARY_PATH "${sandboxBinary}" \
|
|
--add-flags "${chromium.plugins.flagsEnabled}"
|
|
'';
|
|
|
|
inherit (chromium.browser) meta packageName;
|
|
|
|
passthru = {
|
|
mkDerivation = chromium.mkChromiumDerivation;
|
|
};
|
|
}
|