2013-05-09 12:58:08 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
|
2008-12-15 23:45:52 +00:00
|
|
|
|
2008-02-02 20:41:06 +00:00
|
|
|
let
|
2013-05-09 12:58:08 +01:00
|
|
|
version = "1.6.4";
|
2011-08-26 15:57:48 +01:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
|
|
|
sha256 = "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz";
|
|
|
|
};
|
|
|
|
|
|
|
|
patches = [ ./ignore-missing-includedirs.patch ];
|
2010-07-20 13:53:07 +01:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp";
|
|
|
|
|
|
|
|
in rec {
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
libs = stdenv.mkDerivation {
|
|
|
|
name = "dbus-library-" + version;
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
buildInputs = [ expat ];
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
# FIXME: dbus has optional systemd integration when checking
|
|
|
|
# at_console policies. How to enable this without introducing a
|
|
|
|
# circular dependency between dbus and systemd?
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
inherit src patches configureFlags;
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
sed -i '/mkinstalldirs.*localstatedir/d' bus/Makefile.in
|
|
|
|
sed -i '/SUBDIRS/s/ tools//' Makefile.in
|
|
|
|
'';
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01: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";
|
2011-08-26 15:57:48 +01:00
|
|
|
|
2013-04-11 21:12:00 +01:00
|
|
|
installFlags = "sysconfdir=$(out)/etc";
|
2013-05-09 12:58:08 +01:00
|
|
|
};
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
tools = stdenv.mkDerivation {
|
|
|
|
name = "dbus-tools-" + version;
|
2011-08-26 15:57:48 +01:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
inherit src patches;
|
2008-12-15 23:45:52 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
|
2008-02-02 20:41:06 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2010-02-11 02:43:45 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
buildInputs = [ expat libs ]
|
|
|
|
++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
|
2011-08-26 15:57:48 +01:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
NIX_LDFLAGS = "-ldbus-1";
|
2011-12-14 18:22:55 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
preConfigure =
|
|
|
|
''
|
|
|
|
sed -i 's@$(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
|
|
|
|
substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
|
|
|
|
'';
|
2008-02-02 20:41:06 +00:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
postConfigure = "cd tools";
|
2007-06-05 17:56:10 +01:00
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
installFlags = "localstatedir=$TMPDIR/var";
|
2013-03-23 16:08:47 +00:00
|
|
|
};
|
|
|
|
|
2013-05-09 12:58:08 +01:00
|
|
|
# I'm too lazy to separate daemon and libs now.
|
|
|
|
daemon = libs;
|
2007-03-04 21:28:24 +00:00
|
|
|
}
|