unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
@ 2015-02-05 16:27 Marek Benc
  2015-02-07 23:18 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Benc @ 2015-02-05 16:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 107 bytes --]

This fixes the problem Manolis was facing earlier, with string-append 
getting an #f argument.

-- 
Marek.

[-- Attachment #2: git-patch-2.patch --]
[-- Type: text/x-patch, Size: 3035 bytes --]

From 4dc55bfe59bf60c4f55a7e54da2f5ee17589ff9e Mon Sep 17 00:00:00 2001
From: Marek Benc <dusxmt@gmx.com>
Date: Thu, 5 Feb 2015 17:01:14 +0100
Subject: [PATCH] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
 systems.

* gnu/packages/cross-base.scm (cross-gcc-arguments): Make 'set-cross-path aware of the Hurd.

---
 gnu/packages/cross-base.scm | 25 ++++++++++++++++++-------
 1 file changed, 18 insertions(+), 7 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index e051756..1ebe862 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -129,23 +129,34 @@ may be either a libc package or #f.)"
              `(alist-cons-before
                'configure 'set-cross-path
                (lambda* (#:key inputs #:allow-other-keys)
-                 ;; Add the cross-Linux headers to CROSS_CPATH, and remove them
+                 ;; Add the cross-kernel headers to CROSS_CPATH, and remove them
                  ;; from CPATH.
                  (let ((libc  (assoc-ref inputs "libc"))
                        (linux (assoc-ref inputs
-                                         "libc/cross-linux-headers")))
+                                         "libc/cross-linux-headers"))
+                       (mach  (assoc-ref inputs
+                                         "libc/cross-gnumach-headers"))
+                       (hurd  (assoc-ref inputs
+                                         "libc/cross-hurd-headers"))
+                       (hurd-minimal (assoc-ref inputs
+                                         "libc/cross-hurd-minimal")))
 
                    (define (cross? x)
                      ;; Return #t if X is a cross-libc or a cross-kernel.
                      (or (string-prefix? libc x)
-                         (string-prefix? linux x)))
+                         (if linux        (string-prefix? linux x) #f)
+                         (if hurd         (string-prefix? hurd  x) #f)
+                         (if mach         (string-prefix? mach  x) #f)
+                         (if hurd-minimal (string-prefix? hurd-minimal x) #f)))
 
                    (setenv "CROSS_CPATH"
-                           (string-append libc  "/include:"
-                                          linux "/include"))
+                           (string-append libc "/include"
+                                          (if linux (string-append ":" linux "/include") "")
+                                          (if hurd  (string-append ":" hurd  "/include"
+                                                                   ":" mach  "/include") "")))
                    (setenv "CROSS_LIBRARY_PATH"
-                           (string-append libc "/lib"))
-
+                           (string-append libc "/lib"
+                                          (if hurd-minimal (string-append ":" hurd-minimal "/lib") "")))
 
                    (let ((cpath   (search-path-as-string->list
                                    (getenv "CPATH")))
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
  2015-02-05 16:27 [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd) Marek Benc
@ 2015-02-07 23:18 ` Ludovic Courtès
  2015-02-10 14:20   ` Manolis Ragkousis
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2015-02-07 23:18 UTC (permalink / raw)
  To: Marek Benc, Manolis Ragkousis; +Cc: guix-devel

Marek Benc <dusxmt@gmx.com> skribis:

> From 4dc55bfe59bf60c4f55a7e54da2f5ee17589ff9e Mon Sep 17 00:00:00 2001
> From: Marek Benc <dusxmt@gmx.com>
> Date: Thu, 5 Feb 2015 17:01:14 +0100
> Subject: [PATCH] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
>  systems.
>
> * gnu/packages/cross-base.scm (cross-gcc-arguments): Make 'set-cross-path aware of the Hurd.

LGTM.

Manolis: could you wrap lines to 80 chars and apply it to wip-hurd?

TIA,
Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
  2015-02-07 23:18 ` Ludovic Courtès
@ 2015-02-10 14:20   ` Manolis Ragkousis
  2015-02-10 16:25     ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Manolis Ragkousis @ 2015-02-10 14:20 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

[-- Attachment #1: Type: text/plain, Size: 55 bytes --]

Ludo is this okay to push?

Wrapped lines to 80 chars.

[-- Attachment #2: 0001-gnu-cross-base-Make-it-aware-of-non-Linux-ie.-Hurd-s.patch --]
[-- Type: text/x-patch, Size: 3240 bytes --]

From aaa968bbe01a57ceadf8d0c46c44e0d75d2f90cd Mon Sep 17 00:00:00 2001
From: Marek Benc <dusxmt@gmx.com>
Date: Thu, 5 Feb 2015 17:01:14 +0100
Subject: [PATCH] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
 systems.

* gnu/packages/cross-base.scm (cross-gcc-arguments): Make 'set-cross-path aware of the Hurd.
---
 gnu/packages/cross-base.scm | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index f881096..8929f7f 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -151,21 +151,36 @@ GCC that does not target a libc; otherwise, target that libc."
                  `(alist-cons-before
                    'configure 'set-cross-path
                    (lambda* (#:key inputs #:allow-other-keys)
-                     ;; Add the cross Linux headers to CROSS_CPATH, and remove
+                     ;; Add the cross kernel headers to CROSS_CPATH, and remove
                      ;; them from CPATH.
                      (let ((libc  (assoc-ref inputs "libc"))
                            (linux (assoc-ref inputs
-                                             "libc/cross-linux-headers")))
+                                             "libc/cross-linux-headers"))
+                           (mach  (assoc-ref inputs
+                                             "libc/cross-gnumach-headers"))
+                           (hurd  (assoc-ref inputs
+                                             "libc/cross-hurd-headers"))
+                           (hurd-minimal (assoc-ref inputs
+                                         "libc/cross-hurd-minimal")))
                        (define (cross? x)
                          ;; Return #t if X is a cross-libc or cross Linux.
                          (or (string-prefix? libc x)
-                             (string-prefix? linux x)))
+                             (if linux        (string-prefix? linux x) #f)
+                             (if hurd         (string-prefix? hurd  x) #f)
+                             (if mach         (string-prefix? mach  x) #f)
+                             (if hurd-minimal (string-prefix? hurd-minimal x) #f)))
 
                        (setenv "CROSS_CPATH"
-                               (string-append libc "/include:"
-                                              linux "/include"))
+                               (string-append libc "/include"
+                                (if linux
+                                    (string-append ":" linux "/include") "")
+                                (if hurd
+                                    (string-append ":" hurd  "/include"
+                                                   ":" mach  "/include") "")))
                        (setenv "CROSS_LIBRARY_PATH"
-                               (string-append libc "/lib"))
+                               (string-append libc "/lib"
+                                (if hurd-minimal
+                                    (string-append ":" hurd-minimal "/lib") "")))
 
                        (let ((cpath   (search-path-as-string->list
                                        (getenv "CPATH")))
-- 
2.3.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
  2015-02-10 14:20   ` Manolis Ragkousis
@ 2015-02-10 16:25     ` Ludovic Courtès
  2015-02-10 16:37       ` Marek Benc
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2015-02-10 16:25 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> From aaa968bbe01a57ceadf8d0c46c44e0d75d2f90cd Mon Sep 17 00:00:00 2001
> From: Marek Benc <dusxmt@gmx.com>
> Date: Thu, 5 Feb 2015 17:01:14 +0100
> Subject: [PATCH] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
>  systems.
>
> * gnu/packages/cross-base.scm (cross-gcc-arguments): Make 'set-cross-path aware of the Hurd.

Please wrap line.

>                         (setenv "CROSS_CPATH"
> -                               (string-append libc "/include:"
> -                                              linux "/include"))
> +                               (string-append libc "/include"
> +                                (if linux
> +                                    (string-append ":" linux "/include") "")
> +                                (if hurd
> +                                    (string-append ":" hurd  "/include"
> +                                                   ":" mach  "/include") "")))

Please align ‘else’ branch with ‘then’ branch:

  (if hurd
      consequent
      alternate)

>                         (setenv "CROSS_LIBRARY_PATH"
> -                               (string-append libc "/lib"))
> +                               (string-append libc "/lib"
> +                                (if hurd-minimal
> +                                    (string-append ":" hurd-minimal "/lib") "")))

Ditto.

As I suggested to Manolis, could you make sure that this doesn’t break
the existing GNU/Linux cross-toolchains?

Namely, could you run:

  guix build -e '(@ (gnu packages cross-base) xgcc-armhf)'

If that passes, OK to push to wip-hurd.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
  2015-02-10 16:25     ` Ludovic Courtès
@ 2015-02-10 16:37       ` Marek Benc
  2015-02-10 17:09         ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Marek Benc @ 2015-02-10 16:37 UTC (permalink / raw)
  To: Ludovic Courtès, Manolis Ragkousis; +Cc: Guix-devel



On 02/10/2015 05:25 PM, Ludovic Courtès wrote:

>
> As I suggested to Manolis, could you make sure that this doesn’t break
> the existing GNU/Linux cross-toolchains?
>
> Namely, could you run:
>
>    guix build -e '(@ (gnu packages cross-base) xgcc-armhf)'
>

I've tested most of my patches with:

$ guix build coreutils --target=i686-pc-linux-gnu; # 32bit x86 GNU/Linux

since I can very easily test whether those binaries work (my virtual 
machine is an x86_64), and it all worked so far, but I'll check the 
armhf xgcc as well.

>
> Ludo’.
>

-- 
Marek.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
  2015-02-10 16:37       ` Marek Benc
@ 2015-02-10 17:09         ` Ludovic Courtès
  2015-02-11 16:39           ` Manolis Ragkousis
  0 siblings, 1 reply; 7+ messages in thread
From: Ludovic Courtès @ 2015-02-10 17:09 UTC (permalink / raw)
  To: Marek Benc; +Cc: Guix-devel

Marek Benc <dusxmt@gmx.com> skribis:

> On 02/10/2015 05:25 PM, Ludovic Courtès wrote:
>
>>
>> As I suggested to Manolis, could you make sure that this doesn’t break
>> the existing GNU/Linux cross-toolchains?
>>
>> Namely, could you run:
>>
>>    guix build -e '(@ (gnu packages cross-base) xgcc-armhf)'
>>
>
> I've tested most of my patches with:
>
> $ guix build coreutils --target=i686-pc-linux-gnu; # 32bit x86 GNU/Linux
>
> since I can very easily test whether those binaries work (my virtual
> machine is an x86_64), and it all worked so far, but I'll check the
> armhf xgcc as well.

OK, very well.  So you can go ahead, thanks!

Ludo’.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd)
  2015-02-10 17:09         ` Ludovic Courtès
@ 2015-02-11 16:39           ` Manolis Ragkousis
  0 siblings, 0 replies; 7+ messages in thread
From: Manolis Ragkousis @ 2015-02-11 16:39 UTC (permalink / raw)
  To: dusxmt; +Cc: Guix-devel

Followed Ludovic's suggestions and pushed to wip-hurd.

Thanks Marek.

Manolis

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-02-11 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-05 16:27 [PATCH 2/4] gnu: cross-base: Make it aware of non-Linux (ie. Hurd) Marek Benc
2015-02-07 23:18 ` Ludovic Courtès
2015-02-10 14:20   ` Manolis Ragkousis
2015-02-10 16:25     ` Ludovic Courtès
2015-02-10 16:37       ` Marek Benc
2015-02-10 17:09         ` Ludovic Courtès
2015-02-11 16:39           ` Manolis Ragkousis

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).