lol
1{ fetchurl, stdenv, pkgconfig, libdaemon, dbus, perl, perlXMLParser
2, expat, gettext, intltool, glib, libiconv
3, qt4 ? null
4, qt4Support ? false
5, withLibdnssdCompat ? false }:
6
7assert qt4Support -> qt4 != null;
8
9stdenv.mkDerivation rec {
10 name = "avahi-0.6.31";
11
12 src = fetchurl {
13 url = "${meta.homepage}/download/${name}.tar.gz";
14 sha256 = "0j5b5ld6bjyh3qhd2nw0jb84znq0wqai7fsrdzg7bpg24jdp2wl3";
15 };
16
17 patches = [ ./no-mkdir-localstatedir.patch ];
18
19 buildInputs = [ libdaemon dbus perl perlXMLParser glib expat libiconv ]
20 ++ (stdenv.lib.optional qt4Support qt4);
21
22 nativeBuildInputs = [ pkgconfig gettext intltool ];
23
24 configureFlags =
25 [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
26 "--disable-gtk" "--disable-gtk3"
27 "--${if qt4Support then "enable" else "disable"}-qt4"
28 "--disable-python" "--localstatedir=/var" "--with-distro=none" ]
29 ++ stdenv.lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
30 # autoipd won't build on darwin
31 ++ stdenv.lib.optional stdenv.isDarwin "--disable-autoipd";
32
33 preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
34 sed -i '20 i\
35 #define __APPLE_USE_RFC_2292' \
36 avahi-core/socket.c
37 '';
38
39 postInstall =
40 # Maintain compat for mdnsresponder and howl
41 stdenv.lib.optionalString withLibdnssdCompat ''
42 ln -s avahi-compat-libdns_sd/dns_sd.h "$out/include/dns_sd.h"
43 '';
44 /* # these don't exist (anymore?)
45 ln -s avahi-compat-howl $out/include/howl
46 ln -s avahi-compat-howl.pc $out/lib/pkgconfig/howl.pc
47 */
48
49 meta = with stdenv.lib; {
50 description = "mDNS/DNS-SD implementation";
51 homepage = http://avahi.org;
52 license = licenses.lgpl2Plus;
53 platforms = platforms.unix;
54 maintainers = with maintainers; [ lovek323 ];
55
56 longDescription = ''
57 Avahi is a system which facilitates service discovery on a local
58 network. It is an implementation of the mDNS (for "Multicast
59 DNS") and DNS-SD (for "DNS-Based Service Discovery")
60 protocols.
61 '';
62 };
63}