all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] gnu: cross-base: Add cross-kernel-headers package for cross-gcc.
@ 2015-07-21  9:21 Manolis Ragkousis
  2015-07-31 14:52 ` Manolis Ragkousis
  0 siblings, 1 reply; 2+ messages in thread
From: Manolis Ragkousis @ 2015-07-21  9:21 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

This patch adds a cross-kernel-headers package wrapper which returns
the headers for the current  target system. It's either the xlinux-headers
for linux, or a union of Mach + Hurd headers with the hurd-minimal libs.

Tested it for both Linux and Hurd.

Manolis

[-- Attachment #2: 0001-gnu-cross-base-Add-cross-kernel-headers-package-for-.patch --]
[-- Type: text/x-patch, Size: 4129 bytes --]

From ff3604b86fa555ec963cc138b1230bcd2edaa864 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 21 Jul 2015 12:08:18 +0300
Subject: [PATCH] gnu: cross-base: Add cross-kernel-headers package for
 cross-gcc.

* gnu/packages/cross-base.scm (cross-gcc): Add cross-kernel-headers package
  which return the headers needed for each kernel. Replace "xlinux-headers"
  input with "xkernel-headers" input.
---
 gnu/packages/cross-base.scm | 56 ++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 53 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/cross-base.scm b/gnu/packages/cross-base.scm
index 18b0661..67355d5 100644
--- a/gnu/packages/cross-base.scm
+++ b/gnu/packages/cross-base.scm
@@ -226,6 +226,57 @@ may be either a libc package or #f.)"
   "Return a cross-compiler for TARGET, where TARGET is a GNU triplet.  Use
 XBINUTILS as the associated cross-Binutils.  If LIBC is false, then build a
 GCC that does not target a libc; otherwise, target that libc."
+  
+  (define (cross-kernel-headers target libc)
+    "Return headers depending on TARGET."
+    (match target
+      ("i586-pc-gnu"
+       (package
+         ;; This package is a union of the Mach and Hurd headers and the
+         ;; Hurd-minimal package which are needed for the cross-gcc.
+         (name "cross-kernel-headers")
+         (version "0")
+         (source #f)
+         (build-system gnu-build-system)
+         (inputs
+          `(("cross-gnumach-headers" ,@(assoc-ref (package-propagated-inputs libc)
+                                             "cross-gnumach-headers"))
+            ("cross-hurd-headers" ,@(assoc-ref (package-propagated-inputs libc)
+                                          "cross-hurd-headers"))
+            ("cross-hurd-minimal" ,@(assoc-ref (package-propagated-inputs libc)
+                                          "cross-hurd-minimal"))))
+         (arguments
+          `(#:phases (alist-delete
+                      'unpack
+                      (alist-delete
+                       'configure
+                       (alist-delete
+                        'build
+                        (alist-replace
+                         'install
+                         (lambda* (#:key inputs outputs #:allow-other-keys)
+                           (let* ((out  (assoc-ref outputs "out"))
+                                  (incdir (string-append out "/include"))
+                                  (libdir (string-append out "/lib"))
+                                  (mach (assoc-ref inputs "cross-gnumach-headers"))
+                                  (hurd (assoc-ref inputs "cross-hurd-headers"))
+                                  (hurd-minimal (assoc-ref inputs "cross-hurd-minimal")))
+                             (mkdir-p incdir)
+                             (mkdir-p libdir)
+                             (copy-recursively (string-append mach "/include") incdir)
+                             (copy-recursively (string-append hurd "/include") incdir)
+                             (copy-recursively (string-append hurd-minimal "/lib") libdir)
+                             #t))
+                         %standard-phases))))
+
+            #:tests? #f))
+         (home-page #f)
+         (synopsis #f)
+         (description #f)
+         (license gpl2+)))
+      (_
+       (assoc-ref (package-propagated-inputs libc) "linux-headers"))))
+  
   (package (inherit %xgcc)
     (name (string-append "gcc-cross-"
                          (if libc "" "sans-libc-")
@@ -267,9 +318,8 @@ GCC that does not target a libc; otherwise, target that libc."
                                (alist-delete "libc" %final-inputs))))
            (if libc
                `(("libc" ,libc)
-                 ("xlinux-headers"                ;the target headers
-                  ,@(assoc-ref (package-propagated-inputs libc)
-                               "linux-headers"))
+                 ("xkernel-headers"                ;the target headers
+                  ,(cross-kernel-headers target libc))
                  ,@inputs)
                inputs))))
 
-- 
2.4.6


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

* Re: [PATCH] gnu: cross-base: Add cross-kernel-headers package for cross-gcc.
  2015-07-21  9:21 [PATCH] gnu: cross-base: Add cross-kernel-headers package for cross-gcc Manolis Ragkousis
@ 2015-07-31 14:52 ` Manolis Ragkousis
  0 siblings, 0 replies; 2+ messages in thread
From: Manolis Ragkousis @ 2015-07-31 14:52 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

Because a kernel-headers package has more uses than this,
forget this patch. I will send the new patches shortly.

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

end of thread, other threads:[~2015-07-31 14:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-21  9:21 [PATCH] gnu: cross-base: Add cross-kernel-headers package for cross-gcc Manolis Ragkousis
2015-07-31 14:52 ` Manolis Ragkousis

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.