nixpkgs-suyu/pkgs/os-specific/linux/sysvinit/default.nix
R. RyanTM 7e26b9d53e sysvinit: 2.93 -> 2.94 (#56760)
Semi-automatic update generated by
https://github.com/ryantm/nixpkgs-update tools. This update was made
based on information from
https://repology.org/metapackage/sysvinit/versions
2019-03-04 13:15:39 +01:00

45 lines
1.3 KiB
Nix

{ stdenv, fetchurl, withoutInitTools ? false }:
let version = "2.94"; in
stdenv.mkDerivation {
name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
src = fetchurl {
url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.xz";
sha256 = "05wshfgrijp3pi9rpfsa0yx4w3bf5v6hlwjqw79nlhz53xjca2by";
};
prePatch = ''
# Patch some minimal hard references, so halt/shutdown work
sed -i -e "s,/sbin/,$out/sbin/," src/halt.c src/init.c src/paths.h
'';
makeFlags = [ "SULOGINLIBS=-lcrypt" "ROOT=$(out)" "MANDIR=/share/man" ];
preInstall =
''
substituteInPlace src/Makefile --replace /usr /
'';
postInstall = ''
mv $out/sbin/killall5 $out/bin
ln -sf killall5 $out/bin/pidof
''
+ stdenv.lib.optionalString withoutInitTools
''
shopt -s extglob
rm -rf $out/sbin/!(sulogin)
rm -rf $out/include
rm -rf $out/share/man/man5
rm $(for i in $out/share/man/man8/*; do echo $i; done | grep -v 'pidof\|killall5')
rm $out/bin/wall $out/share/man/man1/wall.1
'';
meta = {
homepage = https://www.nongnu.org/sysvinit/;
description = "Utilities related to booting and shutdown";
platforms = stdenv.lib.platforms.linux;
license = stdenv.lib.licenses.gpl2Plus;
};
}