2010-07-19 00:00:40 +02:00
|
|
|
{ stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
let
|
2010-07-19 00:00:40 +02:00
|
|
|
version = "1.2.24";
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2007-03-04 22:28:24 +01:00
|
|
|
src = fetchurl {
|
2008-02-02 21:41:06 +01:00
|
|
|
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
2010-07-19 00:00:40 +02:00
|
|
|
sha256 = "0j2wb79kndq4b1qqr59n1g6s0lm7yp6r9ny3skimadkh9a7p8b7i";
|
2007-03-04 22:28:24 +01:00
|
|
|
};
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2009-10-30 13:36:32 +01:00
|
|
|
configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp";
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
in rec {
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
libs = stdenv.mkDerivation {
|
|
|
|
name = "dbus-library-" + version;
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2010-07-19 00:00:40 +02:00
|
|
|
buildInputs = [ pkgconfig expat ];
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
inherit src configureFlags;
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2009-10-30 13:36:32 +01:00
|
|
|
patchPhase =
|
|
|
|
''
|
|
|
|
sed -i '/mkinstalldirs.*localstatedir/d' bus/Makefile.in
|
|
|
|
sed -i '/SUBDIRS/s/ tools//' Makefile.in
|
|
|
|
'';
|
|
|
|
|
|
|
|
installFlags = "sysconfdir=$(out)/etc";
|
2008-02-02 21:41:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
tools = stdenv.mkDerivation {
|
|
|
|
name = "dbus-tools-" + version;
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2010-02-11 03:43:45 +01:00
|
|
|
inherit src;
|
|
|
|
|
|
|
|
configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2010-07-19 00:00:40 +02:00
|
|
|
buildInputs = [ pkgconfig expat libs ]
|
|
|
|
++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
postConfigure = "cd tools";
|
2007-06-05 18:56:10 +02:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
NIX_LDFLAGS = "-ldbus-1";
|
|
|
|
|
2009-10-30 13:36:32 +01:00
|
|
|
patchPhase =
|
|
|
|
''
|
|
|
|
sed -i 's@ $(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
|
|
|
|
substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
|
|
|
|
'';
|
2008-02-02 21:41:06 +01:00
|
|
|
};
|
2007-06-05 18:56:10 +02:00
|
|
|
|
2008-12-16 00:45:52 +01:00
|
|
|
# I'm too lazy to separate daemon and libs now.
|
2008-02-02 21:41:06 +01:00
|
|
|
daemon = libs;
|
2008-02-08 11:39:20 +01:00
|
|
|
|
|
|
|
# FIXME TODO
|
|
|
|
# After merger it will be better to correct upstart-job instead.
|
|
|
|
outPath = daemon.outPath;
|
2007-03-04 22:28:24 +01:00
|
|
|
}
|