3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/dbus/make-dbus-conf.nix
aszlig c5b2714bc7
dbus: Put DTDs into $out instead of $doc
First of all, these "documents" are not really documentation, so it
really doesn't make much sense to put it into $doc.

The main point however is that the installer tests are failing since
this was introduced in ac0cdc1952.

One way to circumvent this is putting dbus.doc into
system.extraDependencies of the installer tests, but given the first
point this sounds a bit odd to me.

So I went for the second way of putting it into $out, because it's now
basically necessary to build a NixOS system.

With this the NixOS installer tests should now work again, although I
have only tested this with the installer.simple test.

Signed-off-by: aszlig <aszlig@redmoonstudios.org>
Cc: @abbradar
2017-02-20 03:24:38 +01:00

40 lines
1.4 KiB
Nix

{ runCommand, writeText, libxslt, dbus
, serviceDirectories ? []
, suidHelper ? "/var/setuid-wrappers/dbus-daemon-launch-helper"
}:
/* 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"
{
inherit serviceDirectories suidHelper;
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/"
rewritePrefix="file://${dbus}/share/xml/dbus/"/>
</catalog>
'';
}
''
mkdir -p $out
${libxslt.bin}/bin/xsltproc --nonet \
--stringparam serviceDirectories "$serviceDirectories" \
--stringparam suidHelper "$suidHelper" \
${./make-system-conf.xsl} ${dbus}/share/dbus-1/system.conf \
> $out/system.conf
${libxslt.bin}/bin/xsltproc --nonet \
--stringparam serviceDirectories "$serviceDirectories" \
${./make-session-conf.xsl} ${dbus}/share/dbus-1/session.conf \
> $out/session.conf
''