unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: cross-base: Add libc/hurd.
@ 2014-10-26 10:27 Manolis Ragkousis
  2014-10-29 23:04 ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Manolis Ragkousis @ 2014-10-26 10:27 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

Ludovic this is a updated cross-base patch with a more appropriate commit log.

[-- Attachment #2: 0001-gnu-cross-base-Add-libc-hurd.patch --]
[-- Type: text/x-patch, Size: 5920 bytes --]

From 66df601071d093c5532dec4c1ff55beb141a53d1 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Sun, 26 Oct 2014 11:29:41 +0000
Subject: [PATCH] gnu: cross-base: Add libc/hurd.

* gnu/packages/cross-base.scm (cross-libc/hurd): New variable.
---
 gnu/packages/cross-base.scm | 118 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 118 insertions(+)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 90fc606..5962419 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -23,6 +23,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages hurd)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix utils)
@@ -263,6 +264,123 @@ XBINUTILS and the cross tool chain."
                      ("cross-binutils" ,xbinutils)
                      ,@(package-native-inputs glibc)))))
 
+(define* (cross-libc/hurd target
+                          #:optional
+                          (xgcc (cross-gcc target))
+                          (xbinutils (cross-binutils target)))
+
+  "Return a libc cross-built for TARGET=i686-pc-gnu. Use XGCC and
+XBINUTILS and the cross tool chain."
+
+  (define xgnumach-headers
+    (package (inherit gnumach-headers)
+      (name (string-append (package-name gnumach-headers)
+                           "-cross-" target))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(package-native-inputs gnumach-headers)))))
+
+  (define xmig
+    (package (inherit mig)
+      (name (string-append "mig-cross"))
+      (arguments
+       (substitute-keyword-arguments (package-arguments mig)
+         ((#:configure-flags flags)
+          `(cons ,(string-append "--host=" target)
+                 ,flags))))
+
+      (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)))
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(package-native-inputs mig)))))
+
+  (define xhurd-headers
+    (package (inherit hurd-headers)
+      (name (string-append (package-name hurd-headers)
+                           "-cross-" target))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs hurd-headers))))))
+
+  (define xglibc/hurd-headers
+    (package (inherit glibc/hurd-headers)
+      (name (string-append (package-name glibc/hurd-headers)
+                           "-cross-" target))
+
+      (arguments
+       (substitute-keyword-arguments (package-arguments glibc/hurd-headers)
+         ((#:phases phases)
+          `(alist-cons-before
+            'pre-configure 'set-cross-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((mach (assoc-ref inputs "gnumach-headers"))
+                    (hurd (assoc-ref inputs "hurd-headers")))
+                (setenv "CROSS_CPATH"
+                        (string-append mach "/include:"
+                                       hurd "/include"))))
+            ,phases))))
+
+      (propagated-inputs `(("gnumach-headers" ,xgnumach-headers)
+                           ("hurd-headers" ,xhurd-headers)))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs glibc/hurd-headers))))))
+
+  (define xhurd-minimal
+    (package (inherit hurd-minimal)
+      (name (string-append (package-name hurd-minimal)
+                           "-cross-" target))
+
+      (arguments
+       (substitute-keyword-arguments (package-arguments hurd-minimal)
+         ((#:phases phases)
+          `(alist-cons-before
+            'configure 'set-cross-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((glibc-headers (assoc-ref inputs "cross-glibc-hurd-headers")))
+                (setenv "CROSS_CPATH"
+                        (string-append glibc-headers "/include"))))
+            ,phases))))
+
+      (inputs `(("cross-glibc-hurd-headers" ,xglibc/hurd-headers)))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs hurd-minimal))))))
+
+  (package (inherit glibc/hurd)
+    (name (string-append "glibc-hurd-cross-" target))
+    (arguments
+     (substitute-keyword-arguments (package-arguments glibc/hurd)
+       ((#:phases phases)
+        `(alist-cons-before
+          'pre-configure 'set-cross-hurd-headers-path
+          (lambda* (#:key inputs #:allow-other-keys)
+            (let ((mach (assoc-ref inputs "cross-gnumach-headers"))
+                  (hurd (assoc-ref inputs "cross-hurd-headers"))
+                  (hurd-minimal (assoc-ref inputs "cross-hurd-minimal")))
+              (setenv "CROSS_CPATH"
+                      (string-append mach "/include:"
+                                     hurd "/include"))
+              (setenv "CROSS_LIBRARY_PATH"
+                      (string-append hurd-minimal "/lib:"))))
+          ,phases))))
+
+    (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)
+                         ("cross-hurd-headers" ,xhurd-headers)
+                         ("cross-hurd-minimal" ,xhurd-minimal)))
+
+    (native-inputs `(("cross-gcc" ,xgcc)
+                     ("cross-binutils" ,xbinutils)
+                     ("cross-mig" ,xmig)
+                     ,@(alist-delete "mig"(package-native-inputs glibc/hurd))))))
+
 \f
 ;;;
 ;;; Concrete cross toolchains.
-- 
2.1.2


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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-10-26 10:27 [PATCH] gnu: cross-base: Add libc/hurd Manolis Ragkousis
@ 2014-10-29 23:04 ` Ludovic Courtès
  2014-11-01  9:44   ` Manolis Ragkousis
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2014-10-29 23:04 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> From 66df601071d093c5532dec4c1ff55beb141a53d1 Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Sun, 26 Oct 2014 11:29:41 +0000
> Subject: [PATCH] gnu: cross-base: Add libc/hurd.
>
> * gnu/packages/cross-base.scm (cross-libc/hurd): New variable.

Apologies for the loooong delay again!

I’ve applied it locally on wip-hurd, but we’re missing a bit I think:

--8<---------------cut here---------------start------------->8---
$ ./pre-inst-env guix build -e '((@@ (gnu packages cross-base) cross-libc/hurd) "i686-gnu")'
[...]
ERROR: dynamic linker name not known for this system "i686-gnu"
--8<---------------cut here---------------end--------------->8---

Or did you test it differently?

It’s a great start, but I wonder how we could eventually reduce
duplication between ‘cross-libc’ and ‘cross-libc/hurd’.

Thanks,
Ludo’.

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-10-29 23:04 ` Ludovic Courtès
@ 2014-11-01  9:44   ` Manolis Ragkousis
  2014-11-09 10:41     ` Manolis Ragkousis
  2014-11-19 10:20     ` Ludovic Courtès
  0 siblings, 2 replies; 12+ messages in thread
From: Manolis Ragkousis @ 2014-11-01  9:44 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

Good morning everyone.

1) I noticed that in the wip-hurd branch, in hurd-minimal there is a
problem with the autoconf input. Apply the attached diff first.

2) Run make clean before doing anything and rebuild the wip-hurd. It
seems there is a conflict with newer commits. Must rebase on newer
commits and investigate.

3) Try building with ./pre-inst-env guix build -e '((@@ (gnu packages
cross-base) cross-libc/hurd) "i686-pc-gnu")'  . With this it builds on
my boxes.

We could make cross-libc and cross-libc/hurd one package, and choose
what to use depending on the target system. WDYT?

[-- Attachment #2: hurd-minimal.diff --]
[-- Type: text/plain, Size: 437 bytes --]

diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 842e5b3..e989a37 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -150,7 +150,7 @@ Library and other user programs.")
     (build-system gnu-build-system)
     (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers)))
     (native-inputs
-     `(("autoconf" ,autoconf-wrapper)
+     `(("autoconf" ,(autoconf-wrapper))
        ("mig" ,mig)))
 
     (arguments

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-11-01  9:44   ` Manolis Ragkousis
@ 2014-11-09 10:41     ` Manolis Ragkousis
  2014-11-19 10:26       ` Ludovic Courtès
  2014-11-19 10:20     ` Ludovic Courtès
  1 sibling, 1 reply; 12+ messages in thread
From: Manolis Ragkousis @ 2014-11-09 10:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

In crossbase.scm I merged libc and libc/hurd into libc. It chooses the
right libc based on target.
Also included a fix for the autoconf input on hurd-minimal.

Before testing it, do make clean && make on the wip-hurd branch.

Manolis

[-- Attachment #2: 0001-gnu-cross-base-Add-libc-hurd.patch --]
[-- Type: text/x-patch, Size: 8298 bytes --]

From e0fa86ca6fa59e8365188e19b4360ccf71e309f2 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Sun, 26 Oct 2014 11:29:41 +0000
Subject: [PATCH] gnu: cross-base: Add libc/hurd.

* gnu/packages/cross-base.scm (cross-libc): Added libc/hurd.
---
 gnu/packages/cross-base.scm | 159 +++++++++++++++++++++++++++++++++++++-------
 gnu/packages/hurd.scm       |   2 +-
 2 files changed, 137 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 90fc606..4ea6076 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -23,6 +23,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages hurd)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix utils)
@@ -238,30 +239,142 @@ XBINUTILS and the cross tool chain."
       (native-inputs `(("cross-gcc" ,xgcc)
                        ("cross-binutils" ,xbinutils)
                        ,@(package-native-inputs linux-libre-headers)))))
