2016-05-31 15:29:53 +02:00
|
|
|
{ stdenv, lib, fetchurl, pkgconfig, expat, systemd
|
2015-03-19 01:49:31 +01:00
|
|
|
, libX11 ? null, libICE ? null, libSM ? null, x11Support ? (stdenv.isLinux || stdenv.isDarwin) }:
|
|
|
|
|
|
|
|
assert x11Support -> libX11 != null
|
|
|
|
&& libICE != null
|
|
|
|
&& libSM != null;
|
2008-12-16 00:45:52 +01:00
|
|
|
|
2008-02-02 21:41:06 +01:00
|
|
|
let
|
2017-10-08 11:54:46 +02:00
|
|
|
version = "1.10.24";
|
|
|
|
sha256 = "06ydmrg76l1kwl3190d72zpiy3qxy248x6gskxbj9qiqfsr4w63i";
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2017-02-01 21:22:19 +01:00
|
|
|
self = stdenv.mkDerivation {
|
2015-10-13 14:33:08 +02:00
|
|
|
name = "dbus-${version}";
|
2017-02-01 21:22:19 +01:00
|
|
|
inherit version;
|
2013-03-23 17:08:47 +01:00
|
|
|
|
2013-04-11 22:12:00 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2013-03-23 17:08:47 +01:00
|
|
|
|
2016-05-02 20:01:59 +02:00
|
|
|
patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
|
2015-10-13 14:33:08 +02:00
|
|
|
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"'
|
|
|
|
'';
|
|
|
|
|
2016-08-29 02:30:01 +02:00
|
|
|
outputs = [ "out" "dev" "lib" "doc" ];
|
2013-09-06 15:51:38 +02:00
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
propagatedBuildInputs = [ expat ];
|
2015-10-13 14:33:08 +02:00
|
|
|
buildInputs = lib.optional stdenv.isLinux systemd
|
|
|
|
++ lib.optionals x11Support [ libX11 libICE libSM ];
|
|
|
|
# ToDo: optional selinux?
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-09-06 15:51:38 +02:00
|
|
|
configureFlags = [
|
|
|
|
"--localstatedir=/var"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-session-socket-dir=/tmp"
|
2016-09-20 09:21:08 +02:00
|
|
|
"--with-system-pid-file=/run/dbus/pid"
|
|
|
|
"--with-system-socket=/run/dbus/system_bus_socket"
|
2014-03-13 21:44:51 +01:00
|
|
|
"--with-systemdsystemunitdir=$(out)/etc/systemd/system"
|
2016-09-20 09:21:08 +02:00
|
|
|
"--with-systemduserunitdir=$(out)/etc/systemd/user"
|
|
|
|
"--enable-user-session"
|
2017-02-16 12:55:03 +01:00
|
|
|
"--datadir=/etc"
|
|
|
|
"--libexecdir=$(out)/libexec"
|
2015-03-19 01:49:31 +01:00
|
|
|
] ++ lib.optional (!x11Support) "--without-x";
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2013-04-11 22:12:00 +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.
|
2015-10-28 12:02:01 +01:00
|
|
|
# problems building without x11Support so disabled in that case for now
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
|
2015-10-13 14:33:08 +02:00
|
|
|
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
|
2010-02-11 03:43:45 +01:00
|
|
|
|
2015-10-13 14:33:08 +02:00
|
|
|
enableParallelBuilding = true;
|
2011-08-26 16:57:48 +02:00
|
|
|
|
2015-10-13 14:33:08 +02:00
|
|
|
doCheck = true;
|
2011-12-14 19:22:55 +01:00
|
|
|
|
2017-02-16 12:55:03 +01:00
|
|
|
installFlags = [ "sysconfdir=$(out)/etc" "datadir=$(out)/share" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
2017-02-20 03:16:26 +01:00
|
|
|
mkdir -p "$out/share/xml/dbus"
|
|
|
|
cp doc/*.dtd "$out/share/xml/dbus"
|
2017-02-16 12:55:03 +01:00
|
|
|
'';
|
2013-06-18 14:59:32 +02:00
|
|
|
|
2015-10-13 14:33:08 +02:00
|
|
|
# it's executed from $lib by absolute path
|
|
|
|
postFixup = ''
|
2015-12-02 10:03:23 +01:00
|
|
|
moveToOutput bin/dbus-launch "$lib"
|
2015-10-13 14:33:08 +02:00
|
|
|
ln -s "$lib/bin/dbus-launch" "$out/bin/"
|
2015-02-01 11:38:15 +01:00
|
|
|
'';
|
|
|
|
|
2015-10-13 14:33:08 +02:00
|
|
|
passthru = {
|
|
|
|
dbus-launch = "${self.lib}/bin/dbus-launch";
|
|
|
|
daemon = self.out;
|
|
|
|
};
|
2007-06-05 18:56:10 +02:00
|
|
|
|
2015-10-13 14:33:08 +02: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 17:08:47 +01:00
|
|
|
};
|
2015-10-13 14:33:08 +02:00
|
|
|
in self
|