2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-13 01:03:25 +00:00
nixpkgs/pkgs/os-specific/linux/sysvinit/default.nix
Eelco Dolstra 2ed5c2bd6b Set some meta.platforms
Also fix meta.platform -> meta.platforms in a few places.
2015-03-20 20:04:42 +01:00

49 lines
1.4 KiB
Nix

{ stdenv, fetchurl, withoutInitTools ? false }:
let version = "2.88dsf"; in
stdenv.mkDerivation {
name = (if withoutInitTools then "sysvtools" else "sysvinit") + "-" + version;
src = fetchurl {
url = "mirror://savannah/sysvinit/sysvinit-${version}.tar.bz2";
sha256 = "068mvzaz808a673zigyaqb63xc8bndh2klk16zi5c83rw70wifv0";
};
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";
crossAttrs = {
makeFlags = "SULOGINLIBS=-lcrypt ROOT=$(out) MANDIR=/share/man CC=${stdenv.cross.config}-gcc";
};
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;
};
}