2019-12-02 22:29:40 +00:00
|
|
|
{ stdenv, fetchFromGitiles, libcap }:
|
2017-11-24 18:07:36 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-11-02 13:03:09 +00:00
|
|
|
pname = "minijail";
|
|
|
|
version = "android-10.0.0_r9";
|
2017-11-24 18:07:36 +00:00
|
|
|
|
2019-12-02 22:29:40 +00:00
|
|
|
src = fetchFromGitiles {
|
2017-11-24 18:07:36 +00:00
|
|
|
url = "https://android.googlesource.com/platform/external/minijail";
|
|
|
|
rev = version;
|
2019-11-02 13:03:09 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2019-12-02 16:43:40 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs platform2_preinstall.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
./platform2_preinstall.sh ${version} $out/include/chromeos
|
|
|
|
'';
|
|
|
|
|
2017-11-24 18:07:36 +00:00
|
|
|
installPhase = ''
|
2019-12-02 16:43:40 +00:00
|
|
|
mkdir -p $out/lib/pkgconfig $out/include/chromeos $out/bin
|
2017-11-24 18:07:36 +00:00
|
|
|
cp -v *.so $out/lib
|
2019-12-02 16:43:40 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|