chromium: split the sandbox into a separate output

Related to #17460 and 66d5edf
Triggers a rebuild of Chromium
This commit is contained in:
obadz 2016-08-06 10:09:40 +01:00
parent 66d5edf654
commit 231ed9edd9
2 changed files with 8 additions and 4 deletions

View file

@ -224,6 +224,13 @@ let
commands = map buildCommand targets;
in concatStringsSep "\n" commands;
outputs = ["out" "sandbox"];
postInstall = ''
mkdir -p "$sandbox/bin"
mv -v "$out/libexec/chromium/chrome-sandbox" "$sandbox/bin/${sandboxExecutableName}"
'';
passthru = { inherit sandboxExecutableName; };
};

View file

@ -73,7 +73,6 @@ in stdenv.mkDerivation {
buildCommand = let
browserBinary = "${chromium.browser}/libexec/chromium/chromium";
getWrapperFlags = plugin: "$(< \"${plugin}/nix-support/wrapper-flags\")";
sandboxExecutableSourcePath = "${chromium.browser}/libexec/chromium/chrome-sandbox";
launchScript = writeScript "chromium" ''
#! ${stdenv.shell}
@ -100,9 +99,7 @@ in stdenv.mkDerivation {
substituteInPlace $out/bin/chromium --replace @out@ $out --replace @sandbox@ $sandbox
chmod 755 "$out/bin/chromium"
mkdir -p "$sandbox/bin"
[ -x "${sandboxExecutableSourcePath}" ] || exit 1
ln -sv "${sandboxExecutableSourcePath}" "$sandbox/bin/${sandboxExecutableName}"
ln -sv "${chromium.browser.sandbox}" "$sandbox"
ln -s "$out/bin/chromium" "$out/bin/chromium-browser"
ln -s "${chromium.browser}/share/icons" "$out/share/icons"