From 2571488e6a213bc1f3897db754bfd2c3ecefcc7d Mon Sep 17 00:00:00 2001 From: aszlig Date: Fri, 15 Jun 2012 11:06:07 +0200 Subject: [PATCH] chromium: Clean up build flags. This also includes setting compiler architectures and paths. --- .../networking/browsers/chromium/default.nix | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index f5aea5903697..87dce9841e2c 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -47,14 +47,20 @@ in stdenv.mkDerivation rec { prePatch = "patchShebangs ."; - gypFlags = mkGypFlags { + gypFlags = mkGypFlags ({ linux_use_gold_binary = false; linux_use_gold_flags = false; proprietary_codecs = false; use_gnome_keyring = gnomeKeyringSupport; disable_nacl = !naclSupport; use_cups = false; - }; + } // stdenv.lib.optionalAttrs (stdenv.system == "x86_64-linux") { + target_arch = "x64"; + } // stdenv.lib.optionalAttrs (stdenv.system == "i686-linux") { + target_arch = "ia32"; + }); + + buildType = "Release"; /* TODO: use_system_bzip2 = true; @@ -80,11 +86,16 @@ in stdenv.mkDerivation rec { */ configurePhase = '' - python build/gyp_chromium --depth $(pwd) ${gypFlags} + python build/gyp_chromium --depth "$(pwd)" ${gypFlags} ''; + extraBuildFlags = let + CC = "${gcc}/bin/gcc"; + CXX = "${gcc}/bin/g++"; + in "CC=\"${CC}\" CXX=\"${CXX}\" CC.host=\"${CC}\" CXX.host=\"${CXX}\" LINK.host=\"${CXX}\""; + buildPhase = '' - make CC=${gcc}/bin/gcc BUILDTYPE=Release library=shared_library chrome chrome_sandbox + make ${extraBuildFlags} BUILDTYPE=${buildType} library=shared_library chrome chrome_sandbox ''; installPhase = ''