chromium: Add support for grsecurity
This commit is contained in:
parent
255d86ea99
commit
8d54dc6d13
|
@ -1,11 +1,11 @@
|
||||||
{ stdenv, mkChromiumDerivation }:
|
{ stdenv, mkChromiumDerivation, arch }:
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
mkChromiumDerivation (base: rec {
|
mkChromiumDerivation (base: rec {
|
||||||
name = "chromium-browser";
|
name = "chromium-browser";
|
||||||
packageName = "chromium";
|
packageName = "chromium";
|
||||||
buildTargets = [ "chrome" ];
|
buildTargets = [ "mksnapshot.${arch}" "chrome" ];
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
ensureDir "$libExecPath"
|
ensureDir "$libExecPath"
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
|
|
||||||
, source
|
, source
|
||||||
, plugins
|
, plugins
|
||||||
|
, archInfo
|
||||||
}:
|
}:
|
||||||
|
|
||||||
buildFun:
|
buildFun:
|
||||||
|
@ -172,13 +173,7 @@ let
|
||||||
# enable support for the H.264 codec
|
# enable support for the H.264 codec
|
||||||
proprietary_codecs = true;
|
proprietary_codecs = true;
|
||||||
ffmpeg_branding = "Chrome";
|
ffmpeg_branding = "Chrome";
|
||||||
} // optionalAttrs (stdenv.system == "x86_64-linux") {
|
} // archInfo // (extraAttrs.gypFlags or {}));
|
||||||
target_arch = "x64";
|
|
||||||
python_arch = "x86-64";
|
|
||||||
} // optionalAttrs (stdenv.system == "i686-linux") {
|
|
||||||
target_arch = "ia32";
|
|
||||||
python_arch = "ia32";
|
|
||||||
} // (extraAttrs.gypFlags or {}));
|
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
# This is to ensure expansion of $out.
|
# This is to ensure expansion of $out.
|
||||||
|
@ -190,14 +185,21 @@ let
|
||||||
buildPhase = let
|
buildPhase = let
|
||||||
CC = "${gcc}/bin/gcc";
|
CC = "${gcc}/bin/gcc";
|
||||||
CXX = "${gcc}/bin/g++";
|
CXX = "${gcc}/bin/g++";
|
||||||
in ''
|
buildCommand = target: ''
|
||||||
CC="${CC}" CC_host="${CC}" \
|
CC="${CC}" CC_host="${CC}" \
|
||||||
CXX="${CXX}" CXX_host="${CXX}" \
|
CXX="${CXX}" CXX_host="${CXX}" \
|
||||||
LINK_host="${CXX}" \
|
LINK_host="${CXX}" \
|
||||||
"${ninja}/bin/ninja" -C "${buildPath}" \
|
"${ninja}/bin/ninja" -C "${buildPath}" \
|
||||||
-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
|
-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
|
||||||
${concatStringsSep " " (extraAttrs.buildTargets or [])}
|
${target}
|
||||||
|
|
||||||
|
if [[ "${target}" == mksnapshot.* || "${target}" == "chrome" ]]; then
|
||||||
|
paxmark m "${buildPath}/${target}"
|
||||||
|
fi
|
||||||
'';
|
'';
|
||||||
|
targets = extraAttrs.buildTargets or [];
|
||||||
|
commands = map buildCommand targets;
|
||||||
|
in concatStringsSep "\n" commands;
|
||||||
};
|
};
|
||||||
|
|
||||||
# Remove some extraAttrs we supplied to the base attributes already.
|
# Remove some extraAttrs we supplied to the base attributes already.
|
||||||
|
|
|
@ -15,6 +15,14 @@
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
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;
|
callPackage = newScope chromium;
|
||||||
|
|
||||||
chromium = {
|
chromium = {
|
||||||
|
@ -27,10 +35,13 @@ let
|
||||||
mkChromiumDerivation = callPackage ./common.nix {
|
mkChromiumDerivation = callPackage ./common.nix {
|
||||||
inherit enableSELinux enableNaCl useOpenSSL gnomeSupport
|
inherit enableSELinux enableNaCl useOpenSSL gnomeSupport
|
||||||
gnomeKeyringSupport proprietaryCodecs cupsSupport
|
gnomeKeyringSupport proprietaryCodecs cupsSupport
|
||||||
pulseSupport;
|
pulseSupport archInfo;
|
||||||
|
};
|
||||||
|
|
||||||
|
browser = callPackage ./browser.nix {
|
||||||
|
arch = archInfo.target_arch;
|
||||||
};
|
};
|
||||||
|
|
||||||
browser = callPackage ./browser.nix { };
|
|
||||||
sandbox = callPackage ./sandbox.nix { };
|
sandbox = callPackage ./sandbox.nix { };
|
||||||
|
|
||||||
plugins = callPackage ./plugins.nix {
|
plugins = callPackage ./plugins.nix {
|
||||||
|
|
Loading…
Reference in New Issue