2019-03-26 20:32:00 +00:00
|
|
|
{ fetchurl, fetchpatch, stdenv, pkgconfig, libdaemon, dbus, perlPackages
|
2014-11-26 23:16:50 +00:00
|
|
|
, expat, gettext, intltool, glib, libiconv
|
2018-12-02 21:47:16 +00:00
|
|
|
, gtk3Support ? false, gtk3 ? null
|
2013-07-07 10:35:25 +00:00
|
|
|
, qt4 ? null
|
2011-02-11 15:56:29 +00:00
|
|
|
, qt4Support ? false
|
2019-04-18 05:36:26 +00:00
|
|
|
, withLibdnssdCompat ? false
|
|
|
|
, python ? null
|
|
|
|
, withPython ? false }:
|
2008-02-18 20:48:36 +00:00
|
|
|
|
2008-03-06 16:42:34 +00:00
|
|
|
assert qt4Support -> qt4 != null;
|
|
|
|
|
2008-02-18 20:48:36 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-02-25 07:42:04 +00:00
|
|
|
name = "avahi${stdenv.lib.optionalString withLibdnssdCompat "-compat"}-${version}";
|
2017-08-01 04:34:56 +00:00
|
|
|
version = "0.7";
|
2010-10-05 15:15:49 +00:00
|
|
|
|
2008-02-18 20:48:36 +00:00
|
|
|
src = fetchurl {
|
2016-07-01 08:21:59 +00:00
|
|
|
url = "https://github.com/lathiat/avahi/releases/download/v${version}/avahi-${version}.tar.gz";
|
2017-08-01 04:34:56 +00:00
|
|
|
sha256 = "0128n7jlshw4bpx0vg8lwj8qwdisjxi7mvniwfafgnkzzrfrpaap";
|
2008-02-18 20:48:36 +00:00
|
|
|
};
|
|
|
|
|
2019-03-26 20:32:00 +00:00
|
|
|
patches = [
|
|
|
|
./no-mkdir-localstatedir.patch
|
|
|
|
(fetchpatch {
|
|
|
|
name ="CVE-2017-6519-CVE-2018-100084.patch";
|
2020-04-01 01:11:51 +00:00
|
|
|
url = "https://github.com/lathiat/avahi/commit/e111def44a7df4624a4aa3f85fe98054bffb6b4f.patch";
|
2019-03-26 20:32:00 +00:00
|
|
|
sha256 = "06n7b7kz6xcc35c7xjfc1kj3k2llyjgi09nhy0ci32l1bhacjw0q";
|
|
|
|
})
|
|
|
|
];
|
2010-05-08 22:24:39 +00:00
|
|
|
|
2018-10-12 22:56:15 +00:00
|
|
|
buildInputs = [ libdaemon dbus glib expat libiconv ]
|
|
|
|
++ (with perlPackages; [ perl XMLParser ])
|
2018-12-02 21:47:16 +00:00
|
|
|
++ (stdenv.lib.optional gtk3Support gtk3)
|
2014-11-26 23:16:50 +00:00
|
|
|
++ (stdenv.lib.optional qt4Support qt4);
|
2008-02-18 20:48:36 +00:00
|
|
|
|
2019-04-18 05:36:26 +00:00
|
|
|
propagatedBuildInputs =
|
|
|
|
stdenv.lib.optionals withPython (with python.pkgs; [ python pygobject3 dbus-python ]);
|
|
|
|
|
2017-12-20 18:58:56 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig gettext intltool glib ];
|
2011-09-18 13:54:54 +00:00
|
|
|
|
2010-05-08 22:24:39 +00:00
|
|
|
configureFlags =
|
2010-07-13 16:32:22 +00:00
|
|
|
[ "--disable-qt3" "--disable-gdbm" "--disable-mono"
|
2019-09-16 01:47:44 +00:00
|
|
|
"--disable-gtk" "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
|
2018-12-02 21:47:16 +00:00
|
|
|
(stdenv.lib.enableFeature gtk3Support "gtk3")
|
2010-07-13 16:32:22 +00:00
|
|
|
"--${if qt4Support then "enable" else "disable"}-qt4"
|
2019-04-18 05:36:26 +00:00
|
|
|
(stdenv.lib.enableFeature withPython "python")
|
|
|
|
"--localstatedir=/var" "--with-distro=none"
|
2017-12-20 18:58:56 +00:00
|
|
|
# A systemd unit is provided by the avahi-daemon NixOS module
|
|
|
|
"--with-systemdsystemunitdir=no" ]
|
2013-07-07 10:35:25 +00:00
|
|
|
++ stdenv.lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
|
|
|
|
# autoipd won't build on darwin
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin "--disable-autoipd";
|
|
|
|
|
2019-05-22 18:46:10 +00:00
|
|
|
NIX_CFLAGS_COMPILE = "-DAVAHI_SERVICE_DIR=\"/etc/avahi/services\"";
|
|
|
|
|
2013-07-07 10:35:25 +00:00
|
|
|
preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
|
|
|
|
sed -i '20 i\
|
|
|
|
#define __APPLE_USE_RFC_2292' \
|
|
|
|
avahi-core/socket.c
|
|
|
|
'';
|
|
|
|
|
2016-01-01 09:01:36 +00:00
|
|
|
postInstall =
|
2013-12-03 01:48:20 +00:00
|
|
|
# Maintain compat for mdnsresponder and howl
|
2016-01-01 09:01:36 +00:00
|
|
|
stdenv.lib.optionalString withLibdnssdCompat ''
|
|
|
|
ln -s avahi-compat-libdns_sd/dns_sd.h "$out/include/dns_sd.h"
|
|
|
|
'';
|
|
|
|
/* # these don't exist (anymore?)
|
2013-12-03 01:48:20 +00:00
|
|
|
ln -s avahi-compat-howl $out/include/howl
|
|
|
|
ln -s avahi-compat-howl.pc $out/lib/pkgconfig/howl.pc
|
2016-01-01 09:01:36 +00:00
|
|
|
*/
|
2013-12-03 01:48:20 +00:00
|
|
|
|
2013-07-07 10:35:25 +00:00
|
|
|
meta = with stdenv.lib; {
|
2013-10-05 14:22:46 +00:00
|
|
|
description = "mDNS/DNS-SD implementation";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://avahi.org";
|
2013-07-07 10:35:25 +00:00
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
platforms = platforms.unix;
|
2019-08-20 17:36:05 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 globin ];
|
2013-07-07 10:35:25 +00:00
|
|
|
|
2008-03-20 14:35:03 +00:00
|
|
|
longDescription = ''
|
|
|
|
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.
|
|
|
|
'';
|
2008-02-18 20:48:36 +00:00
|
|
|
};
|
|
|
|
}
|