From e7a57971c19bb66fc5e851f9348aa25a8dc52a5f Mon Sep 17 00:00:00 2001 From: aszlig Date: Mon, 27 May 2013 02:32:33 +0200 Subject: [PATCH] chromium: Switch build system to ninja. Wanted to do this a long time ago, but never had a reason to do it. But with Chromium 29 having no make target for chrome_sandbox, we now use ninja as well as the official build and most other distributions. The whole build/make flags cruft is now integrated into one buildPhase override and we just call ninja there by exporting the specific variables. And this also makes enableParallelBuilding obsolete, as we use NIX_BUILD_CORES directly now. Signed-off-by: aszlig --- .../networking/browsers/chromium/default.nix | 29 +++++++------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index 33140c481f4..97dd719e7fc 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, makeWrapper, which +{ stdenv, fetchurl, makeWrapper, ninja, which # default dependencies , bzip2, flac, speex @@ -165,28 +165,21 @@ in stdenv.mkDerivation rec { target_arch = "ia32"; }); - enableParallelBuilding = true; - configurePhase = '' - python build/gyp_chromium --depth "$(pwd)" ${gypFlags} + GYP_GENERATORS=ninja python build/gyp_chromium --depth "$(pwd)" ${gypFlags} ''; - makeFlags = let + buildPhase = let CC = "${gcc}/bin/gcc"; CXX = "${gcc}/bin/g++"; - in [ - "CC=${CC}" - "CXX=${CXX}" - "CC.host=${CC}" - "CXX.host=${CXX}" - "LINK.host=${CXX}" - ]; - - buildFlags = [ - "BUILDTYPE=${buildType}" - "library=shared_library" - "chrome" - ] ++ optional (!enableSELinux) "chrome_sandbox"; + in '' + CC="${CC}" CC_host="${CC}" \ + CXX="${CXX}" CXX_host="${CXX}" \ + LINK_host="${CXX}" \ + "${ninja}/bin/ninja" -C "out/${buildType}" \ + -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \ + chrome ${optionalString (!enableSELinux) "chrome_sandbox"} + ''; installPhase = '' mkdir -vp "${libExecPath}"