2017-02-03 18:03:30 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, dbus, libnih, python, makeWrapper, utillinux
|
|
|
|
, writeScript }:
|
2006-11-17 21:24:42 +01:00
|
|
|
|
2017-02-03 18:03:30 +01:00
|
|
|
let
|
|
|
|
inherit (stdenv.lib) makeBinPath;
|
|
|
|
version = "1.5";
|
2012-03-02 15:46:58 +01:00
|
|
|
|
2017-02-03 18:03:30 +01:00
|
|
|
upstart = stdenv.mkDerivation rec {
|
2012-03-02 15:46:58 +01:00
|
|
|
name = "upstart-${version}";
|
2017-02-03 18:03:30 +01:00
|
|
|
|
2006-11-17 21:24:42 +01:00
|
|
|
src = fetchurl {
|
2012-03-02 15:46:58 +01:00
|
|
|
url = "http://upstart.ubuntu.com/download/${version}/${name}.tar.gz";
|
2014-10-12 16:13:21 +02:00
|
|
|
sha256 = "01w4ab6nlisz5blb0an1sxjkndwikr7sjp0cmz4lg00g3n7gahmx";
|
2006-11-17 21:24:42 +01:00
|
|
|
};
|
2009-04-22 09:19:22 +02:00
|
|
|
|
2017-02-03 18:03:30 +01:00
|
|
|
buildInputs = [ pkgconfig dbus libnih python makeWrapper];
|
|
|
|
|
2010-02-15 16:55:39 +01:00
|
|
|
NIX_CFLAGS_COMPILE =
|
2009-10-30 19:12:28 +01:00
|
|
|
''
|
2010-02-15 16:55:39 +01:00
|
|
|
-DSHELL="${stdenv.shell}"
|
|
|
|
-DCONFFILE="/etc/init.conf"
|
|
|
|
-DCONFDIR="/etc/init"
|
|
|
|
-DPATH="/no-path"
|
2009-10-30 19:12:28 +01:00
|
|
|
'';
|
2009-01-05 15:01:42 +01:00
|
|
|
|
2009-04-26 00:36:33 +02:00
|
|
|
# The interface version prevents NixOS from switching to an
|
|
|
|
# incompatible Upstart at runtime. (Switching across reboots is
|
|
|
|
# fine, of course.) It should be increased whenever Upstart changes
|
|
|
|
# in a backwards-incompatible way. If the interface version of two
|
|
|
|
# Upstart builds is the same, then we can switch between them at
|
|
|
|
# runtime; otherwise we can't and we need to reboot.
|
2010-02-15 16:55:39 +01:00
|
|
|
passthru.interfaceVersion = 2;
|
2009-04-26 00:36:33 +02:00
|
|
|
|
2009-10-30 19:12:28 +01:00
|
|
|
postInstall =
|
|
|
|
''
|
|
|
|
t=$out/etc/bash_completion.d
|
2012-03-02 15:46:58 +01:00
|
|
|
mkdir -p $t
|
2009-10-30 19:12:28 +01:00
|
|
|
cp ${./upstart-bash-completion} $t/upstart
|
2017-02-03 18:03:30 +01:00
|
|
|
|
|
|
|
# Patch some binaries to refer to the correct binary location.
|
|
|
|
sed -i "s,/sbin/init,$out/bin/init,g" $out/bin/init-checkconf
|
|
|
|
sed -i "s,initctl,$out/bin/initctl," $out/bin/initctl2dot
|
|
|
|
|
|
|
|
# Add some missing executable permissions, and wrap binaries.
|
|
|
|
chmod +x $out/bin/init-checkconf $out/bin/init-checkconf
|
|
|
|
wrapProgram $out/bin/init-checkconf \
|
|
|
|
--prefix PATH : $out/bin:${makeBinPath [utillinux dbus]}
|
|
|
|
wrapProgram $out/bin/initctl2dot --prefix PATH : $out/bin
|
2009-10-30 19:12:28 +01:00
|
|
|
'';
|
2009-09-20 19:01:24 +02:00
|
|
|
|
2009-01-05 15:01:42 +01:00
|
|
|
meta = {
|
|
|
|
homepage = "http://upstart.ubuntu.com/";
|
|
|
|
description = "An event-based replacement for the /sbin/init daemon";
|
2016-08-02 19:50:55 +02:00
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2009-01-05 15:01:42 +01:00
|
|
|
};
|
2017-02-03 18:03:30 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
in upstart
|