summary refs log tree commit diff
path: root/pkgs/development/libraries/dbus
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-08-23 14:31:37 -0400
committerworldofpeace <worldofpeace@protonmail.ch>2019-08-24 15:07:44 -0400
commita188cfadc6c3a149b07aa2b1dba7e3385e1095a4 (patch)
tree478e2d085957be0ced1957afcaa916b0a0c17af8 /pkgs/development/libraries/dbus
parentdc9c69efcf106c7bbb32154ba4f80ba2082e2808 (diff)
downloadnixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.tar
nixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.tar.gz
nixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.tar.bz2
nixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.tar.lz
nixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.tar.xz
nixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.tar.zst
nixpkgs-a188cfadc6c3a149b07aa2b1dba7e3385e1095a4.zip
dbus: stylize, use placeholder
Diffstat (limited to 'pkgs/development/libraries/dbus')
-rw-r--r--pkgs/development/libraries/dbus/default.nix196
1 files changed, 107 insertions, 89 deletions
diff --git a/pkgs/development/libraries/dbus/default.nix b/pkgs/development/libraries/dbus/default.nix
index 926d8d56af4..c962f50d3b8 100644
--- a/pkgs/development/libraries/dbus/default.nix
+++ b/pkgs/development/libraries/dbus/default.nix
@@ -1,92 +1,110 @@
-{ 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;
+
+stdenv.mkDerivation rec {
+  pname = "dbus";
+  version = "1.12.16";
 
-assert x11Support -> libX11 != null
-                  && libICE != null
-                  && libSM != null;
+  src = fetchurl {
+    url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
+    sha256 = "107ckxaff1cv4q6kmfdi2fb1nlsv03312a7kf6lb4biglhpjv8jl";
+  };
 
-let
-  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;
-    };
-
-    patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
-    postPatch = ''
-      substituteInPlace tools/Makefile.in \
-        --replace 'install-localstatelibDATA:' 'disabled:' \
-        --replace 'install-data-local:' 'disabled:' \
-        --replace 'installcheck-local:' 'disabled:'
-      substituteInPlace bus/Makefile.in \
-        --replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
-    '' + /* 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"'
-    '';
-
-    outputs = [ "out" "dev" "lib" "doc" ];
-
-    nativeBuildInputs = [ pkgconfig ];
-    propagatedBuildInputs = [ expat ];
-    buildInputs = lib.optional stdenv.isLinux systemd
-      ++ lib.optionals x11Support [ libX11 libICE libSM ];
-    # ToDo: optional selinux?
-
-    configureFlags = [
-      "--localstatedir=/var"
-      "--sysconfdir=/etc"
-      "--runstatedir=/run"
-      "--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"
-    ] ++ lib.optional (!x11Support) "--without-x";
-
-    # 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.
-    # problems building without x11Support so disabled in that case for now
-    NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
-    NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
-
-    enableParallelBuilding = true;
-
-    doCheck = true;
-
-    installFlags = [ "sysconfdir=$(out)/etc" "datadir=$(out)/share" ];
-
-    postInstall = ''
-      mkdir -p "$out/share/xml/dbus"
-      cp doc/*.dtd "$out/share/xml/dbus"
-    '';
-
-    # 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 = "${self.lib}/bin/dbus-launch";
-      daemon = self.out;
-    };
-
-    meta = with stdenv.lib; {
-      description = "Simple interprocess messaging system";
-      homepage = http://www.freedesktop.org/wiki/Software/dbus/;
-      license = licenses.gpl2Plus; # most is also under AFL-2.1
-      platforms = platforms.unix;
-    };
+  patches = lib.optional stdenv.isSunOS ./implement-getgrouplist.patch;
+
+  postPatch = ''
+    substituteInPlace tools/Makefile.in \
+      --replace 'install-localstatelibDATA:' 'disabled:' \
+      --replace 'install-data-local:' 'disabled:' \
+      --replace 'installcheck-local:' 'disabled:'
+    substituteInPlace bus/Makefile.in \
+      --replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
+  '' + /* 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"'
+  '';
+
+  outputs = [ "out" "dev" "lib" "doc" ];
+
+  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"
+    "--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=${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
+  # (it just execs dbus-launch in dbus.tools), contrary to what the configure script demands.
+  # problems building without x11Support so disabled in that case for now
+  NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
+  NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  installFlags = [
+    "sysconfdir=${placeholder ''out''}/etc"
+    "datadir=${placeholder ''out''}/share"
+  ];
+
+  postInstall = ''
+    mkdir -p "$out/share/xml/dbus"
+    cp doc/*.dtd "$out/share/xml/dbus"
+  '';
+
+  # 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;
+  };
+
+  meta = with stdenv.lib; {
+    description = "Simple interprocess messaging system";
+    homepage = http://www.freedesktop.org/wiki/Software/dbus/;
+    license = licenses.gpl2Plus; # most is also under AFL-2.1
+    platforms = platforms.unix;
   };
-in self
+}