diff --git a/pkgs/development/libraries/avahi/common.nix b/pkgs/development/libraries/avahi/common.nix index 1ebadc26e268..6b9c726f100c 100644 --- a/pkgs/development/libraries/avahi/common.nix +++ b/pkgs/development/libraries/avahi/common.nix @@ -1,5 +1,7 @@ sha256: args: with args; +assert qt4Support -> qt4 != null; + stdenv.mkDerivation rec { name = "avahi-" + version; src = fetchurl { @@ -7,12 +9,21 @@ stdenv.mkDerivation rec { inherit sha256; }; - buildInputs = [pkgconfig libdaemon dbus perl perlXMLParser glib qt4]; + buildInputs = [pkgconfig libdaemon dbus perl perlXMLParser glib expat] + ++ lib.optional qt4Support qt4; - configureFlags = "--disable-qt3 --disable-gdbm --disable-gtk --disable-mono - --with-distro=none --enable-shared --disable-static --disable-python"; + configureFlags = '' + --disable-qt3 --disable-gdbm --disable-gtk --disable-mono + --${if qt4Support then "enable" else "disable"}-qt4 + --with-distro=none --enable-shared --disable-static --disable-python + ''; meta = { + description = ''Avahi is a system which facilitates service discovery + on a local network. It is an implementation of the + mDNS (for "Multicast DNS") and DNS-SD (for "DNS-Based + Service Discovery") protocols.''; homepage = http://avahi.org; + license = "LGPLv2+"; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 3c7e4415a61b..d775aacc101b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -386,11 +386,19 @@ rec { inherit fetchurl stdenv zlib wxGTK; }; - avahi = selectVersion ../development/libraries/avahi "0.6.22" { - inherit stdenv fetchurl pkgconfig libdaemon dbus perl perlXMLParser qt4 - python expat; - inherit (gtkLibs) glib gtk; - }; + avahi = + # XXX: Versions prior to 0.6.22 did not support Qt4, so enabling + # Qt4 should not be permitted when using a version of Avahi older + # than 0.6.22, hence the default to `false'. + let qt4Support = getConfig [ "avahi" "qt4Support" ] false; + in + selectVersion ../development/libraries/avahi "0.6.22" { + inherit stdenv fetchurl pkgconfig libdaemon dbus perl perlXMLParser + expat lib; + inherit (gtkLibs) glib gtk; + inherit qt4Support; + qt4 = if qt4Support then qt4 else null; + }; axel = import ../tools/networking/axel { inherit fetchurl stdenv;