19 , withLibdnssdCompat ? false
24 stdenv.mkDerivation rec {
25 pname = "avahi${lib.optionalString withLibdnssdCompat "-compat"}";
29 url = "https://github.com/lathiat/avahi/releases/download/v${version}/avahi-${version}.tar.gz";
30 sha256 = "1npdixwxxn3s9q1f365x9n9rc5xgfz39hxf23faqvlrklgbhj0q6";
34 # CVE-2021-36217 / CVE-2021-3502
36 url = "https://github.com/lathiat/avahi/commit/9d31939e55280a733d930b15ac9e4dda4497680c.patch";
37 sha256 = "sha256-BXWmrLWUvDxKPoIPRFBpMS3T4gijRw0J+rndp6iDybU=";
41 url = "https://github.com/lathiat/avahi/commit/447affe29991ee99c6b9732fc5f2c1048a611d3b.patch";
42 sha256 = "sha256-qWaCU1ZkCg2PmijNto7t8E3pYRN/36/9FrG8okd6Gu8=";
63 ] ++ (with perlPackages; [
66 ]) ++ lib.optionals gtk3Support [
68 ] ++ lib.optionals qt5Support [
72 propagatedBuildInputs = lib.optionals withPython (with python.pkgs; [
81 # Use non-deprecated path https://github.com/lathiat/avahi/pull/376
82 "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
83 (lib.enableFeature gtk3Support "gtk3")
84 (lib.enableFeature qt5Support "qt5")
85 (lib.enableFeature withPython "python")
86 "--localstatedir=/var"
90 # A systemd unit is provided by the avahi-daemon NixOS module
91 "--with-systemdsystemunitdir=no"
92 ] ++ lib.optionals withLibdnssdCompat [
93 "--enable-compat-libdns_sd"
94 ] ++ lib.optionals stdenv.isDarwin [
95 # autoipd won't build on darwin
100 # Override directories to install into the package.
101 # Replace with runstatedir once is merged https://github.com/lathiat/avahi/pull/377
102 "avahi_runtime_dir=${placeholder "out"}/run"
103 "sysconfdir=${placeholder "out"}/etc"
106 preBuild = lib.optionalString stdenv.isDarwin ''
108 #define __APPLE_USE_RFC_2292' \
113 # Maintain compat for mdnsresponder
114 lib.optionalString withLibdnssdCompat ''
115 ln -s avahi-compat-libdns_sd/dns_sd.h "$out/include/dns_sd.h"
119 smoke-test = nixosTests.avahi;
120 smoke-test-resolved = nixosTests.avahi-with-resolved;
124 description = "mDNS/DNS-SD implementation";
125 homepage = "http://avahi.org";
126 license = licenses.lgpl2Plus;
127 platforms = platforms.unix;
128 maintainers = with maintainers; [ lovek323 globin ];
131 Avahi is a system which facilitates service discovery on a local
132 network. It is an implementation of the mDNS (for "Multicast
133 DNS") and DNS-SD (for "DNS-Based Service Discovery")