diff options
author | aszlig <aszlig@redmoonstudios.org> | 2014-06-16 21:35:05 +0200 |
---|---|---|
committer | aszlig <aszlig@redmoonstudios.org> | 2014-06-19 01:51:34 +0200 |
commit | 3d665679c138874ed666c240e4b84435bbd7fe4d (patch) | |
tree | ecb134e09832e47ac291461290681dc73e7a28d9 | |
parent | 158068849001b961cb8dc6a9e7ca20e9fad67549 (diff) | |
download | nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.tar nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.tar.gz nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.tar.bz2 nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.tar.lz nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.tar.xz nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.tar.zst nixlib-3d665679c138874ed666c240e4b84435bbd7fe4d.zip |
chromium: Properly implement mksnapshot target.
Let's ensure we do all architecture-dependant stuff inside mkChromiumDerivation and not pass archInfo around, so we can properly decouple it from the main function. This partially reverts 8d54dc6d13ac3b42e45d95a2cfb971e7c01ad39c. The main reason for doing this is because the architecture information is no longer required in Chromium 37, so let's uglify and XXX it in common.nix and remove it once version 37 hits the stable channel. Signed-off-by: aszlig <aszlig@redmoonstudios.org>
3 files changed, 20 insertions, 23 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index 2a88ed8db659..146daa26e356 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -1,11 +1,11 @@ -{ stdenv, mkChromiumDerivation, arch }: +{ stdenv, mkChromiumDerivation }: with stdenv.lib; mkChromiumDerivation (base: rec { name = "chromium-browser"; packageName = "chromium"; - buildTargets = [ "mksnapshot.${arch}" "chrome" ]; + buildTargets = [ "mksnapshot" "chrome" ]; installPhase = '' ensureDir "$libExecPath" diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 301950e3f44b..631f12143d8b 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -30,7 +30,6 @@ , source , plugins -, archInfo }: buildFun: @@ -173,7 +172,13 @@ let # enable support for the H.264 codec proprietary_codecs = true; ffmpeg_branding = "Chrome"; - } // archInfo // (extraAttrs.gypFlags or {})); + } // optionalAttrs (stdenv.system == "x86_64-linux") { + target_arch = "x64"; + python_arch = "x86-64"; + } // optionalAttrs (stdenv.system == "i686-linux") { + target_arch = "ia32"; + python_arch = "ia32"; + } // (extraAttrs.gypFlags or {})); configurePhase = '' # This is to ensure expansion of $out. @@ -185,17 +190,20 @@ let buildPhase = let CC = "${gcc}/bin/gcc"; CXX = "${gcc}/bin/g++"; - buildCommand = target: '' + buildCommand = target: let + # XXX: Only needed for version 36 and older! + targetSuffix = optionalString + (versionOlder source.version "37.0.0.0" && target == "mksnapshot") + (if stdenv.is64bit then ".x64" else ".ia32"); + in '' CC="${CC}" CC_host="${CC}" \ CXX="${CXX}" CXX_host="${CXX}" \ LINK_host="${CXX}" \ "${ninja}/bin/ninja" -C "${buildPath}" \ -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \ - ${target} - - if [[ "${target}" == mksnapshot.* || "${target}" == "chrome" ]]; then - paxmark m "${buildPath}/${target}" - fi + "${target}${targetSuffix}" + '' + optionalString (target == "mksnapshot" || target == "chrome") '' + paxmark m "${buildPath}/${target}${targetSuffix}" ''; targets = extraAttrs.buildTargets or []; commands = map buildCommand targets; diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index efb0a95e9db2..44fd3c69e537 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -15,14 +15,6 @@ }: let - archInfo = with stdenv.lib; optionalAttrs (stdenv.system == "i686-linux") { - target_arch = "ia32"; - python_arch = "ia32"; - } // optionalAttrs (stdenv.system == "x86_64-linux") { - target_arch = "x64"; - python_arch = "x86-64"; - }; - callPackage = newScope chromium; chromium = { @@ -35,13 +27,10 @@ let mkChromiumDerivation = callPackage ./common.nix { inherit enableSELinux enableNaCl useOpenSSL gnomeSupport gnomeKeyringSupport proprietaryCodecs cupsSupport - pulseSupport archInfo; - }; - - browser = callPackage ./browser.nix { - arch = archInfo.target_arch; + pulseSupport; }; + browser = callPackage ./browser.nix { }; sandbox = callPackage ./sandbox.nix { }; plugins = callPackage ./plugins.nix { |