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 8d54dc6d13
.
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>
This commit is contained in:
parent
1580688490
commit
3d665679c1
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue