Merge branch 'master' into core-updates
[jackhill/guix/guix.git] / gnu / packages / adns.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2015, 2016, 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
5 ;;; Copyright © 2019 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 adns)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system cmake)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages pkg-config))
29
30 (define-public adns
31 (package
32 (name "adns")
33 (version "1.5.1")
34 (source (origin
35 (method url-fetch)
36 (uri (list (string-append "mirror://gnu/adns/adns-"
37 version ".tar.gz")
38 (string-append
39 "http://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-"
40 version ".tar.gz")))
41 (sha256
42 (base32
43 "1ssfh94ck6kn98nf2yy6743srpgqgd167va5ja3bwx42igqjc42v"))))
44 (build-system gnu-build-system)
45 (arguments
46 ;; Make sure the programs under bin/ fine libadns.so.
47 '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
48 (assoc-ref %outputs "out")
49 "/lib"))
50
51 ;; XXX: Tests expect real name resolution to work.
52 #:tests? #f))
53 (home-page "https://www.gnu.org/software/adns/")
54 (synopsis "Asynchronous DNS client library and utilities")
55 (description
56 "GNU adns is a C library that provides easy-to-use DNS resolution
57 functionality. The library is asynchronous, allowing several concurrent
58 calls. The package also includes several command-line utilities for use in
59 scripts.")
60 (license gpl3+)))
61
62 (define-public c-ares
63 (package
64 (name "c-ares")
65 (version "1.16.0")
66 (source (origin
67 (method url-fetch)
68 (uri (string-append
69 "https://c-ares.haxx.se/download/" name "-" version
70 ".tar.gz"))
71 (sha256
72 (base32
73 "129sm0wzij0mp8vdv68v18hnykcjb6ivi66wnqnnw598q7bql1fy"))))
74 (build-system gnu-build-system)
75 (native-inputs
76 `(("pkg-config" ,pkg-config)))
77 (home-page "https://c-ares.haxx.se/")
78 (synopsis "C library for asynchronous DNS requests")
79 (description
80 "C-ares is a C library that performs DNS requests and name resolution
81 asynchronously. It is intended for applications which need to perform DNS
82 queries without blocking, or need to perform multiple DNS queries in parallel.
83 The primary examples of such applications are servers which communicate with
84 multiple clients and programs with graphical user interfaces.")
85 (license (x11-style "https://c-ares.haxx.se/license.html"))))
86
87 ;; gRPC requires a c-ares built with CMake in order to get the .cmake modules.
88 ;; We can not build c-ares itself with CMake because that would introduce a
89 ;; circular dependency through nghttp2.
90 ;; XXX: It would be nice if we could extract the modules somehow and make them
91 ;; work with the "normal" c-ares package instead of building a whole new library.
92 (define-public c-ares/cmake
93 (hidden-package
94 (package
95 (inherit c-ares)
96 (build-system cmake-build-system)
97 (arguments
98 `(;; XXX: Tests require name resolution (the normal variant runs no tests).
99 #:tests? #f)))))