nixpkgs/pkgs/development/libraries/dbus/default.nix
Eelco Dolstra e877e4dc13 * Dbus 1.4.1.
svn path=/nixpkgs/branches/x-updates/; revision=25903
2011-02-11 14:01:39 +00:00

60 lines
1.5 KiB
Nix

{ stdenv, fetchurl, pkgconfig, expat, libX11, libICE, libSM, useX11 ? true }:
let
version = "1.4.1";
src = fetchurl {
url = "http://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
sha256 = "1gc375cz6qwr32kl3vdhqll4k0s4pp4f7isf3mffkwnhsbga18fa";
};
patches = [ ./ignore-missing-includedirs.patch ];
configureFlags = "--localstatedir=/var --sysconfdir=/etc --with-session-socket-dir=/tmp";
in rec {
libs = stdenv.mkDerivation {
name = "dbus-library-" + version;
buildInputs = [ pkgconfig expat ];
inherit src patches configureFlags;
preConfigure =
''
sed -i '/mkinstalldirs.*localstatedir/d' bus/Makefile.in
sed -i '/SUBDIRS/s/ tools//' Makefile.in
'';
installFlags = "sysconfdir=$(out)/etc";
};
tools = stdenv.mkDerivation {
name = "dbus-tools-" + version;
inherit src patches;
configureFlags = "${configureFlags} --with-dbus-daemondir=${daemon}/bin";
buildInputs = [ pkgconfig expat libs ]
++ stdenv.lib.optionals useX11 [ libX11 libICE libSM ];
NIX_LDFLAGS = "-ldbus-1";
preConfigure =
''
sed -i 's@ $(top_builddir)/dbus/libdbus-1.la@@' tools/Makefile.in
substituteInPlace tools/Makefile.in --replace 'install-localstatelibDATA:' 'disabled:'
'';
postConfigure = "cd tools";
};
# I'm too lazy to separate daemon and libs now.
daemon = libs;
# FIXME TODO
# After merger it will be better to correct upstart-job instead.
outPath = daemon.outPath;
}