3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/system/minijail/default.nix

46 lines
1.2 KiB
Nix
Raw Normal View History

{ stdenv, fetchFromGitiles, libcap }:
2017-11-24 18:07:36 +00:00
stdenv.mkDerivation rec {
pname = "minijail";
version = "android-10.0.0_r9";
2017-11-24 18:07:36 +00:00
src = fetchFromGitiles {
2017-11-24 18:07:36 +00:00
url = "https://android.googlesource.com/platform/external/minijail";
rev = version;
sha256 = "0gcfsyim1krrddcklydqfxl8mamaxgail2xl5qp9yclq60km8f22";
2017-11-24 18:07:36 +00: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
'';
postPatch = ''
patchShebangs platform2_preinstall.sh
'';
postBuild = ''
./platform2_preinstall.sh ${version} $out/include/chromeos
'';
2017-11-24 18:07:36 +00:00
installPhase = ''
mkdir -p $out/lib/pkgconfig $out/include/chromeos $out/bin
2017-11-24 18:07:36 +00:00
cp -v *.so $out/lib
cp -v *.pc $out/lib/pkgconfig
cp -v libminijail.h scoped_minijail.h $out/include/chromeos
cp -v minijail0 $out/bin
2017-11-24 18:07:36 +00:00
'';
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;
};
}