2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, expat
|
2023-02-02 18:25:31 +00:00
|
|
|
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal
|
2022-08-21 13:32:41 +00:00
|
|
|
, systemdMinimal
|
2020-11-21 19:51:51 +00:00
|
|
|
, audit
|
|
|
|
, libapparmor
|
2020-04-24 23:36:52 +00:00
|
|
|
, dbus
|
2020-10-16 20:44:37 +00:00
|
|
|
, docbook_xml_dtd_44
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, xmlto
|
2021-12-26 17:43:05 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, autoconf-archive
|
2022-05-18 14:49:53 +00:00
|
|
|
, x11Support ? (stdenv.isLinux || stdenv.isDarwin)
|
|
|
|
, xorg
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dbus";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.14.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-05-18 14:49:53 +00:00
|
|
|
url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.xz";
|
2023-07-15 17:15:38 +00:00
|
|
|
sha256 = "sha256-pr1brFzxnww8WUva4lZaCVaWmApoOg7zfLYhLgk73jU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-12-26 17:43:05 +00:00
|
|
|
substituteInPlace bus/Makefile.am \
|
|
|
|
--replace 'install-data-hook:' 'disabled:' \
|
|
|
|
--replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
|
|
|
|
substituteInPlace tools/Makefile.am \
|
2020-04-24 23:36:52 +00:00
|
|
|
--replace 'install-data-local:' 'disabled:' \
|
|
|
|
--replace 'installcheck-local:' 'disabled:'
|
|
|
|
'' + /* 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"'
|
|
|
|
'';
|
|
|
|
|
2020-10-16 20:44:37 +00:00
|
|
|
outputs = [ "out" "dev" "lib" "doc" "man" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
2021-12-26 17:43:05 +00:00
|
|
|
autoreconfHook
|
|
|
|
autoconf-archive
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-10-16 20:44:37 +00:00
|
|
|
docbook_xml_dtd_44
|
|
|
|
docbook-xsl-nons
|
|
|
|
xmlto
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
expat
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs =
|
2022-05-18 14:49:53 +00:00
|
|
|
lib.optionals x11Support (with xorg; [
|
2020-04-24 23:36:52 +00:00
|
|
|
libX11
|
|
|
|
libICE
|
|
|
|
libSM
|
2022-08-21 13:32:41 +00:00
|
|
|
]) ++ lib.optional enableSystemd systemdMinimal
|
2021-06-28 23:13:55 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ audit libapparmor ];
|
2020-04-24 23:36:52 +00:00
|
|
|
# ToDo: optional selinux?
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--enable-user-session"
|
2020-10-16 20:44:37 +00:00
|
|
|
"--enable-xml-docs"
|
2021-02-05 17:12:51 +00:00
|
|
|
"--libexecdir=${placeholder "out"}/libexec"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--datadir=/etc"
|
|
|
|
"--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"
|
2021-02-05 17:12:51 +00:00
|
|
|
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
|
|
|
"--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user"
|
2020-11-21 19:51:51 +00:00
|
|
|
] ++ lib.optional (!x11Support) "--without-x"
|
2022-05-18 14:49:53 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ "--enable-apparmor" "--enable-libaudit" ]
|
2022-08-21 13:32:41 +00:00
|
|
|
++ lib.optionals enableSystemd [ "SYSTEMCTL=${systemdMinimal}/bin/systemctl" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
makeFlags = [
|
|
|
|
# Fix paths in XML catalog broken by mismatching build/install datadir.
|
|
|
|
"dtddir=${placeholder "out"}/share/xml/dbus-1"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installFlags = [
|
2021-02-05 17:12:51 +00:00
|
|
|
"sysconfdir=${placeholder "out"}/etc"
|
|
|
|
"datadir=${placeholder "out"}/share"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# 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";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Simple interprocess messaging system";
|
|
|
|
homepage = "http://www.freedesktop.org/wiki/Software/dbus/";
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://gitlab.freedesktop.org/dbus/dbus/-/blob/dbus-${version}/NEWS";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.gpl2Plus; # most is also under AFL-2.1
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = teams.freedesktop.members ++ (with maintainers; [ ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|