unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: base: Add Glibc-Hurd.
@ 2014-06-02 21:09 Manolis Ragkousis
  2014-06-02 21:38 ` Ludovic Courtès
  0 siblings, 1 reply; 7+ messages in thread
From: Manolis Ragkousis @ 2014-06-02 21:09 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Guix-devel

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

next is glibc/hurd-headers

[-- Attachment #2: 0001-gnu-base-Add-Glibc-Hurd.patch --]
[-- Type: text/x-patch, Size: 10337 bytes --]

From f3a0685b57d8ff7135d2d04ef0c3cb3a78f0fc90 Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis837@gmail.com>
Date: Tue, 3 Jun 2014 00:00:01 +0000
Subject: [PATCH] gnu: base: Add Glibc-Hurd.

* gnu/packages/base.scm (glibc/hurd): New variable.
* gnu/packages/patches/glibc-make-4.0.patch: New patch.
* gnu/packages/patches/glibc-manual-fix.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                               |   2 +
 gnu/packages/base.scm                       | 138 ++++++++++++++++++++++++++++
 gnu/packages/patches/glibc-make-4.0.patch   |  12 +++
 gnu/packages/patches/glibc-manual-fix.patch |  12 +++
 4 files changed, 164 insertions(+)
 create mode 100644 gnu/packages/patches/glibc-make-4.0.patch
 create mode 100644 gnu/packages/patches/glibc-manual-fix.patch

diff --git a/gnu-system.am b/gnu-system.am
index 38e886b..533eb8d 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -302,6 +302,8 @@ dist_patch_DATA =						\
   gnu/packages/patches/glib-tests-prlimit.patch			\
   gnu/packages/patches/glibc-bootstrap-system.patch		\
   gnu/packages/patches/glibc-ldd-x86_64.patch			\
+  gnu/packages/patches/glibc-make-4.0.patch			\
+  gnu/packages/patches/glibc-manual-fix.patch 			\
   gnu/packages/patches/gnunet-fix-scheduler.patch		\
   gnu/packages/patches/gnunet-fix-tests.patch    		\
   gnu/packages/patches/gobject-introspection-cc.patch		\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 09cbe89..8faf797 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2012 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -34,6 +35,10 @@
   #:use-module (gnu packages linux)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages gettext)
+  #:use-module (gnu packages hurd)
+  #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
@@ -508,6 +513,139 @@ with the Linux kernel.")
    (license lgpl2.0+)
    (home-page "http://www.gnu.org/software/libc/")))
 
+(define-public glibc/hurd
+  (package (inherit glibc)
+    (name "glibc-hurd")
+    (version "2.18")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "git://git.sv.gnu.org/hurd/glibc")
+             (commit "a9d8d3808f18de4da9b587e9bdfb6cca4704344b")))
+       (sha256
+        (base32
+         "0jmczzdyps5syhrqyf7lgl3h77br8s74qw0417jp8b4f29ks7pbz"))
+       (file-name (string-append name "-" version))
+       (modules '((guix build utils)))
+       (patches (list (search-patch "glibc-make-4.0.patch")
+                      (search-patch "glibc-manual-fix.patch")))))
+
+    (propagated-inputs `(("gnumach-headers" ,gnumach-headers)
+                         ("hurd-headers" ,hurd-headers)
+                         ("hurd-minimal" ,hurd-minimal)))
+    (native-inputs
+     `(("patch/libpthread-patch" ,(search-patch "libpthread-glibc-preparation.patch"))
+       ("mig" ,mig)
+       ("perl" ,perl)
+       ("texinfo",texinfo)
+       ("gettext" ,gnu-gettext)
+       ("libpthread" ,(origin
+                        (method git-fetch)
+                        (uri (git-reference
+                              (url "git://git.sv.gnu.org/hurd/libpthread")
+                              (commit "f517024dce3e21c525a7b634eab61302d6b99150")))
+                        (sha256
+                         (base32
+                          "0yqfm1hfqlyjzqv3mgf9a3mh4qxx1mqkzn5xiac2vlvji8nns35y"))
+                        (file-name "libpthread" )))))
+
+    (arguments
+     `(#:out-of-source? #t
+       #:configure-flags
+       (list "--enable-add-ons"
+             "--host=i686-pc-gnu"
+             "--disable-profile"
+             "--disable-multi-arch"
+
+             ;; Library functions can not contact the nscd daemon
+             ;; so we disable it.
+             "--disable-nscd"
+             
+             ;; Installs NIS and RPC related headers that 
+             ;; are not installed by default
+             "--enable-obsolete-rpc"
+
+             ;; Install the rpc data base file under `$out/etc/rpc'.
+             (string-append "--sysconfdir="
+                            (assoc-ref %outputs "out")
+                            "/etc")
+
+             (string-append "--localedir=" (assoc-ref %outputs "locales")
+                            "/share/locale")
+             (string-append "libc_cv_localedir="
+                            (assoc-ref %outputs "locales")
+                            "/share/locale")
+             
+             ;; Use our Bash instead of /bin/sh.
+             (string-append "BASH_SHELL="
+                            (assoc-ref %build-inputs "bash")
+                            "/bin/bash"))
+       #:tests? #f
+       #:phases  (alist-cons-after 
+                  'unpack 'bootstrap 
+                  (lambda* (#:key inputs #:allow-other-keys)
+                    (copy-recursively (assoc-ref inputs "libpthread") "libpthread")
+                    (copy-file "libpthread/sysdeps/generic/bits/pthread.h" 
+                               "bits/pthread.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/thread-attr.h" 
+                               "bits/thread-attr.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/mutex-attr.h" 
+                               "bits/mutex-attr.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/thread-specific.h" 
+                               "bits/thread-specific.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/mutex.h" 
+                               "bits/mutex.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/condition-attr.h" 
+                               "bits/condition-attr.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/condition.h" 
+                               "bits/condition.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/rwlock-attr.h" 
+                               "bits/rwlock-attr.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/rwlock.h" 
+                               "bits/rwlock.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/barrier-attr.h" 
+                               "bits/barrier-attr.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/barrier.h" 
+                               "bits/barrier.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/once.h" 
+                               "bits/once.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/cancelation.h" 
+                               "bits/cancelation.h")
+                    (copy-file "libpthread/sysdeps/generic/bits/pthread-np.h" 
+                               "bits/pthread-np.h")
+                    
+                    (zero? (system* "patch" "-p1" "-i" 
+                                    (assoc-ref %build-inputs 
+                                               "patch/libpthread-patch")))
+                    #t)
+                  (alist-cons-before
+                   'configure 'pre-configure
+                   (lambda* (#:key inputs outputs #:allow-other-keys)
+                     (let* ((out  (assoc-ref outputs "out"))
+                            (bin  (string-append out "/bin")))
+                       ;; Use `pwd', not `/bin/pwd'.
+                       (substitute* "configure"
+                         (("/bin/pwd") "pwd"))
+                       
+                       ;; Copy a statically-linked Bash in the output, with
+                       ;; no references to other store paths.
+                       (mkdir-p bin)
+                       (copy-file (string-append (assoc-ref inputs "static-bash")
+                                                 "/bin/bash")
+                                  (string-append bin "/bash"))
+                       (remove-store-references (string-append bin "/bash"))
+                       (chmod (string-append bin "/bash") #o555)
+                       
+                       ;; Keep a symlink, for `patch-shebang' resolution.
+                       (with-directory-excursion bin
+                         (symlink "bash" "sh"))))
+                   (alist-cons-after
+                    'install 'install-locales
+                    (lambda _
+                      (zero? (system* "make" "localedata/install-locales")))
+                    %standard-phases)))))))
+
 (define-public tzdata
   (package
     (name "tzdata")
diff --git a/gnu/packages/patches/glibc-make-4.0.patch b/gnu/packages/patches/glibc-make-4.0.patch
new file mode 100644
index 0000000..d83de1d
--- /dev/null
+++ b/gnu/packages/patches/glibc-make-4.0.patch
@@ -0,0 +1,12 @@
+Allow libc to be compiled with GNU Make 4.0.
+
+--- glibc-2.18/configure	2013-08-11 00:52:55.000000000 +0200
++++ glibc-2.18/configure	2013-10-16 16:53:09.000000000 +0200
+@@ -4772,7 +4772,7 @@ $as_echo_n "checking version of $MAKE...
+   ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
+   case $ac_prog_version in
+     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
+-    3.79* | 3.[89]*)
++    3.79* | 3.[89]* | 4.*)
+        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
+     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
diff --git a/gnu/packages/patches/glibc-manual-fix.patch b/gnu/packages/patches/glibc-manual-fix.patch
new file mode 100644
index 0000000..7370f59
--- /dev/null
+++ b/gnu/packages/patches/glibc-manual-fix.patch
@@ -0,0 +1,12 @@
+diff --git a/manual/contrib.texi b/manual/contrib.texi
+index 3b9d23c..376b40d 100644
+--- a/manual/contrib.texi
++++ b/manual/contrib.texi
+@@ -1,3 +1,4 @@
++@end deftypefun
+ @node Contributors, Free Manuals, Platform, Top
+ @c %MENU% Who wrote what parts of the GNU C Library
+ @appendix Contributors to @theglibc{}
+-- 
+1.9.2
+
-- 
1.9.3


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

end of thread, other threads:[~2014-07-17 15:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-02 21:09 [PATCH] gnu: base: Add Glibc-Hurd Manolis Ragkousis
2014-06-02 21:38 ` Ludovic Courtès
2014-06-06 22:23   ` Manolis Ragkousis
2014-06-09 19:27     ` Ludovic Courtès
2014-06-18 19:56       ` Manolis Ragkousis
2014-06-21 15:20         ` Ludovic Courtès
2014-07-17 15:39           ` Manolis Ragkousis

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