[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
08/19: gnu: base: Added glibc-for-target macro.
From: |
Manolis Fragkiskos Ragkousis |
Subject: |
08/19: gnu: base: Added glibc-for-target macro. |
Date: |
Mon, 28 Dec 2015 19:17:03 +0000 |
phant0mas pushed a commit to branch wip-hurd
in repository guix.
commit 92bb45a39be40db01f08f92cfa5a02cdadbd8ec4
Author: Manolis Ragkousis <address@hidden>
Date: Tue Jun 9 01:08:55 2015 +0300
gnu: base: Added glibc-for-target macro.
* gnu/packages/base.scm (glibc): Add macro.
---
gnu/packages/base.scm | 111 ++++++++++++++++++++++++++++---------------------
1 files changed, 63 insertions(+), 48 deletions(-)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index f9319d2..008d32a 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:
;;;
@@ -463,7 +465,7 @@ store.")
(export make-ld-wrapper)
-(define-public glibc
+(define-public glibc/linux
(package
(name "glibc")
(version "2.22")
@@ -638,10 +640,10 @@ with the Linux kernel.")
;; The old libc, which we use mostly to build locale data in the old format
;; (which the new libc can cope with.)
(package
- (inherit glibc)
+ (inherit glibc/linux)
(version "2.21")
(source (origin
- (inherit (package-source glibc))
+ (inherit (package-source glibc/linux))
(uri (string-append "mirror://gnu/glibc/glibc-"
version ".tar.xz"))
(sha256
@@ -649,6 +651,63 @@ with the Linux kernel.")
"1f135546j34s9bfkydmx2nhh9vwxlx60jldi80zmsnln6wj3dsxf"))
(patches (list (search-patch "glibc-ldd-x86_64.patch")))))))
+(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))))))
+ (synopsis "The GNU C Library (GNU Hurd variant)")
+ (supported-systems %hurd-systems)))
+
+(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)
@@ -753,50 +812,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
- ;; The Hurd's libc variant.
- (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")
- branch wip-hurd created (now d80d08d), Manolis Fragkiskos Ragkousis, 2015/12/28
- 03/19: gnu: cross-base: Make it aware of non-Linux (ie. Hurd) systems., Manolis Fragkiskos Ragkousis, 2015/12/28
- 01/19: gnu: base: Add glibc-hurd and hurd-minimal., Manolis Fragkiskos Ragkousis, 2015/12/28
- 02/19: gnu: cross-base: Add support to cross-build libc for GNU/Hurd., Manolis Fragkiskos Ragkousis, 2015/12/28
- 04/19: gnu: gcc: Also substitute the dynamic linker name for GNU (ie. Hurd) systems., Manolis Fragkiskos Ragkousis, 2015/12/28
- 06/19: gnu: hurd: Pass --build to hurd-headers when not cross building., Manolis Fragkiskos Ragkousis, 2015/12/28
- 05/19: gnu: hurd: Pass --build to gnumach-headers when not cross building., Manolis Fragkiskos Ragkousis, 2015/12/28
- 08/19: gnu: base: Added glibc-for-target macro.,
Manolis Fragkiskos Ragkousis <=
- 10/19: gnu: base: Build glibc-hurd for i586-pc-gnu instead of i686-pc-gnu., Manolis Fragkiskos Ragkousis, 2015/12/28
- 07/19: gnu: base: Updated glibc-hurd to 2.19 and removed patches., Manolis Fragkiskos Ragkousis, 2015/12/28
- 09/19: gnu: cross-base: Build the correct cross-mig., Manolis Fragkiskos Ragkousis, 2015/12/28
- 12/19: gnu: base: Disable bogus code in Hurd's glibc., Manolis Fragkiskos Ragkousis, 2015/12/28
- 14/19: gnu: glibc/hurd: Use hurd-kernel-headers package., Manolis Fragkiskos Ragkousis, 2015/12/28
- 13/19: gnu: hurd: Add hurd-kernel-headers package., Manolis Fragkiskos Ragkousis, 2015/12/28
- 11/19: gnu: make-bootstrap: Produce the correct %glibc-bootstrap-tarball for Hurd systems., Manolis Fragkiskos Ragkousis, 2015/12/28
- 15/19: gnu: cross-gcc, cross-libc: Use hurd-kernel-headers., Manolis Fragkiskos Ragkousis, 2015/12/28
- 16/19: gnu: base: Add libmachuser.so and libhurduser.so to libc.so's search path., Manolis Fragkiskos Ragkousis, 2015/12/28
- 17/19: gnu: glibc/hurd: Make glibc aware of "--with-headers" argument., Manolis Fragkiskos Ragkousis, 2015/12/28