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
|
2011-12-14 19:22:34 +01:00
|
|
|
version = "1.4.16";
|
2011-08-26 16:57:48 +02: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";
|
2011-12-14 19:22:34 +01:00
|
|
|
sha256 = "1ii93d0lzj5xm564dcq6ca4s0nvm5i9fx3jp0s7i9hlc5wkfd3hx";
|
2007-03-04 22:28:24 +01:00
|
|
|
};
|
2010-07-20 14:53:07 +02:00
|
|
|
|
|
|
|
patches = [ ./ignore-missing-includedirs.patch ];
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2009-10-30 13:36:32 +01:00
|
|
|
configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp";
|
2011-08-26 16:57:48 +02: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;
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2011-12-14 19:22:55 +01:00
|
|
|
buildNativeInputs = [ pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [ expat ];
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2010-07-20 14:53:07 +02:00
|
|
|
inherit src patches configureFlags;
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2010-07-20 14:53:07 +02:00
|
|
|
preConfigure =
|
2009-10-30 13:36:32 +01:00
|
|
|
''
|
|
|
|
sed -i '/mkinstalldirs.*localstatedir/d' bus/Makefile.in
|
|
|
|
sed -i '/SUBDIRS/s/ tools//' Makefile.in
|
|
|
|
'';
|
|
|
|
|
2011-08-03 13:45:57 +02:00
|
|
|
# Enable X11 autolaunch support in libdbus. This doesn't actually
|
|
|
|
# depend on X11 (it just execs dbus-launch in dbus.tools),
|
|
|
|
# contrary to what the configure script demands.
|
|
|
|
NIX_CFLAGS_COMPILE = "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
|
|
|
|
|
2009-10-30 13:36:32 +01:00
|
|
|
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-07-20 14:53:07 +02:00
|
|
|
inherit src patches;
|
2010-02-11 03:43:45 +01:00
|
|
|
|
|
|
|
configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2011-12-14 19:22:55 +01:00
|
|
|
buildNativeInputs = [ pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [ expat libs ]
|
2010-07-19 00:00:40 +02:00
|
|
|
++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
NIX_LDFLAGS = "-ldbus-1";
|
|
|
|
|
2010-07-20 14:53:07 +02:00
|
|
|
preConfigure =
|
2009-10-30 13:36:32 +01:00
|
|
|
''
|
2011-12-14 19:22:34 +01:00
|
|
|
sed -i 's@$(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
|
2009-10-30 13:36:32 +01:00
|
|
|
substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
|
|
|
|
'';
|
2010-07-20 14:53:07 +02:00
|
|
|
|
|
|
|
postConfigure = "cd tools";
|
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;
|
2007-03-04 22:28:24 +01:00
|
|
|
}
|