adns.scm 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2015, 2016, 2018, 2020 Efraim Flashner <efraim@flashner.co.il>
  4. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  5. ;;; Copyright © 2019, 2021 Marius Bakke <marius@gnu.org>
  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. (define-module (gnu packages adns)
  22. #:use-module (guix licenses)
  23. #:use-module (guix packages)
  24. #:use-module (guix download)
  25. #:use-module (guix build-system cmake)
  26. #:use-module (guix build-system gnu)
  27. #:use-module (gnu packages m4)
  28. #:use-module (gnu packages pkg-config))
  29. (define-public adns
  30. (package
  31. (name "adns")
  32. (version "1.6.0")
  33. (source (origin
  34. (method url-fetch)
  35. (uri (list (string-append "mirror://gnu/adns/adns-"
  36. version ".tar.gz")
  37. (string-append
  38. "https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-"
  39. version ".tar.gz")))
  40. (sha256
  41. (base32
  42. "1pi0xl07pav4zm2jrbrfpv43s1r1q1y12awgak8k7q41m5jp4hpv"))))
  43. (build-system gnu-build-system)
  44. (arguments
  45. ;; Make sure the programs under bin/ fine libadns.so.
  46. '(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath -Wl,"
  47. (assoc-ref %outputs "out")
  48. "/lib"))
  49. ;; XXX: Tests expect real name resolution to work.
  50. #:tests? #f))
  51. (native-inputs
  52. `(("m4" ,m4)))
  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. (define-public c-ares
  62. (package
  63. (name "c-ares")
  64. (version "1.17.1")
  65. (source (origin
  66. (method url-fetch)
  67. (uri (string-append
  68. "https://c-ares.haxx.se/download/" name "-" version
  69. ".tar.gz"))
  70. (sha256
  71. (base32
  72. "0h7wjfnk2092glqcp9mqaax7xx0s13m501z1gi0gsjl2vvvd0gfp"))))
  73. (build-system gnu-build-system)
  74. (arguments
  75. '(#:phases
  76. (modify-phases %standard-phases
  77. (add-before 'check 'filter-live-tests
  78. (lambda _
  79. ;; Filter tests that require internet access.
  80. (setenv "GTEST_FILTER" "-*.Live*:*.FamilyV4*"))))))
  81. (native-inputs
  82. `(("pkg-config" ,pkg-config)))
  83. (home-page "https://c-ares.haxx.se/")
  84. (synopsis "C library for asynchronous DNS requests")
  85. (description
  86. "C-ares is a C library that performs DNS requests and name resolution
  87. asynchronously. It is intended for applications which need to perform DNS
  88. queries without blocking, or need to perform multiple DNS queries in parallel.
  89. The primary examples of such applications are servers which communicate with
  90. multiple clients and programs with graphical user interfaces.")
  91. (license (x11-style "https://c-ares.haxx.se/license.html"))))
  92. ;; gRPC requires a c-ares built with CMake in order to get the .cmake modules.
  93. ;; We can not build c-ares itself with CMake because that would introduce a
  94. ;; circular dependency through nghttp2.
  95. ;; XXX: It would be nice if we could extract the modules somehow and make them
  96. ;; work with the "normal" c-ares package instead of building a whole new library.
  97. (define-public c-ares/cmake
  98. (hidden-package
  99. (package
  100. (inherit c-ares)
  101. (build-system cmake-build-system)
  102. (arguments
  103. `(;; XXX: Tests require name resolution (the normal variant runs no tests).
  104. #:tests? #f)))))