about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authoraszlig <aszlig@redmoonstudios.org>2013-05-27 02:32:33 +0200
committeraszlig <aszlig@redmoonstudios.org>2013-05-27 10:17:59 +0200
commite7a57971c19bb66fc5e851f9348aa25a8dc52a5f (patch)
treeb08a4a5105b9697f850f642ea2c79f0e8f3776f7 /pkgs/applications
parentbdeee9bcc4b34de7d6592738d86bc1cfd79bd8a9 (diff)
downloadnixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.tar
nixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.tar.gz
nixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.tar.bz2
nixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.tar.lz
nixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.tar.xz
nixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.tar.zst
nixlib-e7a57971c19bb66fc5e851f9348aa25a8dc52a5f.zip
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 <aszlig@redmoonstudios.org>
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix29
1 files changed, 11 insertions, 18 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 33140c481f47..97dd719e7fc9 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}"