nixpkgs/pkgs/tools/system/minijail/default.nix

40 lines
1 KiB
Nix
Raw Normal View History

2017-11-24 19:07:36 +01:00
{ stdenv, fetchgit, libcap }:
stdenv.mkDerivation rec {
shortname = "minijail";
name = "${shortname}-${version}";
version = "android-9.0.0_r3";
2017-11-24 19:07:36 +01:00
src = fetchgit {
url = "https://android.googlesource.com/platform/external/minijail";
rev = version;
sha256 = "1g1g52s3q61amcnx8cv1332sbixpck1bmjzgsrjiw5ix7chrzkp2";
2017-11-24 19:07:36 +01:00
};
buildInputs = [ libcap ];
makeFlags = [ "LIBDIR=$(out)/lib" ];
preConfigure = ''
substituteInPlace common.mk --replace /bin/echo echo
sed -i '/#include <asm\/siginfo.h>/ d' signal_handler.c
'';
installPhase = ''
mkdir -p $out/lib
cp -v *.so $out/lib
mkdir -p $out/include
cp -v libminijail.h $out/include
mkdir -p $out/bin
cp minijail0 $out/bin
'';
meta = {
homepage = https://android.googlesource.com/platform/external/minijail/;
description = "Sandboxing library and application using Linux namespaces and capabilities";
license = stdenv.lib.licenses.bsd3;
maintainers = with stdenv.lib.maintainers; [pcarrier];
platforms = stdenv.lib.platforms.linux;
};
}