all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Manolis Ragkousis <manolis837@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <Guix-devel@gnu.org>
Subject: Re: [PATCH 10/10] gnu: base: Added glibc-for-target macro.
Date: Tue, 9 Jun 2015 01:11:09 +0300	[thread overview]
Message-ID: <CAFtzXzOq94anZVLuH5g__2HOULtznehk-y2Z3WjmrmvRhM9ODQ@mail.gmail.com> (raw)
In-Reply-To: <87vbfg3im5.fsf@gnu.org>

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

Updated patch as well. It's time to push it to wip-hurd.

[-- Attachment #2: 0001-gnu-base-Added-glibc-for-target-macro.patch --]
[-- Type: text/x-patch, Size: 5929 bytes --]

From 21fe31fb235c322654959c458f73c5f192efee7c Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 9 Jun 2015 01:08:55 +0300
Subject: [PATCH] gnu: base: Add glibc-for-target macro.

* gnu/packages/base.scm (glibc): Add macro.
---
 gnu/packages/base.scm | 104 ++++++++++++++++++++++++++++----------------------
 1 file changed, 59 insertions(+), 45 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 64eea3a..5b60e2c 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -43,7 +43,9 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
-  #:use-module (guix build-system trivial))
+  #:use-module (guix build-system trivial)
+  #:use-module (ice-9 match)
+  #:export (glibc))
 
 ;;; Commentary:
 ;;;
@@ -430,7 +432,7 @@ store.")
 
 (export make-ld-wrapper)
 
-(define-public glibc
+(define-public glibc/linux
   (package
    (name "glibc")
    (version "2.21")
@@ -598,6 +600,61 @@ with the Linux kernel.")
    (license lgpl2.0+)
    (home-page "http://www.gnu.org/software/libc/")))
 
+(define-public glibc/hurd
+  (package (inherit glibc/linux)
+    (name "glibc-hurd")
+    (version "2.19")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-"
+                                  version "-hurd+libpthread-20150515" ".tar.gz"))
+              (sha256
+               (base32
+                "0fkmn1kfsbhyrkf1wqqvc47dl5bzflnbcggjjfp5s9c489z916zw"))
+              (patches (list (search-patch "glibc-hurd-libs.patch")
+                             (search-patch "libpthread-remove-duplicate.patch")))))
+
+    ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
+    ;; so both should be propagated.
+    (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
+                         ("hurd-headers" ,hurd-headers)
+                         ("hurd-minimal" ,hurd-minimal)))
+    (native-inputs
+     `(,@(package-native-inputs glibc/linux)
+       ("mig" ,mig)
+       ("perl" ,perl)))
+
+    (arguments
+     (substitute-keyword-arguments (package-arguments glibc/linux)
+       ((#:configure-flags original-configure-flags)
+        `(append (list "--host=i686-pc-gnu"
+
+                       ;; nscd fails to build for GNU/Hurd:
+                       ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
+                       ;; Disable it.
+                       "--disable-nscd")
+                 (filter (lambda (flag)
+                           (not (or (string-prefix? "--with-headers=" flag)
+                                    (string-prefix? "--enable-kernel=" flag))))
+                         ;; Evaluate 'original-configure-flags' in a
+                         ;; lexical environment that has a dummy
+                         ;; "linux-headers" input, to prevent errors.
+                         (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
+                                                ,@%build-inputs)))
+                           ,original-configure-flags))))))))
+
+(define* (glibc-for-target #:optional
+                           (target (or (%current-target-system)
+                                       (%current-system))))
+  "Return the glibc for TARGET, GLIBC/LINUX for a Linux host or
+GLIBC/HURD for a Hurd host"
+  (match target
+    ("i686-pc-gnu" glibc/hurd)
+    (_ glibc/linux)))
+
+(define-syntax glibc
+  (identifier-syntax (glibc-for-target)))
+
 (define-public glibc-locales
   (package
     (inherit glibc)
@@ -694,49 +751,6 @@ variety of options.  It is an alternative to the shell \"type\" built-in
 command.")
     (license gpl3+))) ; some files are under GPLv2+
 
-(define-public glibc/hurd
-  (package (inherit glibc)
-    (name "glibc-hurd")
-    (version "2.19")
-    (source (origin
-              (method url-fetch)
-              (uri (string-append "http://alpha.gnu.org/gnu/hurd/glibc-"
-                                  version "-hurd+libpthread-20150515" ".tar.gz"))
-              (sha256
-               (base32
-                "0fkmn1kfsbhyrkf1wqqvc47dl5bzflnbcggjjfp5s9c489z916zw"))
-              (patches (list (search-patch "glibc-hurd-libs.patch")
-                             (search-patch "libpthread-remove-duplicate.patch")))))
-
-    ;; Libc provides <hurd.h>, which includes a bunch of Hurd and Mach headers,
-    ;; so both should be propagated.
-    (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
-                         ("hurd-headers" ,hurd-headers)
-                         ("hurd-minimal" ,hurd-minimal)))
-    (native-inputs
-     `(,@(package-native-inputs glibc)
-       ("mig" ,mig)
-       ("perl" ,perl)))
-
-    (arguments
-     (substitute-keyword-arguments (package-arguments glibc)
-       ((#:configure-flags original-configure-flags)
-        `(append (list "--host=i686-pc-gnu"
-
-                       ;; nscd fails to build for GNU/Hurd:
-                       ;; <https://lists.gnu.org/archive/html/bug-hurd/2014-07/msg00006.html>.
-                       ;; Disable it.
-                       "--disable-nscd")
-                 (filter (lambda (flag)
-                           (not (or (string-prefix? "--with-headers=" flag)
-                                    (string-prefix? "--enable-kernel=" flag))))
-                         ;; Evaluate 'original-configure-flags' in a
-                         ;; lexical environment that has a dummy
-                         ;; "linux-headers" input, to prevent errors.
-                         (let ((%build-inputs `(("linux-headers" . "@DUMMY@")
-                                                ,@%build-inputs)))
-                           ,original-configure-flags))))))))
-
 (define-public glibc/hurd-headers
   (package (inherit glibc/hurd)
     (name "glibc-hurd-headers")
-- 
2.4.2


  reply	other threads:[~2015-06-08 22:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-18 22:25 [PATCH 10/10] gnu: base: Added glibc-for-target macro Manolis Ragkousis
     [not found] ` <CAFtzXzOyWRnrzdwZJse3CUZmXJa6TnGSg7KR5c5wNSstKeE3cQ@mail.gmail.com>
2015-05-18 22:53   ` Manolis Ragkousis
2015-05-20 12:47     ` Ludovic Courtès
2015-05-22  9:02       ` Manolis Ragkousis
2015-05-25 13:13         ` Ludovic Courtès
2015-06-08 22:11           ` Manolis Ragkousis [this message]
2015-06-09 15:52             ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFtzXzOq94anZVLuH5g__2HOULtznehk-y2Z3WjmrmvRhM9ODQ@mail.gmail.com \
    --to=manolis837@gmail.com \
    --cc=Guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.