2015-10-13 12:33:08 +00:00
|
|
|
{ stdenv, lib, fetchurl, pkgconfig, expat, systemd, glib, dbus_glib, python
|
2015-03-19 00:49:31 +00:00
|
|
|
, libX11 ? null, libICE ? null, libSM ? null, x11Support ? (stdenv.isLinux || stdenv.isDarwin) }:
|
|
|
|
|
|
|
|
assert x11Support -> libX11 != null
|
|
|
|
&& libICE != null
|
|
|
|
&& libSM != null;
|
2008-12-15 23:45:52 +00:00
|
|
|
|
2008-02-02 20:41:06 +00:00
|
|
|
let
|
2015-07-23 12:42:47 +00:00
|
|
|
version = "1.8.20";
|
|
|
|
sha256 = "0fkh3d5r57a659hw9lqnw4v0bc5556vx54fsf7l9c732ci6byksw";
|
2011-08-26 14:57:48 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
self = stdenv.mkDerivation {
|
|
|
|
name = "dbus-${version}";
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2013-04-11 20:12:00 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2013-03-23 16:08:47 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
patches = [ ./ignore-missing-includedirs.patch ]
|
|
|
|
++ lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace tools/Makefile.in \
|
|
|
|
--replace 'install-localstatelibDATA:' 'disabled:' \
|
|
|
|
--replace 'install-data-local:' 'disabled:' \
|
|
|
|
--replace 'installcheck-local:' 'disabled:'
|
|
|
|
substituteInPlace bus/Makefile.in \
|
|
|
|
--replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
|
|
|
|
'' + /* cleanup of runtime references */ ''
|
|
|
|
substituteInPlace ./dbus/dbus-sysdeps-unix.c \
|
|
|
|
--replace 'DBUS_BINDIR "/dbus-launch"' "\"$lib/bin/dbus-launch\""
|
|
|
|
substituteInPlace ./tools/dbus-launch.c \
|
|
|
|
--replace 'DBUS_DAEMONDIR"/dbus-daemon"' '"/run/current-system/sw/bin/dbus-daemon"'
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "dev" "out" "lib" "doc" ];
|
2013-09-06 13:51:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
propagatedBuildInputs = [ expat ];
|
2015-10-13 12:33:08 +00:00
|
|
|
buildInputs = lib.optional stdenv.isLinux systemd
|
|
|
|
++ lib.optionals x11Support [ libX11 libICE libSM ];
|
|
|
|
# ToDo: optional selinux?
|
2011-08-26 14:57:48 +00:00
|
|
|
|
2013-09-06 13:51:38 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-session-socket-dir=/tmp"
|
2014-03-13 20:44:51 +00:00
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
2015-10-13 12:33:08 +00:00
|
|
|
# this package installs nothing into those dirs and they create a dependency
|
|
|
|
"--datadir=/run/current-system/sw/share"
|
|
|
|
"--libexecdir=$(out)/libexec" # we don't need dbus-daemon-launch-helper
|
2015-03-19 00:49:31 +00:00
|
|
|
] ++ lib.optional (!x11Support) "--without-x";
|
2011-08-26 14:57:48 +00:00
|
|
|
|
2013-04-11 20:12:00 +00: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.
|
2011-08-03 11:45:57 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
|
2015-10-13 12:33:08 +00:00
|
|
|
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
|
2010-02-11 02:43:45 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
enableParallelBuilding = true;
|
2011-08-26 14:57:48 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
doCheck = true;
|
2011-12-14 18:22:55 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
installFlags = "sysconfdir=$(out)/etc datadir=$(out)/share";
|
2013-06-18 12:59:32 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
# it's executed from $lib by absolute path
|
|
|
|
postFixup = ''
|
|
|
|
_moveToOutput bin/dbus-launch "$lib"
|
|
|
|
ln -s "$lib/bin/dbus-launch" "$out/bin/"
|
2015-02-01 10:38:15 +00:00
|
|
|
'';
|
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
passthru = {
|
|
|
|
dbus-launch = "${self.lib}/bin/dbus-launch";
|
|
|
|
daemon = self.out;
|
|
|
|
};
|
2007-06-05 16:56:10 +00:00
|
|
|
|
2015-10-13 12:33:08 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Simple interprocess messaging system";
|
|
|
|
homepage = http://www.freedesktop.org/wiki/Software/dbus/;
|
|
|
|
license = licenses.gpl2Plus; # most is also under AFL-2.1
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2013-03-23 16:08:47 +00:00
|
|
|
};
|
2015-10-13 12:33:08 +00:00
|
|
|
in self
|
2015-02-01 10:38:15 +00:00
|
|
|
|