Jan Nieuwenhuizen (2016-08-09 19:04 +0300) wrote:

[...]
>>> +                      (for-each (lambda (var)
>>> +                                  (and=> (getenv var)
>>> +                                         (lambda (value)
>>> +                                           (let ((cross
>>> +                                                  (string-append "CROSS_" 
>>> var)))
>>> +                                             (setenv cross value))
>>> +                                           (unsetenv var))))
>>> +                                '("C_INCLUDE_PATH"
>>> +                                  "CPLUS_INCLUDE_PATH"
>>> +                                  "OBJC_INCLUDE_PATH"
>>> +                                  "OBJCPLUS_INCLUDE_PATH"
>>> +                                  "LIBRARY_PATH"))
>>
>> I have already seen this list of environment variables in an earlier
>> patch.  Perhaps it would be reasonable to make some global variable with
>> this list and to put it in (guix build utils) or another appropriate
>> place, WDYT?
>
> I have quicke tested the additional patch below which seems to work.  It
> would need some more testing.  How do you like that?

I like it very much, the only small thing...

> diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
> index f6c30ec..0d36143 100644
> --- a/gnu/packages/cross-base.scm
> +++ b/gnu/packages/cross-base.scm
> @@ -45,6 +45,15 @@
>    ;; be 'gcc' and can be a specific variant such as 'gcc-4.8'.
>    gcc)
>  
> +(define gcc-include-paths
> +  '("C_INCLUDE_PATH"
> +    "CPLUS_INCLUDE_PATH"
> +    "OBJC_INCLUDE_PATH"
> +    "OBJCPLUS_INCLUDE_PATH"))
> +
> +(define gcc-cross-include-paths
> +  (map (cut string-append "CROSS_" <>) gcc-include-paths))

... by convention global variables are prefixed with "%" in
guix code, i.e.: '%gcc-include-paths' and '%gcc-cross-include-paths'.

Perhaps it would be better to have a procedure that transforms usual
paths into cross paths instead of '%gcc-cross-include-paths':

  (define* (paths->cross-paths #:optional (paths %gcc-include-paths))
    (map (cut string-append "CROSS_" <>) paths))

or maybe it is not worth bothering.

The rest looks good to me, thanks!  But again I'm not competent to judge
on the matter of this patchset, IIUC Andy is going to handle it, right?

-- 
Alex

Reply via email to