Commit 8d54dc6d authored by Ricardo M. Correia's avatar Ricardo M. Correia
Browse files

chromium: Add support for grsecurity

parent 255d86ea
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
{ stdenv, mkChromiumDerivation }:
{ stdenv, mkChromiumDerivation, arch }:

with stdenv.lib;

mkChromiumDerivation (base: rec {
  name = "chromium-browser";
  packageName = "chromium";
  buildTargets = [ "chrome" ];
  buildTargets = [ "mksnapshot.${arch}" "chrome" ];

  installPhase = ''
    ensureDir "$libExecPath"
+17 −15
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

, source
, plugins
, archInfo
}:

buildFun:
@@ -172,13 +173,7 @@ let
      # enable support for the H.264 codec
      proprietary_codecs = true;
      ffmpeg_branding = "Chrome";
    } // 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 {}));
    } // archInfo // (extraAttrs.gypFlags or {}));

    configurePhase = ''
      # This is to ensure expansion of $out.
@@ -190,14 +185,21 @@ let
    buildPhase = let
      CC = "${gcc}/bin/gcc";
      CXX = "${gcc}/bin/g++";
    in ''
      buildCommand = target: ''
        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 \
          ${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.
+13 −2
Original line number Diff line number Diff line
@@ -15,6 +15,14 @@
}:

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 = {
@@ -27,10 +35,13 @@ let
    mkChromiumDerivation = callPackage ./common.nix {
      inherit enableSELinux enableNaCl useOpenSSL gnomeSupport
              gnomeKeyringSupport proprietaryCodecs cupsSupport
              pulseSupport;
              pulseSupport archInfo;
    };

    browser = callPackage ./browser.nix {
      arch = archInfo.target_arch;
    };

    browser = callPackage ./browser.nix { };
    sandbox = callPackage ./sandbox.nix { };

    plugins = callPackage ./plugins.nix {