>From fac67e33fe0501ddcad3a1e75f20b4954f36834b Mon Sep 17 00:00:00 2001 From: Gregor Giesen
Date: Sun, 18 Jun 2017 14:27:34 +0200 Subject: [PATCH 1/1] gnu: Add unbound. * gnu/packages/dns.scm (unbound): New variable. --- gnu/packages/dns.scm | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm index 2e4d8fd18..d0d8319ce 100644 --- a/gnu/packages/dns.scm +++ b/gnu/packages/dns.scm @@ -8,6 +8,7 @@ ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice ;;; Copyright © 2016 Marius Bakke ;;; Copyright © 2017 Vasile Dumitrascu +;;; Copyright © 2017 Gregor Giesen ;;; ;;; This file is part of GNU Guix. ;;; @@ -31,6 +32,7 @@ #:use-module (gnu packages databases) #:use-module (gnu packages crypto) #:use-module (gnu packages datastructures) + #:use-module (gnu packages flex) #:use-module (gnu packages glib) #:use-module (gnu packages groff) #:use-module (gnu packages groff) @@ -42,12 +44,16 @@ #:use-module (gnu packages nettle) #:use-module (gnu packages perl) #:use-module (gnu packages pkg-config) + #:use-module (gnu packages protobuf) + #:use-module (gnu packages python) + #:use-module (gnu packages swig) #:use-module (gnu packages tls) #:use-module (gnu packages web) #:use-module (gnu packages xml) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu)) (define-public dnsmasq @@ -275,6 +281,146 @@ asynchronous fashion.") (license:non-copyleft "file://LICENSE") ; includes.h license:openssl)))) +(define-public unbound + (package + (name "unbound") + (version "1.6.3") + (source + (origin + (method url-fetch) + (uri (string-append "https://www.unbound.net/downloads/unbound-" + version ".tar.gz")) + (sha256 + (base32 + "0pw4m4z5qspsagxzbjb61xq5bhd57amw26xqvqzi6b8d3mf6azjc")))) + (build-system gnu-build-system) + (outputs '("out" "python")) + (inputs + `(("expat" ,expat) + ("flex" ,flex) + ("libevent" ,libevent) + ("protobuf" ,protobuf) + ("python" ,python-3) + ("python-wrapper" ,python-wrapper) + ("openssl" ,openssl) + ("swig" ,swig))) + (arguments + `(#:configure-flags + (list (string-append + "--with-ssl=" (assoc-ref %build-inputs "openssl")) + (string-append + "--with-libevent=" (assoc-ref %build-inputs "libevent")) + (string-append + "--with-libexpat=" (assoc-ref %build-inputs "expat")) + "--with-pythonmodule" "--with-pyunbound") + #:phases + (modify-phases + %standard-phases + (add-after 'configure 'fix-python-site-package-path + ;; Move python modules into their own output. + (lambda* (#:key outputs #:allow-other-keys) + (let ((pyout (assoc-ref outputs "python")) + (ver ,(version-major+minor (package-version python)))) + (substitute* "Makefile" + (("^PYTHON_SITE_PKG=.*$") + (string-append + "PYTHON_SITE_PKG=" + pyout "/lib/python-" ver "/site-packages\n")))))) + (add-before 'check 'fix-missing-nss-for-tests + (lambda* (#:key inputs outputs #:allow-other-keys) + (use-modules (guix build utils)) + (let* ((source (assoc-ref %build-inputs "source")) + (gcc (assoc-ref %build-inputs "gcc"))) + (call-with-output-file "/tmp/nss_preload.c" + (lambda (port) + (display "#include