nixpkgs/pkgs/os-specific/linux/libcap/progs.nix
Vladimír Čunát 54eef65533 libcap*: fix with multiple outputs
I don't think we need the license file in each of these,
so I only left it with the library (it isn't big).
2015-10-04 09:49:19 +02:00

29 lines
575 B
Nix

{stdenv, libcap}:
assert stdenv.isLinux;
stdenv.mkDerivation rec {
name = "libcap-progs-${libcap.version}";
inherit (libcap) src makeFlags;
buildInputs = [ libcap ];
prePatch = ''
# use relative bash path
substituteInPlace progs/capsh.c --replace "/bin/bash" "bash"
# ensure capsh can find bash in $PATH
substituteInPlace progs/capsh.c --replace execve execvpe
'';
preConfigure = "cd progs";
installFlags = "RAISE_SETFCAP=no";
postInstall = ''
mkdir -p "$out/share/doc/${name}"
cp ../License "$out/share/doc/${name}/"
'';
}