+  
+  (define xgnumach-headers
+    (package (inherit gnumach-headers)
+      (name (string-append (package-name gnumach-headers)
+                           "-cross-" target))
 
-  (package (inherit glibc)
-    (name (string-append "glibc-cross-" target))
-    (arguments
-     (substitute-keyword-arguments
-         `(#:strip-binaries? #f                ; disable stripping (see above)
-           ,@(package-arguments glibc))
-       ((#:configure-flags flags)
-        `(cons ,(string-append "--host=" target)
-               ,flags))
-       ((#:phases phases)
-        `(alist-cons-before
-          'configure 'set-cross-linux-headers-path
-          (lambda* (#:key inputs #:allow-other-keys)
-            (let ((linux (assoc-ref inputs "cross-linux-headers")))
-              (setenv "CROSS_CPATH"
-                      (string-append linux "/include"))
-              #t))
-          ,phases))))
-
-    (propagated-inputs `(("cross-linux-headers" ,xlinux-headers)))
-    (native-inputs `(("cross-gcc" ,xgcc)
-                     ("cross-binutils" ,xbinutils)
-                     ,@(package-native-inputs glibc)))))
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(package-native-inputs gnumach-headers)))))
+
+  (define xmig
+    (package (inherit mig)
+      (name (string-append "mig-cross"))
+      (arguments
+       (substitute-keyword-arguments (package-arguments mig)
+         ((#:configure-flags flags)
+          `(cons ,(string-append "--host=" target)
+                 ,flags))))
+
+      (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)))
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(package-native-inputs mig)))))
+
+  (define xhurd-headers
+    (package (inherit hurd-headers)
+      (name (string-append (package-name hurd-headers)
+                           "-cross-" target))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs hurd-headers))))))
+
+  (define xglibc/hurd-headers
+    (package (inherit glibc/hurd-headers)
+      (name (string-append (package-name glibc/hurd-headers)
+                           "-cross-" target))
+
+      (arguments
+       (substitute-keyword-arguments (package-arguments glibc/hurd-headers)
+         ((#:phases phases)
+          `(alist-cons-before
+            'pre-configure 'set-cross-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((mach (assoc-ref inputs "gnumach-headers"))
+                    (hurd (assoc-ref inputs "hurd-headers")))
+                (setenv "CROSS_CPATH"
+                        (string-append mach "/include:"
+                                       hurd "/include"))))
+            ,phases))))
+
+      (propagated-inputs `(("gnumach-headers" ,xgnumach-headers)
+                           ("hurd-headers" ,xhurd-headers)))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs glibc/hurd-headers))))))
+
+  (define xhurd-minimal
+    (package (inherit hurd-minimal)
+      (name (string-append (package-name hurd-minimal)
+                           "-cross-" target))
+      (arguments
+       (substitute-keyword-arguments (package-arguments hurd-minimal)
+         ((#:phases phases)
+          `(alist-cons-before
+            'configure 'set-cross-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((glibc-headers (assoc-ref inputs "cross-glibc-hurd-headers")))
+                (setenv "CROSS_CPATH"
+                        (string-append glibc-headers "/include:"))))
+            ,phases))))
+
+      (inputs `(("cross-glibc-hurd-headers" ,xglibc/hurd-headers)))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs hurd-minimal))))))
+  
+  ;; Choose libc based on target
+  (match target
+    ("i686-pc-gnu"
+     (package (inherit glibc/hurd)
+       (name (string-append "glibc-hurd-cross-" target))
+       (arguments
+        (substitute-keyword-arguments (package-arguments glibc/hurd)
+          ((#:phases phases)
+           `(alist-cons-before
+             'pre-configure 'set-cross-hurd-headers-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((mach (assoc-ref inputs "cross-gnumach-headers"))
+                     (hurd (assoc-ref inputs "cross-hurd-headers"))
+                     (hurd-minimal (assoc-ref inputs "cross-hurd-minimal")))
+                 (setenv "CROSS_CPATH"
+                         (string-append mach "/include:"
+                                        hurd "/include"))
+                 (setenv "CROSS_LIBRARY_PATH"
+                         (string-append hurd-minimal "/lib:"))))
+             ,phases))))
+
+       (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)
+                            ("cross-hurd-headers" ,xhurd-headers)
+                            ("cross-hurd-minimal" ,xhurd-minimal)))
+
+       (native-inputs `(("cross-gcc" ,xgcc)
+                        ("cross-binutils" ,xbinutils)
+                        ("cross-mig" ,xmig)
+                        ,@(alist-delete "mig"(package-native-inputs glibc/hurd))))))
+    (_ 
+     (package (inherit glibc)
+       (name (string-append "glibc-cross-" target))
+       (arguments
+        (substitute-keyword-arguments
+            `(#:strip-binaries? #f                ; disable stripping (see above)
+              ,@(package-arguments glibc))
+          ((#:configure-flags flags)
+           `(cons ,(string-append "--host=" target)
+                  ,flags))
+          ((#:phases phases)
+           `(alist-cons-before
+             'configure 'set-cross-linux-headers-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((linux (assoc-ref inputs "cross-linux-headers"))                  )
+                 (setenv "CROSS_CPATH"
+                         (string-append linux "/include:"))
+                 #t))
+             ,phases))))
+
+       (propagated-inputs `(("cross-linux-headers" ,xlinux-headers)))
+       
+       (native-inputs `(("cross-gcc" ,xgcc)
+                        ("cross-binutils" ,xbinutils)
+                        ,@(package-native-inputs glibc)))))))
 
 \f
 ;;;
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index 842e5b3..e989a37 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -150,7 +150,7 @@ Library and other user programs.")
     (build-system gnu-build-system)
     (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers)))
     (native-inputs
-     `(("autoconf" ,autoconf-wrapper)
+     `(("autoconf" ,(autoconf-wrapper))
        ("mig" ,mig)))
 
     (arguments
-- 
2.1.3


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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-11-01  9:44   ` Manolis Ragkousis
  2014-11-09 10:41     ` Manolis Ragkousis
@ 2014-11-19 10:20     ` Ludovic Courtès
  1 sibling, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2014-11-19 10:20 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> --- a/gnu/packages/hurd.scm
> +++ b/gnu/packages/hurd.scm
> @@ -150,7 +150,7 @@ Library and other user programs.")
>      (build-system gnu-build-system)
>      (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers)))
>      (native-inputs
> -     `(("autoconf" ,autoconf-wrapper)
> +     `(("autoconf" ,(autoconf-wrapper))
>         ("mig" ,mig)))

Applied, thanks.

Ludo’.

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-11-09 10:41     ` Manolis Ragkousis
@ 2014-11-19 10:26       ` Ludovic Courtès
  2014-11-30 19:01         ` Manolis Ragkousis
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2014-11-19 10:26 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> From e0fa86ca6fa59e8365188e19b4360ccf71e309f2 Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Sun, 26 Oct 2014 11:29:41 +0000
> Subject: [PATCH] gnu: cross-base: Add libc/hurd.
>
> * gnu/packages/cross-base.scm (cross-libc): Added libc/hurd.

I’ve removed the ‘autoconf-wrapper’ fix from the patch, since I’ve
already applied it, but the patch doesn’t apply on wip-hurd.

Could you check what’s going on and update it?  (I’d rather let you do
it because you know better than me.)

Thanks in advance,
Ludo’.

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-11-19 10:26       ` Ludovic Courtès
@ 2014-11-30 19:01         ` Manolis Ragkousis
  2014-11-30 22:31           ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Manolis Ragkousis @ 2014-11-30 19:01 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

The updated patch. It applies successfully on a fresh checkout of wip-hurd.

Check if it applies and let me know.

[-- Attachment #2: 0001-gnu-cross-base-Add-libc-hurd.patch --]
[-- Type: text/x-patch, Size: 7811 bytes --]

From 9fc297bec8397ee8ed7d27f0cfb9b5c14ac1dffc Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Sun, 30 Nov 2014 20:43:30 +0000
Subject: [PATCH] gnu: cross-base: Add libc/hurd.

* gnu/packages/cross-base.scm (cross-libc): Added libc/hurd.
---
 gnu/packages/cross-base.scm | 159 +++++++++++++++++++++++++++++++++++++-------
 1 file changed, 136 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 90fc606..9f9d377 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -23,6 +23,7 @@
   #:use-module (gnu packages base)
   #:use-module (gnu packages commencement)
   #:use-module (gnu packages linux)
+  #:use-module (gnu packages hurd)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix utils)
@@ -238,30 +239,142 @@ XBINUTILS and the cross tool chain."
       (native-inputs `(("cross-gcc" ,xgcc)
                        ("cross-binutils" ,xbinutils)
                        ,@(package-native-inputs linux-libre-headers)))))
+  
+  (define xgnumach-headers
+    (package (inherit gnumach-headers)
+      (name (string-append (package-name gnumach-headers)
+                           "-cross-" target))
 
-  (package (inherit glibc)
-    (name (string-append "glibc-cross-" target))
-    (arguments
-     (substitute-keyword-arguments
-         `(#:strip-binaries? #f                ; disable stripping (see above)
-           ,@(package-arguments glibc))
-       ((#:configure-flags flags)
-        `(cons ,(string-append "--host=" target)
-               ,flags))
-       ((#:phases phases)
-        `(alist-cons-before
-          'configure 'set-cross-linux-headers-path
-          (lambda* (#:key inputs #:allow-other-keys)
-            (let ((linux (assoc-ref inputs "cross-linux-headers")))
-              (setenv "CROSS_CPATH"
-                      (string-append linux "/include"))
-              #t))
-          ,phases))))
-
-    (propagated-inputs `(("cross-linux-headers" ,xlinux-headers)))
-    (native-inputs `(("cross-gcc" ,xgcc)
-                     ("cross-binutils" ,xbinutils)
-                     ,@(package-native-inputs glibc)))))
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(package-native-inputs gnumach-headers)))))
+
+  (define xmig
+    (package (inherit mig)
+      (name (string-append "mig-cross"))
+      (arguments
+       (substitute-keyword-arguments (package-arguments mig)
+         ((#:configure-flags flags)
+          `(cons ,(string-append "--host=" target)
+                 ,flags))))
+
+      (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)))
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ,@(package-native-inputs mig)))))
+
+  (define xhurd-headers
+    (package (inherit hurd-headers)
+      (name (string-append (package-name hurd-headers)
+                           "-cross-" target))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs hurd-headers))))))
+
+  (define xglibc/hurd-headers
+    (package (inherit glibc/hurd-headers)
+      (name (string-append (package-name glibc/hurd-headers)
+                           "-cross-" target))
+
+      (arguments
+       (substitute-keyword-arguments (package-arguments glibc/hurd-headers)
+         ((#:phases phases)
+          `(alist-cons-before
+            'pre-configure 'set-cross-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((mach (assoc-ref inputs "gnumach-headers"))
+                    (hurd (assoc-ref inputs "hurd-headers")))
+                (setenv "CROSS_CPATH"
+                        (string-append mach "/include:"
+                                       hurd "/include"))))
+            ,phases))))
+
+      (propagated-inputs `(("gnumach-headers" ,xgnumach-headers)
+                           ("hurd-headers" ,xhurd-headers)))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs glibc/hurd-headers))))))
+
+  (define xhurd-minimal
+    (package (inherit hurd-minimal)
+      (name (string-append (package-name hurd-minimal)
+                           "-cross-" target))
+      (arguments
+       (substitute-keyword-arguments (package-arguments hurd-minimal)
+         ((#:phases phases)
+          `(alist-cons-before
+            'configure 'set-cross-headers-path
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let ((glibc-headers (assoc-ref inputs "cross-glibc-hurd-headers")))
+                (setenv "CROSS_CPATH"
+                        (string-append glibc-headers "/include:"))))
+            ,phases))))
+
+      (inputs `(("cross-glibc-hurd-headers" ,xglibc/hurd-headers)))
+
+      (native-inputs `(("cross-gcc" ,xgcc)
+                       ("cross-binutils" ,xbinutils)
+                       ("cross-mig" ,xmig)
+                       ,@(alist-delete "mig"(package-native-inputs hurd-minimal))))))
+
+  ;; Choose libc based on target
+  (match target
+    ("i686-pc-gnu"
+     (package (inherit glibc/hurd)
+       (name (string-append "glibc-hurd-cross-" target))
+       (arguments
+        (substitute-keyword-arguments (package-arguments glibc/hurd)
+          ((#:phases phases)
+           `(alist-cons-before
+             'pre-configure 'set-cross-hurd-headers-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((mach (assoc-ref inputs "cross-gnumach-headers"))
+                     (hurd (assoc-ref inputs "cross-hurd-headers"))
+                     (hurd-minimal (assoc-ref inputs "cross-hurd-minimal")))
+                 (setenv "CROSS_CPATH"
+                         (string-append mach "/include:"
+                                        hurd "/include"))
+                 (setenv "CROSS_LIBRARY_PATH"
+                         (string-append hurd-minimal "/lib:"))))
+             ,phases))))
+
+       (propagated-inputs `(("cross-gnumach-headers" ,xgnumach-headers)
+                            ("cross-hurd-headers" ,xhurd-headers)
+                            ("cross-hurd-minimal" ,xhurd-minimal)))
+
+       (native-inputs `(("cross-gcc" ,xgcc)
+                        ("cross-binutils" ,xbinutils)
+                        ("cross-mig" ,xmig)
+                        ,@(alist-delete "mig"(package-native-inputs glibc/hurd))))))
+    (_
+     (package (inherit glibc)
+       (name (string-append "glibc-cross-" target))
+       (arguments
+        (substitute-keyword-arguments
+            `(#:strip-binaries? #f                ; disable stripping (see above)
+              ,@(package-arguments glibc))
+          ((#:configure-flags flags)
+           `(cons ,(string-append "--host=" target)
+                  ,flags))
+          ((#:phases phases)
+           `(alist-cons-before
+             'configure 'set-cross-linux-headers-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (let ((linux (assoc-ref inputs "cross-linux-headers"))                  )
+                 (setenv "CROSS_CPATH"
+                         (string-append linux "/include:"))
+                 #t))
+             ,phases))))
+
+       (propagated-inputs `(("cross-linux-headers" ,xlinux-headers)))
+
+       (native-inputs `(("cross-gcc" ,xgcc)
+                        ("cross-binutils" ,xbinutils)
+                        ,@(package-native-inputs glibc)))))))
 
 \f
 ;;;
-- 
2.1.3


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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-11-30 19:01         ` Manolis Ragkousis
@ 2014-11-30 22:31           ` Ludovic Courtès
  2014-12-01 22:43             ` Manolis Ragkousis
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2014-11-30 22:31 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> From 9fc297bec8397ee8ed7d27f0cfb9b5c14ac1dffc Mon Sep 17 00:00:00 2001
> From: Manolis Ragkousis <manolis837@gmail.com>
> Date: Sun, 30 Nov 2014 20:43:30 +0000
> Subject: [PATCH] gnu: cross-base: Add libc/hurd.
>
> * gnu/packages/cross-base.scm (cross-libc): Added libc/hurd.

Thanks, pushed!

So where are we now?  :-)
What’s the next step?

Thank you for your patience,
Ludo’.

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-11-30 22:31           ` Ludovic Courtès
@ 2014-12-01 22:43             ` Manolis Ragkousis
  2014-12-06 22:21               ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Manolis Ragkousis @ 2014-12-01 22:43 UTC (permalink / raw)
  To: Ludovic Courtès, Guix-devel

Hello Ludo, Hello Guix fellas

For the next step, I must do the appropriate changes to cross-gcc in
crossbase.scm
so I can build it using the new glibc and the hurd headers instead of the linux
ones.
There are also some changes to be done in bootstrap.scm (like adding the dynamic
linker for i686-gnu).

I expect many changes to the whole guix bootstrapping building process, but
one thing at a time. WDYT?

Manolis

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-12-01 22:43             ` Manolis Ragkousis
@ 2014-12-06 22:21               ` Ludovic Courtès
  2014-12-06 22:53                 ` Manolis Ragkousis
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2014-12-06 22:21 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> For the next step, I must do the appropriate changes to cross-gcc in
> crossbase.scm so I can build it using the new glibc and the hurd
> headers instead of the linux ones.  There are also some changes to be
> done in bootstrap.scm (like adding the dynamic linker for i686-gnu).
>
> I expect many changes to the whole guix bootstrapping building
> process, but one thing at a time. WDYT?

I think these will be primarily changes to cross-base.scm, so we can
cross-build the final GCC against the final cross-built libc.  The
‘dynamic-linker’ procedure will also need to be adjusted, indeed.

I’m not sure what else might be missing for the cross-GCC.  We’ll see?  :-)

We’ll need to merge wip-hurd at some point.  We’ll have to make sure the
existing cross tool chains are not broken.  Could you make sure with:

  ./pre-inst-env guix build coreutils --target=mips64el-linux-gnu

Alternately, we could set up Hydra to build the branch.

HTH,
Ludo’.

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-12-06 22:21               ` Ludovic Courtès
@ 2014-12-06 22:53                 ` Manolis Ragkousis
  2014-12-07 20:27                   ` Ludovic Courtès
  0 siblings, 1 reply; 12+ messages in thread
From: Manolis Ragkousis @ 2014-12-06 22:53 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

On 6 December 2014 at 22:21, Ludovic Courtès <ludo@gnu.org> wrote:
> I’m not sure what else might be missing for the cross-GCC.  We’ll see?  :-)

Yep :-)
>
> We’ll need to merge wip-hurd at some point.  We’ll have to make sure the
> existing cross tool chains are not broken.  Could you make sure with:
>
>   ./pre-inst-env guix build coreutils --target=mips64el-linux-gnu
>
I think you meant --target=i686-pc-gnu :-)
I will report back with the results.

Manolis

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

* Re: [PATCH] gnu: cross-base: Add libc/hurd.
  2014-12-06 22:53                 ` Manolis Ragkousis
@ 2014-12-07 20:27                   ` Ludovic Courtès
  0 siblings, 0 replies; 12+ messages in thread
From: Ludovic Courtès @ 2014-12-07 20:27 UTC (permalink / raw)
  To: Manolis Ragkousis; +Cc: Guix-devel

Manolis Ragkousis <manolis837@gmail.com> skribis:

> On 6 December 2014 at 22:21, Ludovic Courtès <ludo@gnu.org> wrote:
>> I’m not sure what else might be missing for the cross-GCC.  We’ll see?  :-)
>
> Yep :-)
>>
>> We’ll need to merge wip-hurd at some point.  We’ll have to make sure the
>> existing cross tool chains are not broken.  Could you make sure with:
>>
>>   ./pre-inst-env guix build coreutils --target=mips64el-linux-gnu
>>
> I think you meant --target=i686-pc-gnu :-)

No, I really meant the above.  I assume you already tested
--target=i686-pc-gnu, and the above is just to make sure that the
existing cross-compilation targets still work.

Hope this clarifies things.
Ludo’.

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

end of thread, other threads:[~2014-12-07 20:27 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-26 10:27 [PATCH] gnu: cross-base: Add libc/hurd Manolis Ragkousis
2014-10-29 23:04 ` Ludovic Courtès
2014-11-01  9:44   ` Manolis Ragkousis
2014-11-09 10:41     ` Manolis Ragkousis
2014-11-19 10:26       ` Ludovic Courtès
2014-11-30 19:01         ` Manolis Ragkousis
2014-11-30 22:31           ` Ludovic Courtès
2014-12-01 22:43             ` Manolis Ragkousis
2014-12-06 22:21               ` Ludovic Courtès
2014-12-06 22:53                 ` Manolis Ragkousis
2014-12-07 20:27                   ` Ludovic Courtès
2014-11-19 10:20     ` Ludovic Courtès

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).