1{ stdenv, fetchgit, talloc, enableStatic ? false }:
2
3stdenv.mkDerivation rec {
4 name = "proot-${version}";
5 version = "4.0.3";
6
7 src = fetchgit {
8 url = "git://github.com/cedric-vincent/proot.git";
9 rev = "refs/tags/v${version}";
10 sha256 = "95a52b2fa47b2891eb2c6b6b0e14d42f6d48f6fd5181e359b007831f1a046e84";
11 };
12
13 buildInputs = [ talloc ];
14
15 preBuild = stdenv.lib.optionalString enableStatic ''
16 export LDFLAGS="-static -L${talloc}/lib"
17 '' + ''
18 substituteInPlace GNUmakefile --replace "/usr/local" "$out"
19 '';
20
21 sourceRoot = "proot/src";
22
23 meta = with stdenv.lib; {
24 homepage = http://proot.me;
25 description = "User-space implementation of chroot, mount --bind and binfmt_misc";
26 platforms = platforms.linux;
27 license = licenses.gpl2;
28 maintainers = [ maintainers.ianwookim ];
29 };
30}
31