1 { lib, stdenv, fetchurl, bash, coreutils, python3
2 , libcap_ng, policycoreutils, selinux-python, dbus
3 , xorgserver, openbox, xmodmap }:
5 # this is python3 only as it depends on selinux-python
9 stdenv.mkDerivation rec {
10 pname = "selinux-sandbox";
12 inherit (policycoreutils) se_url;
15 url = "${se_url}/${version}/selinux-sandbox-${version}.tar.gz";
16 sha256 = "0rw8pxfqhl6ww4w31fbf4hi3zilh1n3b1rfjm7ra76mm78wfyylj";
19 nativeBuildInputs = [ wrapPython ];
20 buildInputs = [ bash coreutils libcap_ng policycoreutils python3 xorgserver openbox xmodmap dbus ];
21 propagatedBuildInputs = [ pygobject3 selinux-python ];
25 substituteInPlace Makefile --replace "-m 4755" "-m 755"
26 substituteInPlace sandboxX.sh \
27 --replace "#!/bin/sh" "#!${bash}/bin/sh" \
28 --replace "/usr/share/sandbox/start" "${placeholder "out"}/share/sandbox/start" \
29 --replace "/usr/bin/cut" "${coreutils}/bin/cut" \
30 --replace "/usr/bin/Xephyr" "${xorgserver}/bin/Xepyhr" \
31 --replace "secon" "${policycoreutils}/bin/secon"
32 substituteInPlace sandbox \
33 --replace "/usr/sbin/seunshare" "$out/bin/seunshare" \
34 --replace "/usr/share/sandbox" "$out/share/sandbox" \
35 --replace "/usr/share/locale" "${policycoreutils}/share/locale" \
36 --replace "/usr/bin/openbox" "${openbox}/bin/openbox" \
37 --replace "#!/bin/sh" "#!${bash}/bin/sh" \
38 --replace "dbus-" "${dbus}/bin/dbus-" \
39 --replace "/usr/bin/xmodmap" "${xmodmap}/bin/xmodmap" \
40 --replace "/usr/bin/shred" "${coreutils}/bin/shred" \
41 --replace "/usr/bin/test" "${coreutils}/bin/test" \
46 "SYSCONFDIR=$(out)/etc/sysconfig"
54 description = "SELinux sandbox utility";
55 license = licenses.gpl2Only;
56 homepage = "https://selinuxproject.org";
57 platforms = platforms.linux;
58 maintainers = with lib.maintainers; [ RossComputerGuy ];