Updated patch.

Manolis
From dbb64e3e1d3e4b7f380c1dcea2b5ef283f64ea3c Mon Sep 17 00:00:00 2001
From: Manolis Ragkousis <manolis...@gmail.com>
Date: Wed, 28 May 2014 22:07:43 +0000
Subject: [PATCH] gnu: hurd: Add Hurd Minimal.

* gnu/packages/hurd.scm (hurd-minimal): New variable.
* gnu/packages/patches/hurd-minimal.patch: New patch.
* gnu-system.am (dist_patch_DATA): Add it.
---
 gnu-system.am                           |  1 +
 gnu/packages/hurd.scm                   | 67 ++++++++++++++++++++++++++++++++-
 gnu/packages/patches/hurd-minimal.patch | 52 +++++++++++++++++++++++++
 3 files changed, 119 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/hurd-minimal.patch

diff --git a/gnu-system.am b/gnu-system.am
index ee00a7a..4ce2000 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -314,6 +314,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/guix-test-networking.patch		\
   gnu/packages/patches/gtkglext-disable-disable-deprecated.patch \
   gnu/packages/patches/hop-bigloo-4.0b.patch			\
+  gnu/packages/patches/hurd-minimal.patch			\
   gnu/packages/patches/inkscape-stray-comma.patch               \
   gnu/packages/patches/libevent-dns-tests.patch			\
   gnu/packages/patches/libffi-mips-n32-fix.patch		\
diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
index f1e7dbc..48602c5 100644
--- a/gnu/packages/hurd.scm
+++ b/gnu/packages/hurd.scm
@@ -20,11 +20,14 @@
   #:use-module (guix licenses)
   #:use-module (guix download)
   #:use-module (guix packages)
+  #:use-module (gnu packages)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages flex)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages perl)
-  #:use-module (gnu packages autotools))
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base)
+  #:use-module (guix git-download))
 
 (define-public gnumach-headers
   (package
@@ -128,3 +131,65 @@ communication.")
      "This package provides C headers of the GNU Hurd, used to build the GNU C
 Library and other user programs.")
     (license gpl2+)))
+
+(define-public hurd-minimal
+  (package
+    (name "hurd-minimal")
+    (version "0.5")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "git://git.savannah.gnu.org/hurd/hurd")
+             (commit "353fe33eb2481a14dc324c7c2e52b2032df86465")))
+       (sha256
+        (base32
+         "1662cnz7mabqmq9ap3hw7aiigg1pdpb3gjm6fxxjj8lrbggsgh4d"))
+       (file-name (string-append name "-" version))
+       (patches (list (search-patch "hurd-minimal.patch")))))
+    (build-system gnu-build-system)
+    (inputs `(("glibc-hurd-headers" ,glibc/hurd-headers)))
+    (native-inputs
+     `(("autoconf" ,autoconf-wrapper)
+       ("mig" ,mig)))
+
+    (arguments
+     `(#:phases (alist-replace
+                 'install
+                 (lambda* (#:key outputs #:allow-other-keys)
+                   (let ((out (assoc-ref outputs "out")))
+                     ;; We need to copy libihash.a to the output directory manually,
+                     ;; since there is no target for that in the makefile.
+                     (mkdir-p (string-append out "/include"))
+                     (copy-file "libihash/ihash.h"
+                                (string-append out "/include/ihash.h"))
+                     (mkdir-p (string-append out "/lib"))
+                     (copy-file "libihash/libihash.a"
+                                (string-append out "/lib/libihash.a"))
+                     #t))
+                 (alist-replace
+                  'build
+                  (lambda _
+                    (zero? (system* "make" "-Clibihash" "libihash.a")))
+                  (alist-cons-before
+                   'configure 'bootstrap
+                   (lambda _
+                     (zero? (system* "autoreconf" "-vfi")))
+                   %standard-phases)))
+       #:configure-flags '(;; Pretend we're on GNU/Hurd; 'configure' wants
+                           ;; that.
+                           "--host=i686-pc-gnu"
+
+                           ;; Reduce set of dependencies.
+                           "--disable-ncursesw"
+                           "--disable-test"
+                           "--without-libbz2"
+                           "--without-libz"
+                           "--without-parted")
+       #:tests? #f))
+    (home-page "http://www.gnu.org/software/hurd/hurd.html";)
+    (synopsis "GNU Hurd libraries")
+    (description
+     "This package provides libihash, needed to build the GNU C 
+Library for GNU/Hurd")
+    (license gpl2+)))
diff --git a/gnu/packages/patches/hurd-minimal.patch b/gnu/packages/patches/hurd-minimal.patch
new file mode 100644
index 0000000..8522428
--- /dev/null
+++ b/gnu/packages/patches/hurd-minimal.patch
@@ -0,1 +1,52 @@
+We need to disable linking with glibc in order to build 
+libihash, which is a dependency of glibc.
+After the flag AC_NO_EXECUTABLES is passed, linking is 
+not allowed so we disable those tests.
+
+diff --git a/configure.ac b/configure.ac
+index ecabfdf..7ede6db 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -83,6 +83,13 @@ AC_PROG_INSTALL
+ AC_PROG_AWK
+ AC_PROG_SED
+ 
++if test "x$cross_compiling" = "xyes"; then
++   # It may be that we don't have a working libc yet, for instance
++   # because we're bootstrapping the cross-compilation tool chain.
++   # Thus, use this undocumented Autoconf macro designed for this.
++   AC_NO_EXECUTABLES
++   AC_MSG_WARN("cross-compiling, disabling linking")
++fi
+ AC_PROG_CC
+ # Require GCC.
+ if test x$GCC != xyes; then
+
+diff --git a/configure.ac b/configure.ac
+index 873ced8..e160db1 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -156,8 +156,9 @@ else
+ fi
+ AC_SUBST(VERSIONING)
+ 
+-# Check if libc contains getgrouplist and/or uselocale.
+-AC_CHECK_FUNCS(getgrouplist uselocale)
++# We do not need to check if libc contains getgrouplist 
++# and/or uselocale for now.
++# AC_CHECK_FUNCS(getgrouplist uselocale)
+ 
+ 
+ # From glibc HEAD, 2007-11-07.
+@@ -293,9 +294,9 @@ AC_SUBST([XKB_BASE])
+ AC_DEFINE_UNQUOTED([X11_PREFIX], "$X11_PREFIX")
+ AC_SUBST([X11_KEYSYMDEF_H])
+ 
+-# Check for Sun RPC headers and library.
++# Check only for Sun RPC headers. We do not need the library yet.
+ AC_CHECK_HEADER([rpc/types.h], [HAVE_SUN_RPC=yes], [HAVE_SUN_RPC=no])
+-AC_SEARCH_LIBS([clnt_create], [], [:], [HAVE_SUN_RPC=no])
++# AC_SEARCH_LIBS([clnt_create], [], [:], [HAVE_SUN_RPC=no])
+ AC_SUBST([HAVE_SUN_RPC])
+ 
+ if test -f ./$ac_unique_file; then
-- 
1.9.3

Reply via email to