dbus: fix build on non-Linux platforms
We do not want systemd there. This should fix the tarball job systemd assertion problems.
This commit is contained in:
parent
84bf7818a4
commit
94d8de2b99
@ -13,6 +13,7 @@ let
|
||||
# also other parts than "libs" need this statically linked lib
|
||||
makeInternalLib = "(cd dbus && make libdbus-internal.la)";
|
||||
|
||||
systemdOrEmpty = stdenv.lib.optional stdenv.isLinux systemd;
|
||||
|
||||
# A generic builder for individual parts (subdirs) of D-Bus
|
||||
dbus_drv = name: subdirs: merge: stdenv.mkDerivation (lib.mergeAttrsByFuncDefaultsClean [{
|
||||
@ -61,14 +62,15 @@ let
|
||||
|
||||
} merge ]);
|
||||
|
||||
libs = dbus_drv "libs" "dbus" {
|
||||
buildInputs = [ systemd.headers ];
|
||||
patches = [ ./systemd.patch ]; # bypass systemd detection
|
||||
|
||||
libs = dbus_drv "libs" "dbus" ({
|
||||
# Enable X11 autolaunch support in libdbus. This doesn't actually depend on X11
|
||||
# (it just execs dbus-launch in dbus.tools), contrary to what the configure script demands.
|
||||
NIX_CFLAGS_COMPILE = "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
|
||||
};
|
||||
} // stdenv.lib.optionalAttrs (systemdOrEmpty != []) {
|
||||
buildInputs = [ systemd.headers ];
|
||||
patches = [ ./systemd.patch ]; # bypass systemd detection
|
||||
});
|
||||
|
||||
|
||||
in rec {
|
||||
|
||||
@ -81,20 +83,20 @@ in rec {
|
||||
|
||||
tools = dbus_drv "tools" "tools" {
|
||||
configureFlags = [ "--with-dbus-daemondir=${daemon}/bin" ];
|
||||
buildInputs = buildInputsX ++ [ libs daemon systemd dbus_glib ];
|
||||
buildInputs = buildInputsX ++ systemdOrEmpty ++ [ libs daemon dbus_glib ];
|
||||
NIX_CFLAGS_LINK = "-Wl,--as-needed -ldbus-1";
|
||||
};
|
||||
|
||||
daemon = dbus_drv "daemon" "bus" {
|
||||
preBuild = makeInternalLib;
|
||||
buildInputs = [ systemd ];
|
||||
buildInputs = systemdOrEmpty;
|
||||
};
|
||||
|
||||
# Some of the tests don't work yet; in fact, @vcunat tried several packages
|
||||
# containing dbus testing, and all of them have some test failure.
|
||||
tests = dbus_drv "tests" "test" {
|
||||
preBuild = makeInternalLib;
|
||||
buildInputs = buildInputsX ++ [ systemd libs tools daemon dbus_glib python ];
|
||||
buildInputs = buildInputsX ++ systemdOrEmpty ++ [ libs tools daemon dbus_glib python ];
|
||||
NIX_CFLAGS_LINK = "-Wl,--as-needed -ldbus-1";
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user