nixpkgs/pkgs/development/libraries/dbus/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

121 lines
3.3 KiB
Nix
Raw Normal View History

2019-08-23 18:31:37 +00:00
{ stdenv
, lib
, fetchurl
, pkg-config
2019-08-23 18:31:37 +00:00
, expat
, enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemdMinimal
, systemdMinimal
, audit
, libapparmor
2019-08-23 18:31:37 +00:00
, dbus
, docbook_xml_dtd_44
, docbook-xsl-nons
, xmlto
, autoreconfHook
, autoconf-archive
2022-05-10 17:42:31 +00:00
, x11Support ? (stdenv.isLinux || stdenv.isDarwin)
, xorg
2019-08-23 18:31:37 +00:00
}:
stdenv.mkDerivation rec {
pname = "dbus";
version = "1.14.4";
2019-08-23 18:31:37 +00:00
src = fetchurl {
url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.xz";
sha256 = "sha256-fA+bjl7A/yR5OD5iwAhKOimvme3xUU6fZZuBsw1ONT4=";
2019-08-23 18:31:37 +00:00
};
patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
2019-08-23 18:31:37 +00:00
postPatch = ''
substituteInPlace bus/Makefile.am \
--replace 'install-data-hook:' 'disabled:' \
--replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
substituteInPlace tools/Makefile.am \
2019-08-23 18:31:37 +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"'
'';
outputs = [ "out" "dev" "lib" "doc" "man" ];
2019-08-23 18:31:37 +00:00
strictDeps = true;
2019-08-23 18:31:37 +00:00
nativeBuildInputs = [
autoreconfHook
autoconf-archive
pkg-config
docbook_xml_dtd_44
docbook-xsl-nons
xmlto
2019-08-23 18:31:37 +00:00
];
propagatedBuildInputs = [
expat
];
buildInputs =
2022-05-10 17:42:31 +00:00
lib.optionals x11Support (with xorg; [
libX11
libICE
libSM
]) ++ lib.optional enableSystemd systemdMinimal
++ lib.optionals stdenv.isLinux [ audit libapparmor ];
2019-08-23 18:31:37 +00:00
# ToDo: optional selinux?
configureFlags = [
"--enable-user-session"
"--enable-xml-docs"
"--libexecdir=${placeholder "out"}/libexec"
2019-09-25 20:47:17 +00:00
"--datadir=/etc"
2019-08-23 18:31:37 +00: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"
++ lib.optionals stdenv.isLinux [ "--enable-apparmor" "--enable-libaudit" ]
++ lib.optionals enableSystemd [ "SYSTEMCTL=${systemdMinimal}/bin/systemctl" ];
2019-08-23 18:31:37 +00:00
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
enableParallelBuilding = true;
doCheck = true;
makeFlags = [
# Fix paths in XML catalog broken by mismatching build/install datadir.
"dtddir=${placeholder "out"}/share/xml/dbus-1"
];
2019-08-23 18:31:37 +00:00
installFlags = [
"sysconfdir=${placeholder "out"}/etc"
"datadir=${placeholder "out"}/share"
2019-08-23 18:31:37 +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";
};
meta = with lib; {
2019-08-23 18:31:37 +00:00
description = "Simple interprocess messaging system";
homepage = "http://www.freedesktop.org/wiki/Software/dbus/";
2019-08-23 18:31:37 +00:00
license = licenses.gpl2Plus; # most is also under AFL-2.1
maintainers = teams.freedesktop.members ++ (with maintainers; [ ]);
2019-08-23 18:31:37 +00:00
platforms = platforms.unix;
};
2019-08-23 18:31:37 +00:00
}