2019-08-23 19:31:37 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, pkgconfig
|
|
|
|
, expat
|
2019-10-21 18:09:32 +01:00
|
|
|
, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
|
2019-08-23 19:31:37 +01:00
|
|
|
, systemd
|
|
|
|
, libX11 ? null
|
|
|
|
, libICE ? null
|
|
|
|
, libSM ? null
|
|
|
|
, x11Support ? (stdenv.isLinux || stdenv.isDarwin)
|
|
|
|
, dbus
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert
|
|
|
|
x11Support ->
|
|
|
|
libX11 != null && libICE != null && libSM != null;
|
|
|
|
|
2019-10-21 18:09:32 +01:00
|
|
|
assert enableSystemd -> systemd != null;
|
|
|
|
|
2019-08-23 19:31:37 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dbus";
|
|
|
|
version = "1.12.16";
|
2015-03-19 00:49:31 +00:00
|
|
|
|
2019-08-23 19:31:37 +01:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
|
|
|
sha256 = "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl";
|
|
|
|
};
|
2008-12-15 23:45:52 +00:00
|
|
|
|
2019-08-23 19:31:37 +01:00
|
|
|
patches = 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 = [ "out" "dev" "lib" "doc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
expat
|
|
|
|
];
|
|
|
|
|
2019-10-21 18:09:32 +01:00
|
|
|
buildInputs =
|
|
|
|
lib.optionals x11Support [
|
|
|
|
libX11
|
|
|
|
libICE
|
|
|
|
libSM
|
|
|
|
] ++ lib.optional enableSystemd systemd;
|
2019-08-23 19:31:37 +01:00
|
|
|
# ToDo: optional selinux?
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-user-session"
|
|
|
|
"--libexecdir=${placeholder ''out''}/libexec"
|
2019-09-25 21:47:17 +01:00
|
|
|
"--datadir=/etc"
|
2019-08-23 19:31:37 +01:00
|
|
|
"--localstatedir=/var"
|
|
|
|
"--runstatedir=/run"
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
"--with-session-socket-dir=/tmp"
|
|
|
|
"--with-system-pid-file=/run/dbus/pid"
|
|
|
|
"--with-system-socket=/run/dbus/system_bus_socket"
|
|
|
|
"--with-systemdsystemunitdir=${placeholder ''out''}/etc/systemd/system"
|
|
|
|
"--with-systemduserunitdir=${placeholder ''out''}/etc/systemd/user"
|
|
|
|
] ++ lib.optional (!x11Support) "--without-x";
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
# problems building without x11Support so disabled in that case for now
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
|
|
|
|
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"sysconfdir=${placeholder ''out''}/etc"
|
|
|
|
"datadir=${placeholder ''out''}/share"
|
|
|
|
];
|
|
|
|
|
|
|
|
# it's executed from $lib by absolute path
|
|
|
|
postFixup = ''
|
|
|
|
moveToOutput bin/dbus-launch "$lib"
|
|
|
|
ln -s "$lib/bin/dbus-launch" "$out/bin/"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
dbus-launch = "${dbus.lib}/bin/dbus-launch";
|
|
|
|
daemon = dbus.out;
|
|
|
|
};
|
|
|
|
|
|
|
|
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
|
2019-10-29 00:39:51 +00:00
|
|
|
maintainers = with maintainers; [ worldofpeace ];
|
2019-08-23 19:31:37 +01:00
|
|
|
platforms = platforms.unix;
|
2013-03-23 16:08:47 +00:00
|
|
|
};
|
2019-08-23 19:31:37 +01:00
|
|
|
}
|