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