2022-02-02 03:12:06 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub
|
2021-10-01 20:01:38 +00:00
|
|
|
, talloc
|
|
|
|
, pkg-config
|
|
|
|
, ncurses
|
|
|
|
, docutils, swig, python3, coreutils, enablePython ? true }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-03-10 00:38:22 +00:00
|
|
|
pname = "proot";
|
2023-05-18 03:13:25 +00:00
|
|
|
version = "5.4.0";
|
2014-10-07 00:37:23 +00:00
|
|
|
|
2016-02-25 01:28:33 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
repo = "proot";
|
2019-01-22 17:16:47 +00:00
|
|
|
owner = "proot-me";
|
2021-10-01 20:01:38 +00:00
|
|
|
rev = "v${version}";
|
2023-05-18 03:13:25 +00:00
|
|
|
sha256 = "sha256-Z9Y7ccWp5KEVuo9xfHcgo58XqYVdFo7ck1jH7cnT2KA=";
|
2014-10-07 00:37:23 +00:00
|
|
|
};
|
|
|
|
|
2019-03-10 00:38:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/GNUmakefile \
|
|
|
|
--replace /bin/echo ${coreutils}/bin/echo
|
2019-03-28 20:57:51 +00:00
|
|
|
# our cross machinery defines $CC and co just right
|
|
|
|
sed -i /CROSS_COMPILE/d src/GNUmakefile
|
2019-03-10 00:38:22 +00:00
|
|
|
'';
|
2016-02-25 01:22:43 +00:00
|
|
|
|
2022-07-30 14:57:05 +00:00
|
|
|
buildInputs = [ ncurses talloc ] ++ lib.optional enablePython python3;
|
2021-10-01 20:01:38 +00:00
|
|
|
nativeBuildInputs = [ pkg-config docutils ] ++ lib.optional enablePython swig;
|
2014-10-07 00:37:23 +00:00
|
|
|
|
2019-03-10 00:38:22 +00:00
|
|
|
enableParallelBuilding = true;
|
2017-10-01 13:24:18 +00:00
|
|
|
|
2016-02-25 01:22:43 +00:00
|
|
|
makeFlags = [ "-C src" ];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
make -C doc proot/man.1
|
|
|
|
'';
|
|
|
|
|
2019-03-10 00:38:22 +00:00
|
|
|
installFlags = [ "PREFIX=${placeholder "out"}" ];
|
2016-02-25 01:22:43 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm644 doc/proot/man.1 $out/share/man/man1/proot.1
|
|
|
|
'';
|
2014-10-07 00:37:23 +00:00
|
|
|
|
2021-10-01 20:01:38 +00:00
|
|
|
# proot provides tests with `make -C test` however they do not run in the sandbox
|
|
|
|
doCheck = false;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://proot-me.github.io";
|
2014-10-07 00:37:23 +00:00
|
|
|
description = "User-space implementation of chroot, mount --bind and binfmt_misc";
|
|
|
|
platforms = platforms.linux;
|
|
|
|
license = licenses.gpl2;
|
2019-03-10 00:38:22 +00:00
|
|
|
maintainers = with maintainers; [ ianwookim makefu veprbl dtzWill ];
|
2023-08-19 21:35:10 +00:00
|
|
|
mainProgram = "proot";
|
2014-10-07 00:37:23 +00:00
|
|
|
};
|
2019-03-10 00:38:22 +00:00
|
|
|
}
|