2017-02-19 23:54:19 +00:00
|
|
|
{ runCommand, writeText, libxslt, dbus
|
|
|
|
, serviceDirectories ? []
|
|
|
|
, suidHelper ? "/var/setuid-wrappers/dbus-daemon-launch-helper"
|
2020-11-02 21:11:38 +00:00
|
|
|
, apparmor ? "disabled" # one of enabled, disabled, required
|
2017-02-19 23:54:19 +00:00
|
|
|
}:
|
2017-02-16 11:55:38 +00:00
|
|
|
|
|
|
|
/* DBus has two configuration parsers -- normal and "trivial", which is used
|
|
|
|
* for suid helper. Unfortunately the latter doesn't support <include>
|
|
|
|
* directive. That means that we can't just place our configuration to
|
|
|
|
* *-local.conf -- it needs to be in the main configuration file.
|
|
|
|
*/
|
|
|
|
runCommand "dbus-1"
|
|
|
|
{
|
2020-11-02 21:11:38 +00:00
|
|
|
inherit serviceDirectories suidHelper apparmor;
|
2017-11-12 03:52:21 +00:00
|
|
|
preferLocalBuild = true;
|
2019-03-17 01:08:44 +00:00
|
|
|
allowSubstitutes = false;
|
2017-02-19 23:54:19 +00:00
|
|
|
XML_CATALOG_FILES = writeText "dbus-catalog.xml" ''
|
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!DOCTYPE catalog PUBLIC
|
|
|
|
"-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
|
|
|
|
"http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
|
|
|
|
|
|
|
|
<catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
|
|
|
|
<rewriteSystem
|
|
|
|
systemIdStartString="http://www.freedesktop.org/standards/dbus/1.0/"
|
2019-08-24 16:27:36 +01:00
|
|
|
rewritePrefix="file://${dbus}/share/xml/dbus-1/"/>
|
2017-02-19 23:54:19 +00:00
|
|
|
</catalog>
|
|
|
|
'';
|
2018-03-21 20:12:41 +00:00
|
|
|
nativeBuildInputs = [ libxslt.bin ];
|
2017-02-16 11:55:38 +00:00
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out
|
|
|
|
|
2018-02-28 19:40:49 +00:00
|
|
|
xsltproc --nonet \
|
2017-02-16 11:55:38 +00:00
|
|
|
--stringparam serviceDirectories "$serviceDirectories" \
|
|
|
|
--stringparam suidHelper "$suidHelper" \
|
2020-11-02 21:11:38 +00:00
|
|
|
--stringparam apparmor "$apparmor" \
|
2017-02-16 11:55:38 +00:00
|
|
|
${./make-system-conf.xsl} ${dbus}/share/dbus-1/system.conf \
|
|
|
|
> $out/system.conf
|
2018-02-28 19:40:49 +00:00
|
|
|
xsltproc --nonet \
|
2017-02-16 11:55:38 +00:00
|
|
|
--stringparam serviceDirectories "$serviceDirectories" \
|
2020-11-02 21:11:38 +00:00
|
|
|
--stringparam apparmor "$apparmor" \
|
2017-02-16 11:55:38 +00:00
|
|
|
${./make-session-conf.xsl} ${dbus}/share/dbus-1/session.conf \
|
|
|
|
> $out/session.conf
|
|
|
|
''
|