guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/3] gnu: Add go-1.5.


From: Efraim Flashner
Subject: Re: [PATCH 3/3] gnu: Add go-1.5.
Date: Wed, 13 Jan 2016 11:36:19 +0200

On Tue, 12 Jan 2016 21:25:37 +0100
Ricardo Wurmus <address@hidden> wrote:

> Efraim Flashner <address@hidden> writes:
> 
>  [...]  
> 
> [...]
> 
> > +    (arguments
> > +     (substitute-keyword-arguments (package-arguments go-1.4)
> > +       ((#:phases phases)
> > +        `(modify-phases ,phases
> > +         (replace 'build
> > +          (let* ((bash   (assoc-ref %build-inputs "bash"))
> > +                 (go14   (assoc-ref %build-inputs "go-1.4"))
> > +                 (output (assoc-ref %outputs "out")))
> > +            (setenv "CC" "gcc")
> > +            (setenv "GOPATH" (string-append (getcwd) "/go"))
> > +            (setenv "GOROOT_BOOTSTRAP" go14)
> > +            (setenv "GOROOT_FINAL" output)
> > +            (lambda _
> > +              (zero?
> > +                (system* (string-append bash "/bin/bash") 
> > "make.bash")))))))))  
> 
> This looks weird.  Shouldn’t the “let” and the “setenv” be inside the
> “lambda”?  (BTW: this is a perfect usecase for “M-x
> paredit-convolute-sexp”, after placing point before “(zero?”.)
> 
> I think you could do this instead:
> 
>    `(modify-phases ,phases
>       (replace 'build
>         (lambda* (#:key inputs outputs #:allow-other-keys)
>           (let ((go14   (assoc-ref inputs "go-1.4"))
>                 (output (assoc-ref outputs "out")))
>             (setenv "CC" "gcc")
>             (setenv "GOPATH" (string-append (getcwd) "/go"))
>             (setenv "GOROOT_BOOTSTRAP" go14)
>             (setenv "GOROOT_FINAL" output)
>             (zero? (system* "bash" "make.bash"))))))
> 
> ~~ Ricardo
> 

This looks better than before, and having the lambda earlier is
better/safer.  I've applied the same change to go-1.4 also.

-- 
Efraim Flashner   <address@hidden>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

Attachment: pgpuVFRpP07b_.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]