2022-02-10 20:34:41 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-10-08 15:17:17 +00:00
|
|
|
, talloc
|
|
|
|
, pkg-config
|
|
|
|
, libarchive
|
|
|
|
, git
|
|
|
|
, ncurses
|
|
|
|
, docutils, swig, python3, coreutils, enablePython ? true }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "proot";
|
2022-02-10 20:34:41 +00:00
|
|
|
version = "5.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "proot";
|
|
|
|
owner = "proot-me";
|
2021-10-08 15:17:17 +00:00
|
|
|
rev = "v${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
sha256 = "sha256-89d1a5QBusra0vd3Ph0lQalXrblBwogi6bNgvvpQL+Q=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/GNUmakefile \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
|
|
|
# our cross machinery defines $CC and co just right
|
|
|
|
sed -i /CROSS_COMPILE/d src/GNUmakefile
|
|
|
|
'';
|
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
buildInputs = [ ncurses libarchive talloc ] ++ lib.optional enablePython python3;
|
|
|
|
nativeBuildInputs = [ pkg-config docutils ] ++ lib.optional enablePython swig;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
makeFlags = [ "-C src" ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
make -C doc proot/man.1
|
|
|
|
'';
|
|
|
|
|
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 doc/proot/man.1 $out/share/man/man1/proot.1
|
|
|
|
'';
|
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
# proot provides tests with `make -C test` however they do not run in the sandbox
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://proot-me.github.io";
|
|
|
|
description = "User-space implementation of chroot, mount --bind and binfmt_misc";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
|
|
|
maintainers = with maintainers; [ ianwookim makefu veprbl dtzWill ];
|
|
|
|
};
|
|
|
|
}
|