dbus: stylize, use placeholder
This commit is contained in:
parent
dc9c69efcf
commit
a188cfadc6
|
@ -1,24 +1,31 @@
|
|||
{ stdenv, lib, fetchurl, pkgconfig, expat, systemd
|
||||
, libX11 ? null, libICE ? null, libSM ? null, x11Support ? (stdenv.isLinux || stdenv.isDarwin) }:
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, pkgconfig
|
||||
, expat
|
||||
, systemd
|
||||
, libX11 ? null
|
||||
, libICE ? null
|
||||
, libSM ? null
|
||||
, x11Support ? (stdenv.isLinux || stdenv.isDarwin)
|
||||
, dbus
|
||||
}:
|
||||
|
||||
assert x11Support -> libX11 != null
|
||||
&& libICE != null
|
||||
&& libSM != null;
|
||||
assert
|
||||
x11Support ->
|
||||
libX11 != null && libICE != null && libSM != null;
|
||||
|
||||
let
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dbus";
|
||||
version = "1.12.16";
|
||||
sha256 = "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl";
|
||||
|
||||
self = stdenv.mkDerivation {
|
||||
name = "dbus-${version}";
|
||||
inherit version;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
|
||||
inherit sha256;
|
||||
sha256 = "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl";
|
||||
};
|
||||
|
||||
patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace tools/Makefile.in \
|
||||
--replace 'install-localstatelibDATA:' 'disabled:' \
|
||||
|
@ -35,23 +42,32 @@ self = stdenv.mkDerivation {
|
|||
|
||||
outputs = [ "out" "dev" "lib" "doc" ];
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
propagatedBuildInputs = [ expat ];
|
||||
buildInputs = lib.optional stdenv.isLinux systemd
|
||||
++ lib.optionals x11Support [ libX11 libICE libSM ];
|
||||
nativeBuildInputs = [
|
||||
pkgconfig
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
expat
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals x11Support [
|
||||
libX11
|
||||
libICE
|
||||
libSM
|
||||
] ++ lib.optional stdenv.isLinux systemd;
|
||||
# ToDo: optional selinux?
|
||||
|
||||
configureFlags = [
|
||||
"--enable-user-session"
|
||||
"--libexecdir=${placeholder ''out''}/libexec"
|
||||
"--localstatedir=/var"
|
||||
"--sysconfdir=/etc"
|
||||
"--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=$(out)/etc/systemd/system"
|
||||
"--with-systemduserunitdir=$(out)/etc/systemd/user"
|
||||
"--enable-user-session"
|
||||
"--libexecdir=$(out)/libexec"
|
||||
"--with-systemdsystemunitdir=${placeholder ''out''}/etc/systemd/system"
|
||||
"--with-systemduserunitdir=${placeholder ''out''}/etc/systemd/user"
|
||||
] ++ lib.optional (!x11Support) "--without-x";
|
||||
|
||||
# Enable X11 autolaunch support in libdbus. This doesn't actually depend on X11
|
||||
|
@ -64,7 +80,10 @@ self = stdenv.mkDerivation {
|
|||
|
||||
doCheck = true;
|
||||
|
||||
installFlags = [ "sysconfdir=$(out)/etc" "datadir=$(out)/share" ];
|
||||
installFlags = [
|
||||
"sysconfdir=${placeholder ''out''}/etc"
|
||||
"datadir=${placeholder ''out''}/share"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p "$out/share/xml/dbus"
|
||||
|
@ -78,8 +97,8 @@ self = stdenv.mkDerivation {
|
|||
'';
|
||||
|
||||
passthru = {
|
||||
dbus-launch = "${self.lib}/bin/dbus-launch";
|
||||
daemon = self.out;
|
||||
dbus-launch = "${dbus.lib}/bin/dbus-launch";
|
||||
daemon = dbus.out;
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -88,5 +107,4 @@ self = stdenv.mkDerivation {
|
|||
license = licenses.gpl2Plus; # most is also under AFL-2.1
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
};
|
||||
in self
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue