2019-08-23 18:31:37 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-08-21 13:09:30 +00:00
|
|
|
, fetchpatch
|
2019-08-23 18:31:37 +00:00
|
|
|
, fetchurl
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2019-08-23 18:31:37 +00:00
|
|
|
, expat
|
2021-11-04 08:34:18 +00:00
|
|
|
, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isStatic
|
2019-08-23 18:31:37 +00:00
|
|
|
, systemd
|
2020-11-02 21:11:38 +00:00
|
|
|
, audit
|
|
|
|
, libapparmor
|
2019-08-23 18:31:37 +00:00
|
|
|
, libX11 ? null
|
|
|
|
, libICE ? null
|
|
|
|
, libSM ? null
|
|
|
|
, x11Support ? (stdenv.isLinux || stdenv.isDarwin)
|
|
|
|
, dbus
|
2020-09-28 16:25:45 +00:00
|
|
|
, docbook_xml_dtd_44
|
|
|
|
, docbook-xsl-nons
|
|
|
|
, xmlto
|
2021-08-21 13:09:30 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, autoconf-archive
|
2019-08-23 18:31:37 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "dbus";
|
2020-07-03 05:59:36 +00:00
|
|
|
version = "1.12.20";
|
2015-03-19 00:49:31 +00:00
|
|
|
|
2019-08-23 18:31:37 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
2020-07-03 05:59:36 +00:00
|
|
|
sha256 = "1zp5gpx61v1cpqf2zwb1cidhp9xylvw49d3zydkxqk6b1qa20xpp";
|
2019-08-23 18:31:37 +00:00
|
|
|
};
|
2008-12-15 23:45:52 +00:00
|
|
|
|
2020-11-05 20:21:20 +00:00
|
|
|
patches = [
|
|
|
|
# 'generate.consistent.ids=1' ensures reproducible docs, for further details see
|
|
|
|
# http://docbook.sourceforge.net/release/xsl/current/doc/html/generate.consistent.ids.html
|
|
|
|
# Also applied upstream in https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/189,
|
|
|
|
# expected in version 1.14
|
|
|
|
./docs-reproducible-ids.patch
|
2021-08-21 13:09:30 +00:00
|
|
|
# AC_PATH_XTRA doesn't seem to find X11 libs even though libX11 seems
|
|
|
|
# to provide valid pkg-config files. This replace AC_PATH_XTRA with
|
|
|
|
# PKG_CHECK_MODULES.
|
|
|
|
# MR merged cf https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/212/diffs?commit_id=23880a181e82ee7f
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.freedesktop.org/dbus/dbus/-/commit/6bfaea0707ba1a7788c4b6d30c18fb094f3a1dd4.patch";
|
|
|
|
sha256 = "1d8ay55n2ksw5faqx3hsdpfni3xl3gq9hnjl65073xcfnx67x8d2";
|
|
|
|
})
|
2020-11-05 20:21:20 +00:00
|
|
|
] ++ (lib.optional stdenv.isSunOS ./implement-getgrouplist.patch);
|
2019-08-23 18:31:37 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2021-08-21 13:09:30 +00:00
|
|
|
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"'
|
|
|
|
'';
|
|
|
|
|
2020-09-28 16:25:45 +00:00
|
|
|
outputs = [ "out" "dev" "lib" "doc" "man" ];
|
2019-08-23 18:31:37 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-08-21 13:09:30 +00:00
|
|
|
autoreconfHook
|
|
|
|
autoconf-archive
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2020-09-28 16:25:45 +00:00
|
|
|
docbook_xml_dtd_44
|
|
|
|
docbook-xsl-nons
|
|
|
|
xmlto
|
2019-08-23 18:31:37 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
expat
|
|
|
|
];
|
|
|
|
|
2019-10-21 17:09:32 +00:00
|
|
|
buildInputs =
|
|
|
|
lib.optionals x11Support [
|
|
|
|
libX11
|
|
|
|
libICE
|
|
|
|
libSM
|
2020-11-02 21:11:38 +00:00
|
|
|
] ++ lib.optional enableSystemd systemd
|
2021-06-07 12:45:00 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ audit libapparmor ];
|
2019-08-23 18:31:37 +00:00
|
|
|
# ToDo: optional selinux?
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-user-session"
|
2020-09-28 16:25:45 +00:00
|
|
|
"--enable-xml-docs"
|
2021-01-24 09:19:10 +00:00
|
|
|
"--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"
|
2021-01-24 09:19:10 +00:00
|
|
|
"--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
|
|
|
|
"--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user"
|
2020-11-02 21:11:38 +00:00
|
|
|
] ++ lib.optional (!x11Support) "--without-x"
|
2021-06-07 12:45:00 +00:00
|
|
|
++ lib.optionals stdenv.isLinux [ "--enable-apparmor" "--enable-libaudit" ];
|
2019-08-23 18:31:37 +00:00
|
|
|
|
|
|
|
NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
installFlags = [
|
2021-01-24 09:19:10 +00:00
|
|
|
"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";
|
|
|
|
daemon = dbus.out;
|
|
|
|
};
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2019-08-23 18:31:37 +00:00
|
|
|
description = "Simple interprocess messaging system";
|
2020-04-01 01:11:51 +00:00
|
|
|
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
|
2021-05-07 13:23:50 +00:00
|
|
|
maintainers = teams.freedesktop.members ++ (with maintainers; [ ]);
|
2019-08-23 18:31:37 +00:00
|
|
|
platforms = platforms.unix;
|
2013-03-23 16:08:47 +00:00
|
|
|
};
|
2019-08-23 18:31:37 +00:00
|
|
|
}
|