From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] gnu: bind-utils: Build and install =?utf-8?B?4oCcbnN1?= =?utf-8?B?cGRhdGXigJ0u?= Date: Thu, 14 Jan 2016 12:53:20 +0100 Message-ID: References: <8760yxt2by.fsf@gnu.org> <87lh7stu35.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52632) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aJgT5-0003O2-RH for guix-devel@gnu.org; Thu, 14 Jan 2016 06:53:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aJgT2-0005Ka-Ib for guix-devel@gnu.org; Thu, 14 Jan 2016 06:53:31 -0500 In-Reply-To: <87lh7stu35.fsf@gmail.com> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Alex Kost Cc: Guix-devel Alex Kost writes: > Mathieu Lirzin (2016-01-14 03:46 +0300) wrote: > >> Hi, >> >> Ricardo Wurmus writes: >> >>>>From ba328617777728c3534be6796b6b32a9a90954b6 Mon Sep 17 00:00:00 200= 1 >>> From: Ricardo Wurmus >>> Date: Wed, 13 Jan 2016 16:06:36 +0100 >>> Subject: [PATCH] gnu: bind-utils: Build and install "nsupdate". >>> >>> * gnu/packages/dns.scm (bind-utils)[arguments]: Generalize "build" an= d >>> "install" phases. >>> --- >>> gnu/packages/dns.scm | 105 ++++++++++++++++++++++++++++-------------= ---------- >>> 1 file changed, 58 insertions(+), 47 deletions(-) >>> >>> diff --git a/gnu/packages/dns.scm b/gnu/packages/dns.scm >>> index 8357dad..0a42722 100644 >>> --- a/gnu/packages/dns.scm >>> +++ b/gnu/packages/dns.scm >> [...] >>> + (arguments >>> + `(#:tests? #f ; no test phase implemented >>> + #:configure-flags >>> + (list (string-append "--with-openssl=3D" >>> + (assoc-ref %build-inputs "openssl")) >>> + (string-append "--with-dlz-mysql=3D" >>> + (assoc-ref %build-inputs "mysql")) >>> + (string-append "--with-pkcs11=3D" >>> + (assoc-ref %build-inputs "p11-kit"))) >> >> What about: >> >> #:configure-flags >> (map (lambda (opt val) >> (string-append opt (assoc-ref %build-inputs val))) >> '("--with-openssl=3D" "--with-dlz-mysql=3D" "--with-pkcs11= =3D") >> '("openssl" "mysql" "p11-kit")) > > As for me, I prefer the original variant as it looks more clear for me. > When I look at this (map ...), I need some time to understand what it > does. I didn=E2=80=99t change this. I only adjusted the indentation. I have a= slight preference for keeping it the way it is. >>> + #:modules ((srfi srfi-1) >>> + (srfi srfi-26) >>> + ,@%gnu-build-system-modules) >>> + #:phases >>> + (modify-phases %standard-phases >>> + (replace 'build >>> + (lambda _ >>> + (fold (lambda (dir pass) >>> + (and pass (zero? (system* "make" "-C" dir)))) >>> + #t >>> + (append >>> + (map (cut string-append "lib/" <>) >>> + (list ,@libs)) >>> + (map (cut string-append "bin/" <>) >>> + (list ,@bins)))))) >>> + (replace 'install >>> + (lambda _ >>> + (fold (lambda (dir pass) >>> + (and pass (zero? (system* "make" "-C" dir "in= stall")))) >>> + #t >>> + (map (cut string-append "bin/" <>) >>> + (list ,@bins)))))))) >> >> and this: >> >> (let ((libs '("dns" "isc" "bind9" "isccfg" "lwres")) >> (bins '("dig" "nsupdate"))) >> (modify-phases %standard-phases >> (replace 'build >> (lambda _ >> (every (lambda (dir) >> (zero? (system* "make" "-C" dir))) >> (append (map (cut string-append "lib/" <>) libs) >> (map (cut string-append "bin/" <>) bins)= )))) >> (replace 'install >> (lambda _ >> (every (lambda (dir) >> (zero? (system* "make" "-C" dir "install"))) >> (map (cut string-append "bin/" <>) bins)))))))) >> > > I also think 'every' is more suitable here. I agree, this looks nicer. Would you like to push this change? There isn=E2=80=99t much left of my original patch ;) ~~ Ricardo