forked from mirrors/nixpkgs
b705ac629f
Semi-automatic update generated by https://github.com/ryantm/nix-update tools. This update was made based on information from https://repology.org/metapackage/sysvinit/versions. These checks were done: - built on NixOS - ran `/nix/store/n54idc6ddkgkwnbbg8y6avb5wvzb5s34-sysvinit-2.89/bin/last help` got 0 exit code - ran `/nix/store/n54idc6ddkgkwnbbg8y6avb5wvzb5s34-sysvinit-2.89/bin/utmpdump -h` got 0 exit code - ran `/nix/store/n54idc6ddkgkwnbbg8y6avb5wvzb5s34-sysvinit-2.89/bin/wall help` got 0 exit code - found 2.89 with grep in /nix/store/n54idc6ddkgkwnbbg8y6avb5wvzb5s34-sysvinit-2.89 - directory tree listing: https://gist.github.com/6fdc40b90f12b6caa767385d367da4d9
45 lines
1.2 KiB
Nix
45 lines
1.2 KiB
Nix
{ stdenv, fetchurl, withoutInitTools ? false }:
|
|
|
|
let version = "2.89"; in
|
|
|
|
stdenv.mkDerivation {
|
|
name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
|
|
|
|
src = fetchurl {
|
|
url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2";
|
|
sha256 = "0rdw5lgg2rpcfdmq90br388qr01w89vsqmpvrqcqjqsmxk9zw3c2";
|
|
};
|
|
|
|
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/{mountpoint,wall} $out/share/man/man1/{mountpoint.1,wall.1}
|
|
'';
|
|
|
|
meta = {
|
|
homepage = http://www.nongnu.org/sysvinit/;
|
|
description = "Utilities related to booting and shutdown";
|
|
platforms = stdenv.lib.platforms.linux;
|
|
};
|
|
}
|