2022-07-16 15:34:58 +02:00
|
|
|
{ stdenv, lib, fetchFromGitiles, libcap }:
|
2017-11-24 19:07:36 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-11-02 14:03:09 +01:00
|
|
|
pname = "minijail";
|
2022-07-16 17:05:39 +02:00
|
|
|
version = "18";
|
2017-11-24 19:07:36 +01:00
|
|
|
|
2019-12-02 23:29:40 +01:00
|
|
|
src = fetchFromGitiles {
|
2017-11-24 19:07:36 +01:00
|
|
|
url = "https://android.googlesource.com/platform/external/minijail";
|
2020-03-27 09:43:04 +01:00
|
|
|
rev = "linux-v${version}";
|
2022-07-16 17:05:39 +02:00
|
|
|
sha256 = "sha256-OpwzISZ5iZNQvJAX7UJJ4gELEaVfcQgY9cqMM0YvBzc=";
|
2017-11-24 19:07:36 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ libcap ];
|
|
|
|
|
2022-07-16 17:05:39 +02:00
|
|
|
makeFlags = [ "ECHO=echo" "LIBDIR=$(out)/lib" ];
|
2017-11-24 19:07:36 +01:00
|
|
|
|
2019-12-02 17:43:40 +01:00
|
|
|
postPatch = ''
|
2022-07-16 17:05:39 +02:00
|
|
|
substituteInPlace Makefile --replace /bin/echo echo
|
2019-12-02 17:43:40 +01:00
|
|
|
patchShebangs platform2_preinstall.sh
|
|
|
|
'';
|
|
|
|
|
2017-11-24 19:07:36 +01:00
|
|
|
installPhase = ''
|
2020-03-27 09:46:03 +01:00
|
|
|
./platform2_preinstall.sh ${version} $out/include/chromeos
|
|
|
|
|
|
|
|
mkdir -p $out/lib/pkgconfig $out/include/chromeos $out/bin \
|
|
|
|
$out/share/minijail
|
|
|
|
|
2017-11-24 19:07:36 +01:00
|
|
|
cp -v *.so $out/lib
|
2019-12-02 17:43:40 +01: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 19:07:36 +01:00
|
|
|
'';
|
|
|
|
|
2021-08-17 19:42:41 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-03-27 09:46:03 +01:00
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://android.googlesource.com/platform/external/minijail/";
|
2017-11-24 19:07:36 +01:00
|
|
|
description = "Sandboxing library and application using Linux namespaces and capabilities";
|
2022-07-16 17:04:51 +02:00
|
|
|
changelog = "https://android.googlesource.com/platform/external/minijail/+/refs/tags/linux-v${version}";
|
2020-03-27 09:46:03 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ pcarrier qyliss ];
|
|
|
|
platforms = platforms.linux;
|
2017-11-24 19:07:36 +01:00
|
|
|
};
|
|
|
|
}
|