Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / avahi.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages avahi)
23 #:use-module ((guix licenses) #:select (lgpl2.1+))
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages dbm)
29 #:use-module (gnu packages gettext)
30 #:use-module (gnu packages glib)
31 #:use-module (gnu packages libdaemon)
32 #:use-module (gnu packages libevent)
33 #:use-module (gnu packages linux)
34 #:use-module (gnu packages pkg-config)
35 #:use-module (gnu packages xml))
36
37 (define-public avahi
38 (package
39 (name "avahi")
40 (version "0.8")
41 (home-page "https://avahi.org")
42 (source (origin
43 (method url-fetch)
44 (uri (string-append home-page "/download/avahi-"
45 version ".tar.gz"))
46 (sha256
47 (base32
48 "1npdixwxxn3s9q1f365x9n9rc5xgfz39hxf23faqvlrklgbhj0q6"))
49 (patches (search-patches "avahi-localstatedir.patch"))
50 (modules '((guix build utils)))
51 (snippet
52 '(begin
53 ;; Fix version constraint in the avahi-libevent pkg-config file.
54 ;; This can be removed for Avahi versions > 0.8.
55 (substitute* "avahi-libevent.pc.in"
56 (("libevent-2\\.1\\.5")
57 "libevent >= 2.1.5"))
58 #t))))
59 (build-system gnu-build-system)
60 (arguments
61 '(#:configure-flags '("--with-distro=none"
62 "--disable-static"
63 "--localstatedir=/var" ; for the DBus socket
64 "--disable-python"
65 "--disable-mono"
66 "--disable-doxygen-doc"
67 "--disable-xmltoman"
68 "--enable-tests"
69 "--disable-qt4" "--disable-qt5"
70 "--disable-gtk" "--disable-gtk3"
71 "--enable-compat-libdns_sd")))
72 (inputs
73 `(("dbus" ,dbus)
74 ("expat" ,expat)
75 ("gdbm" ,gdbm)
76 ("glib" ,glib)
77 ("libcap" ,libcap) ;to enable chroot support in avahi-daemon
78 ("libdaemon" ,libdaemon)
79 ("libevent" ,libevent)))
80 (native-inputs
81 `(("gettext" ,gettext-minimal)
82 ("glib" ,glib "bin")
83 ("pkg-config" ,pkg-config)))
84 (synopsis "Implementation of mDNS/DNS-SD protocols")
85 (description
86 "Avahi is a system which facilitates service discovery on a local
87 network. It is an implementation of the mDNS (for \"Multicast DNS\") and
88 DNS-SD (for \"DNS-Based Service Discovery\") protocols.")
89 (license lgpl2.1+)))
90
91 (define-public nss-mdns
92 (package
93 (name "nss-mdns")
94 (version "0.14.1")
95 (home-page "https://github.com/lathiat/nss-mdns")
96 (source (origin
97 (method url-fetch)
98 (uri (string-append home-page "/releases/download/v" version "/"
99 name "-" version ".tar.gz"))
100 (sha256
101 (base32
102 "134wdr0n9cm5ab4g6dwq76lvzqns9dcylr470i2xxjimnw0l22d2"))))
103 (build-system gnu-build-system)
104 (arguments
105 ;; The Avahi daemon socket is expected by 'configure.ac' to be at
106 ;; "$(localstatedir)/run/avahi-daemon/socket", but nowadays it lives in
107 ;; /run/avahi-daemon/socket. Remove the "$(localstatedir)" bit.
108 '(#:configure-flags '("AVAHI_SOCKET=/run/avahi-daemon/socket")))
109 (synopsis "Multicast DNS Name Service Switch (@dfn{NSS}) plug-in")
110 (description
111 "Nss-mdns is a plug-in for the GNU C Library's Name Service Switch
112 (@dfn{NSS}) that resolves host names via multicast DNS (@dfn{mDNS}). It is
113 most often used in home and other small networks without a local name server,
114 to resolve host names in the @samp{.local} top-level domain.")
115 (license lgpl2.1+)))