1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-27 16:11:58 +00:00
nixpkgs/pkgs/tools/system/minijail/default.nix
Matthew Bauer b39bc2943b
Merge pull request #74860 from alyssais/minijail
minijail: install .pc files and scoped_minijail.h
2019-12-17 14:48:02 -05:00

46 lines
1.2 KiB
Nix

{ stdenv, fetchFromGitiles, libcap }:
stdenv.mkDerivation rec {
pname = "minijail";
version = "android-10.0.0_r9";
src = fetchFromGitiles {
url = "https://android.googlesource.com/platform/external/minijail";
rev = version;
sha256 = "0gcfsyim1krrddcklydqfxl8mamaxgail2xl5qp9yclq60km8f22";
};
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
'';
installPhase = ''
mkdir -p $out/lib/pkgconfig $out/include/chromeos $out/bin
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
'';
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;
};
}