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