runit: optionally build static runit{,-init}

May be useful in initrd along with statically linked busybox.

+6 -2
+6 -2
pkgs/tools/system/runit/default.nix
··· 1 - { stdenv, fetchurl }: 2 3 stdenv.mkDerivation rec { 4 name = "runit-${version}"; ··· 15 16 doCheck = true; 17 18 - postPatch = '' 19 sed -i 's,-static,,g' src/Makefile 20 ''; 21
··· 1 + { stdenv, fetchurl 2 + , static ? false 3 + }: 4 5 stdenv.mkDerivation rec { 6 name = "runit-${version}"; ··· 17 18 doCheck = true; 19 20 + buildInputs = stdenv.lib.optionals static [ stdenv.cc.libc stdenv.cc.libc.static ]; 21 + 22 + postPatch = stdenv.lib.optionalString (!static) '' 23 sed -i 's,-static,,g' src/Makefile 24 ''; 25