summary refs log tree commit diff
path: root/pkgs/tools/system/proot/default.nix
blob: be3cffb47eb31a5c0500297f80f61056a3917dfc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ stdenv, fetchgit, talloc, enableStatic ? false }:

stdenv.mkDerivation rec {
  name = "proot-${version}";
  version = "4.0.3";

  src = fetchgit {
    url = "git://github.com/cedric-vincent/proot.git";
    rev = "refs/tags/v${version}";
    sha256 = "95a52b2fa47b2891eb2c6b6b0e14d42f6d48f6fd5181e359b007831f1a046e84";
  };

  buildInputs = [ talloc ];

  preBuild = stdenv.lib.optionalString enableStatic ''
    export LDFLAGS="-static -L${talloc}/lib"
  '' + ''
    substituteInPlace GNUmakefile --replace "/usr/local" "$out"
  '';

  sourceRoot = "proot/src";

  meta = with stdenv.lib; {
    homepage = http://proot.me;
    description = "User-space implementation of chroot, mount --bind and binfmt_misc";
    platforms = platforms.linux;
    license = licenses.gpl2;
    maintainers = [ maintainers.ianwookim ];
  };
}