2014-12-08 11:49:26 +00:00
|
|
|
{stdenv, fetchgit, rcinit ? null, rcshutdown ? null, rcreboot ? null}:
|
2014-12-08 06:11:39 +00:00
|
|
|
let
|
|
|
|
s = # Generated upstream information
|
|
|
|
rec {
|
|
|
|
baseName="sinit";
|
2016-08-24 19:45:30 +01:00
|
|
|
version="1.0";
|
2014-12-08 06:11:39 +00:00
|
|
|
name="${baseName}-${version}";
|
2014-12-08 11:49:26 +00:00
|
|
|
url="http://git.suckless.org/sinit/";
|
2016-08-24 19:45:30 +01:00
|
|
|
sha256="0cf8yylgrrj1wxm5v6jdlbnxpx97m38yxrc9nmv1l8hldjqsj9pc";
|
2014-12-08 11:49:26 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2014-12-08 06:11:39 +00:00
|
|
|
};
|
|
|
|
buildInputs = [
|
2016-08-25 09:44:20 +01:00
|
|
|
(stdenv.lib.getOutput "static" stdenv.cc.libc)
|
2014-12-08 06:11:39 +00:00
|
|
|
];
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit (s) name version;
|
|
|
|
inherit buildInputs;
|
2014-12-08 11:49:26 +00:00
|
|
|
src = fetchgit {
|
|
|
|
inherit (s) url sha256 rev;
|
2014-12-08 06:11:39 +00:00
|
|
|
};
|
|
|
|
makeFlags = ["PREFIX=$(out)"];
|
|
|
|
preConfigure = ""
|
|
|
|
+ (stdenv.lib.optionalString (rcinit != null) ''sed -re 's@(rcinitcmd[^"]*")[^"]*"@\1${rcinit}"@' -i config.def.h; '')
|
|
|
|
+ (stdenv.lib.optionalString (rcshutdown != null) ''sed -re 's@(rc(reboot|poweroff)cmd[^"]*")[^"]*"@\1${rcshutdown}"@' -i config.def.h; '')
|
|
|
|
+ (stdenv.lib.optionalString (rcreboot != null) ''sed -re 's@(rc(reboot)cmd[^"]*")[^"]*"@\1${rcreboot}"@' -i config.def.h; '')
|
|
|
|
;
|
|
|
|
meta = {
|
|
|
|
inherit (s) version;
|
|
|
|
description = ''A very minimal Linux init implementation from suckless.org'';
|
|
|
|
license = stdenv.lib.licenses.mit ;
|
|
|
|
maintainers = [stdenv.lib.maintainers.raskin];
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = http://tools.suckless.org/sinit;
|
2014-12-08 06:11:39 +00:00
|
|
|
downloadPage = "http://git.suckless.org/sinit";
|
|
|
|
};
|
|
|
|
}
|