nixpkgs/pkgs/applications/networking/browsers/chromium/sandbox.nix
aszlig 45b69d6dba
chromium: Split sandbox off the main output path.
Now the chromium derivation produces an extra output path for the
sandbox in order to be properly used as a setuid wrapper in <nixos>
without the need to include the full Chromium package.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
2013-09-27 15:23:30 +02:00

20 lines
414 B
Nix

{ stdenv, src, binary }:
stdenv.mkDerivation {
name = "chromium-sandbox-${src.version}";
inherit src;
patchPhase = ''
sed -i -e '/#include.*base_export/c \
#define BASE_EXPORT __attribute__((visibility("default")))
' linux/suid/*.[hc]
'';
buildPhase = ''
gcc -Wall -std=gnu99 -o sandbox linux/suid/*.c
'';
installPhase = ''
install -svD sandbox "$out/bin/${binary}"
'';
}