From: Manolis Ragkousis <manolis837@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <Guix-devel@gnu.org>
Subject: [PATCH 10/10] gnu: base: Added glibc-for-target macro.
Date: Tue, 19 May 2015 01:25:57 +0300 [thread overview]
Message-ID: <CAFtzXzMBUqVx7D4PtHezNq=N544JOXAVC4vpWHJ4w0p_g-1W6g@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 41 bytes --]
The macro that doesn't work as expected.
[-- Attachment #2: 0010-gnu-base-Added-glibc-for-target-macro.patch --]
[-- Type: text/x-patch, Size: 8497 bytes --]
From 0ee996bfbd300c62f2a31a8b6466de7565022da0 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 19 May 2015 01:10:06 +0300
Subject: [PATCH 10/10] gnu: base: Added glibc-for-target macro.
gnu/packages/base.scm (glibc): Add macro.
---
gnu/packages/base.scm | 178 +++++++++++++++++++++++++++-----------------------
1 file changed, 95 insertions(+), 83 deletions(-)
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index f6fd55d..34bff29 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:
;;;
@@ -432,7 +434,7 @@ store.")
(export make-ld-wrapper)
-(define-public glibc
+(define-public glibc/linux
(package
(name "glibc")
(version "2.21")
@@ -600,6 +602,97 @@ 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
+ "17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
+ (patches (map search-patch
+ '("glibc-hurd-extern-inline.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-public glibc/hurd-headers
+ (package (inherit glibc/hurd)
+ (name "glibc-hurd-headers")
+ (outputs '("out"))
+ (arguments
+ (substitute-keyword-arguments (package-arguments glibc/hurd)
+ ;; We just pass the flags really needed to build the headers.
+ ((#:configure-flags _)
+ `(list "--enable-add-ons"
+ "--host=i686-pc-gnu"
+ "--enable-obsolete-rpc"))
+ ((#:phases _)
+ '(alist-replace
+ 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (and (zero? (system* "make" "install-headers"))
+
+ ;; Make an empty stubs.h to work around not being able to
+ ;; produce a valid stubs.h and causing the build to fail. See
+ ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
+ (let ((out (assoc-ref outputs "out")))
+ (close-port
+ (open-output-file
+ (string-append out "/include/gnu/stubs.h"))))))
+
+ ;; Nothing to build.
+ (alist-delete
+ 'build
+
+ (alist-cons-before
+ 'configure 'pre-configure
+ (lambda _
+ ;; Use the right 'pwd'.
+ (substitute* "configure"
+ (("/bin/pwd") "pwd")))
+ %standard-phases))))))))
+
+(define (glibc-for-target target)
+ "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 (or (%current-target-system) (%current-system)))))
+
(define-public glibc-locales
(package
(inherit glibc)
@@ -696,87 +789,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
- "17gsh0kaz0zyvghjmx861mi2p65m9901lngi179x61zm6v2v3xc4"))
- (patches (map search-patch
- '("glibc-hurd-extern-inline.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")
- (outputs '("out"))
- (arguments
- (substitute-keyword-arguments (package-arguments glibc/hurd)
- ;; We just pass the flags really needed to build the headers.
- ((#:configure-flags _)
- `(list "--enable-add-ons"
- "--host=i686-pc-gnu"
- "--enable-obsolete-rpc"))
- ((#:phases _)
- '(alist-replace
- 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (and (zero? (system* "make" "install-headers"))
-
- ;; Make an empty stubs.h to work around not being able to
- ;; produce a valid stubs.h and causing the build to fail. See
- ;; <http://lists.gnu.org/archive/html/guix-devel/2014-04/msg00233.html>.
- (let ((out (assoc-ref outputs "out")))
- (close-port
- (open-output-file
- (string-append out "/include/gnu/stubs.h"))))))
-
- ;; Nothing to build.
- (alist-delete
- 'build
-
- (alist-cons-before
- 'configure 'pre-configure
- (lambda _
- ;; Use the right 'pwd'.
- (substitute* "configure"
- (("/bin/pwd") "pwd")))
- %standard-phases))))))))
-
(define-public tzdata
(package
(name "tzdata")
--
2.4.1
next reply other threads:[~2015-05-18 22:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 22:25 Manolis Ragkousis [this message]
[not found] ` <CAFtzXzOyWRnrzdwZJse3CUZmXJa6TnGSg7KR5c5wNSstKeE3cQ@mail.gmail.com>
2015-05-18 22:53 ` [PATCH 10/10] gnu: base: Added glibc-for-target macro 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
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFtzXzMBUqVx7D4PtHezNq=N544JOXAVC4vpWHJ4w0p_g-1W6g@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 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).