2013-03-23 17:08:47 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, autoconf, automake, libtool
|
|
|
|
, expat, systemd, glib, dbus_glib, python
|
|
|
|
, libX11, libICE, libSM, useX11 ? true }:
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
let
|
2012-09-27 04:21:14 +02:00
|
|
|
version = "1.6.4";
|
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";
|
2012-09-27 04:21:14 +02:00
|
|
|
sha256 = "1wacqyfkcpayg7f8rvx9awqg275n5pksxq5q7y21lxjx85x6pfjz";
|
2007-03-04 22:28:24 +01:00
|
|
|
};
|
2010-07-20 14:53:07 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
patches = [
|
|
|
|
./ignore-missing-includedirs.patch ./implement-getgrouplist.patch
|
|
|
|
./ucred-dirty-hack.patch ./no-create-dirs.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
# build only the specified subdirs
|
|
|
|
postPatch = subdirs : "sed '/SUBDIRS/s/=.*/=" + subdirs + "/' -i Makefile.am\n"
|
|
|
|
# use already packaged libdbus instead of trying to build it again
|
|
|
|
+ stdenv.lib.optionalString (subdirs != "dbus") ''
|
|
|
|
for mfile in */Makefile.am; do
|
|
|
|
sed 's,\$(top_builddir)/dbus/\(libdbus-[0-9]\),${libs}/lib/\1,g' -i "$mfile"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
|
|
|
|
buildInputs = [ autoconf automake libtool expat ]; # ToDo: optional selinux?
|
|
|
|
|
|
|
|
buildInputsWithX = buildInputs ++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs .
|
|
|
|
substituteInPlace tools/Makefile.am --replace 'install-localstatelibDATA:' 'disabled:'
|
|
|
|
autoreconf -fi
|
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-session-socket-dir=/tmp"
|
|
|
|
"--with-systemdsystemunitdir=$(out)/lib/systemd"
|
|
|
|
];
|
|
|
|
|
|
|
|
# also other parts than "libs" need this statically linked lib
|
|
|
|
postConfigure = "(cd dbus && make libdbus-internal.la)";
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
installFlags = "sysconfdir=$(out)/etc";
|
2011-08-26 16:57:48 +02:00
|
|
|
|
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
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
inherit src nativeBuildInputs preConfigure configureFlags doCheck installFlags;
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
buildInputs = buildInputs ++ [ systemd.headers ];
|
2012-09-27 04:21:14 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
patches = patches ++ [ ./systemd.patch ]; # bypass systemd detection
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
postPatch = postPatch "dbus";
|
2009-10-30 13:36:32 +01:00
|
|
|
|
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";
|
2008-02-02 21:41:06 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
tools = stdenv.mkDerivation {
|
|
|
|
name = "dbus-tools-" + version;
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
inherit src patches nativeBuildInputs preConfigure doCheck installFlags;
|
2010-02-11 03:43:45 +01:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
configureFlags = configureFlags ++ [ "--with-dbus-daemondir=${daemon}/bin" ];
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
buildInputs = buildInputsWithX ++ [ libs daemon systemd dbus_glib ];
|
2011-12-14 19:22:55 +01:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
NIX_CFLAGS_LINK = "-Wl,--as-needed -ldbus-1";
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
postPatch = postPatch "tools";
|
|
|
|
};
|
2008-02-02 21:41:06 +01:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
daemon = stdenv.mkDerivation {
|
|
|
|
name = "dbus-daemon-" + version;
|
|
|
|
|
|
|
|
inherit src patches nativeBuildInputs
|
|
|
|
preConfigure configureFlags postConfigure doCheck installFlags;
|
2010-07-20 14:53:07 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
buildInputs = buildInputs ++ [ systemd ];
|
2012-09-27 04:21:14 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
postPatch = postPatch "bus";
|
2008-02-02 21:41:06 +01:00
|
|
|
};
|
2007-06-05 18:56:10 +02:00
|
|
|
|
2013-03-23 17:08:47 +01:00
|
|
|
tests = stdenv.mkDerivation {
|
|
|
|
name = "dbus-tests-" + version;
|
|
|
|
|
|
|
|
inherit src patches nativeBuildInputs
|
|
|
|
preConfigure configureFlags postConfigure doCheck installFlags;
|
|
|
|
|
|
|
|
buildInputs = buildInputsWithX ++ [ systemd libs tools daemon dbus_glib python ];
|
|
|
|
|
|
|
|
postPatch = postPatch "test";
|
|
|
|
|
|
|
|
NIX_CFLAGS_LINK = "-Wl,--as-needed -ldbus-1";
|
|
|
|
};
|
|
|
|
|
|
|
|
docs = stdenv.mkDerivation {
|
|
|
|
name = "dbus-docs-" + version;
|
|
|
|
|
|
|
|
inherit src patches nativeBuildInputs
|
|
|
|
preConfigure configureFlags doCheck installFlags;
|
|
|
|
|
|
|
|
buildInputs = buildInputs;
|
|
|
|
|
|
|
|
postPatch = postPatch "doc";
|
|
|
|
|
|
|
|
postInstall = ''rm -r "$out/lib"'';
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
inherit libs daemon tools tests docs;
|
|
|
|
|
|
|
|
dbus_libs = libs;
|
|
|
|
dbus_daemon = daemon;
|
|
|
|
dbus_tools = tools;
|
|
|
|
dbus_tests = tests;
|
|
|
|
dbus_docs = docs;
|
2007-03-04 22:28:24 +01:00
|
|
|
}
|